Browse Source

2023-11-29

W 1 year ago
parent
commit
188e2b4e6e
48 changed files with 1137 additions and 3382 deletions
  1. BIN
      dist.rar
  2. BIN
      dist.zip
  3. BIN
      public/favicon.ico
  4. 6 3
      public/index.html
  5. 0 9
      src/api/comment.js
  6. 5 1
      src/api/company.js
  7. 0 15
      src/api/goods.js
  8. 7 3
      src/api/invest.js
  9. 39 0
      src/api/module.js
  10. 6 1
      src/api/role.js
  11. 41 13
      src/components/Tinymce/components/EditorImage.vue
  12. 105 3
      src/components/Tinymce/index.vue
  13. 2 2
      src/components/Tinymce/plugins.js
  14. 6 4
      src/components/Tinymce/toolbar.js
  15. 2 2
      src/layout/components/Sidebar/Logo.vue
  16. 6 1
      src/permission.js
  17. 50 37
      src/router/auth.js
  18. 45 31
      src/router/index.js
  19. 61 37
      src/views/company/edit.vue
  20. 77 189
      src/views/company/list.vue
  21. 3 2
      src/views/company/output.vue
  22. 111 55
      src/views/company/patent.vue
  23. 1 1
      src/views/company/product.vue
  24. 9 16
      src/views/company/project.vue
  25. 35 25
      src/views/company/talents.vue
  26. 0 133
      src/views/dashboard/components/allRank.vue
  27. 0 166
      src/views/dashboard/components/dailyNum.vue
  28. 0 173
      src/views/dashboard/components/dailySale.vue
  29. 0 192
      src/views/dashboard/components/historyTotal.vue
  30. 0 163
      src/views/dashboard/components/newDaily.vue
  31. 0 124
      src/views/dashboard/components/payRate.vue
  32. 0 253
      src/views/dashboard/components/saleInfo.vue
  33. 0 256
      src/views/dashboard/components/saleNum.vue
  34. 0 128
      src/views/dashboard/components/skuRank.vue
  35. 0 164
      src/views/dashboard/components/skudaySale.vue
  36. 0 138
      src/views/dashboard/components/topTen.vue
  37. 0 177
      src/views/dashboard/components/typeAll.vue
  38. 0 170
      src/views/dashboard/components/wareaLine.vue
  39. 0 146
      src/views/dashboard/components/wareaNew.vue
  40. 0 172
      src/views/dashboard/components/yesRank.vue
  41. 71 321
      src/views/dashboard/index.vue
  42. 46 9
      src/views/invest/achievement.vue
  43. 24 1
      src/views/invest/activity.vue
  44. 5 4
      src/views/login/index.vue
  45. 339 0
      src/views/module/module.vue
  46. 17 27
      src/views/notice/notice.vue
  47. 13 10
      src/views/workstation/workstation.vue
  48. 5 5
      vue.config.js

BIN
dist.rar


BIN
dist.zip


BIN
public/favicon.ico


+ 6 - 3
public/index.html

@@ -1,16 +1,19 @@
+<!--
+ * @Author: 阿小凉
+ * @Date: 2023-11-25 09:01:46
+ * @LastEditTime: 2023-11-29 16:05:33
+-->
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
   <head>
   <head>
     <meta charset="utf-8">
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="renderer" content="webkit">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
     <title><%= webpackConfig.name %></title>
   </head>
   </head>
   <body>
   <body>
-    <noscript>
-      <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
     <div id="app"></div>
     <div id="app"></div>
     <!-- built files will be auto injected -->
     <!-- built files will be auto injected -->
   </body>
   </body>

+ 0 - 9
src/api/comment.js

@@ -1,9 +0,0 @@
-import request from '@/utils/request'
-
- 
-export const getCommentList = params => request({ url: '/comment/list', method: 'get', params })  //获取所有评论
-
-export const getDetail = params => request({ url: '/comment/detail', method: 'get', params })  //获取所有评论
-
-export const delComment = data => request({ url: '/comment/destroy', method: 'post', data })  //获取所有评论
-

+ 5 - 1
src/api/company.js

@@ -1,7 +1,7 @@
 /*
 /*
  * @Author: 阿小凉
  * @Author: 阿小凉
  * @Date: 2023-11-25 09:01:46
  * @Date: 2023-11-25 09:01:46
- * @LastEditTime: 2023-11-27 15:27:55
+ * @LastEditTime: 2023-11-29 18:23:46
  */
  */
 
 
 // 入驻企业
 // 入驻企业
@@ -45,6 +45,8 @@ export const importTalent = data => request({ url: '/talent/import', method: 'po
 export const patentList = params => request({ url: '/patent/list', method: 'get', params })
 export const patentList = params => request({ url: '/patent/list', method: 'get', params })
 // 知识产权模块
 // 知识产权模块
 export const patentCategory = params => request({ url: '/patent/category', method: 'get', params })
 export const patentCategory = params => request({ url: '/patent/category', method: 'get', params })
+// 知识产权信息
+export const patentInfo = params => request({ url: '/patent/info', method: 'get', params })
 // 新增知识产权
 // 新增知识产权
 export const addPatent = data => request({ url: '/patent/add', method: 'post', data })
 export const addPatent = data => request({ url: '/patent/add', method: 'post', data })
 // 修改知识产权
 // 修改知识产权
@@ -59,6 +61,8 @@ export const importPatent = data => request({ url: '/patent/import', method: 'po
 export const projectList = params => request({ url: '/project/list', method: 'get', params })
 export const projectList = params => request({ url: '/project/list', method: 'get', params })
 // 所有项目
 // 所有项目
 export const projectAll = params => request({ url: '/project/all', method: 'get', params })
 export const projectAll = params => request({ url: '/project/all', method: 'get', params })
+// 企业对应下项目
+export const companyProject = params => request({ url: '/project/company_project', method: 'get', params })
 // 企业项目模块
 // 企业项目模块
 export const projectCategory = params => request({ url: '/project/category', method: 'get', params })
 export const projectCategory = params => request({ url: '/project/category', method: 'get', params })
 // 新增企业项目
 // 新增企业项目

+ 0 - 15
src/api/goods.js

@@ -1,15 +0,0 @@
-
-import request from '@/utils/request'
-
-export const getList = params => request({ url: '/company/list', method: 'get', params }) // 获取企业列表
-
-export const addCompany = data => request({ url: '/company/add', method: 'post', data }) // 添加企业
-
-export const upLoadImg = data => request({ url: '/goods/upload_img', method: 'post', data }) // 上传商品图片
-
-export const deleteCompany = data => request({ url: '/company/delete', method: 'post', data }) // 删除企业
-
-export const editCompany = data => request({ url: '/company/edit', method: 'post', data }) // 编辑企业信息
-
-export const importCompany = data => request({ url: '/company/import', method: 'post', data }) // 导入企业信息
-

+ 7 - 3
src/api/invest.js

@@ -6,12 +6,14 @@ import request from '@/utils/request'
 export const investActList = params => request({ url: '/invest/act/list', method: 'get', params })
 export const investActList = params => request({ url: '/invest/act/list', method: 'get', params })
 // 所有活动
 // 所有活动
 export const investActAll = params => request({ url: '/invest/act/all', method: 'get', params })
 export const investActAll = params => request({ url: '/invest/act/all', method: 'get', params })
-// 新增企业
+// 新增活动
 export const addInvestAct = data => request({ url: '/invest/act/add', method: 'post', data })
 export const addInvestAct = data => request({ url: '/invest/act/add', method: 'post', data })
-// 修改企业
+// 修改活动
 export const editInvestAct = data => request({ url: '/invest/act/edit', method: 'post', data })
 export const editInvestAct = data => request({ url: '/invest/act/edit', method: 'post', data })
-// 删除企业
+// 删除活动
 export const deleteInvestAct = data => request({ url: '/invest/act/delete', method: 'post', data })
 export const deleteInvestAct = data => request({ url: '/invest/act/delete', method: 'post', data })
+// 导入活动
+export const importInvestAct = data => request({ url: '/invest/act/import', method: 'post', data })
 
 
 
 
 // 招商成果
 // 招商成果
@@ -23,4 +25,6 @@ export const addInvestAchievement = data => request({ url: '/invest/achievement/
 export const editInvestAchievement = data => request({ url: '/invest/achievement/edit', method: 'post', data })
 export const editInvestAchievement = data => request({ url: '/invest/achievement/edit', method: 'post', data })
 // 删除成果
 // 删除成果
 export const deleteInvestAchievement = data => request({ url: '/invest/achievement/delete', method: 'post', data })
 export const deleteInvestAchievement = data => request({ url: '/invest/achievement/delete', method: 'post', data })
+// 导入
+export const ImportInvestAchievement = data => request({ url: '/invest/achievement/edit', method: 'post', data })
 
 

+ 39 - 0
src/api/module.js

@@ -0,0 +1,39 @@
+/*
+ * @Author: 阿小凉
+ * @Date: 2023-11-29 09:39:46
+ * @LastEditTime: 2023-11-29 09:44:03
+ */
+// 招商企业
+import request from '@/utils/request'
+
+
+// 列表
+export const moduleList = params => request({
+  url: '/module/list',
+  method: 'get',
+  params
+})
+// 分类
+export const moduleCategory = params => request({
+  url: '/module/category',
+  method: 'get',
+  params
+})
+// 新增
+export const addModule = data => request({
+  url: '/module/add',
+  method: 'post',
+  data
+})
+// 修改
+export const editModule = data => request({
+  url: '/module/edit',
+  method: 'post',
+  data
+})
+// 删除
+export const deleteModule = data => request({
+  url: '/module/delete',
+  method: 'post',
+  data
+})

+ 6 - 1
src/api/role.js

@@ -1,3 +1,8 @@
+/*
+ * @Author: 阿小凉
+ * @Date: 2023-11-25 09:01:46
+ * @LastEditTime: 2023-11-29 15:54:51
+ */
 import request from '@/utils/request'
 import request from '@/utils/request'
 
 
 // 所有角色
 // 所有角色
@@ -20,7 +25,7 @@ export const addRole = data => request({
 })
 })
 // 修改角色
 // 修改角色
 export const editRole = data => request({
 export const editRole = data => request({
-  url: '/admin/update_role',
+  url: '/role/edit',
   method: 'post',
   method: 'post',
   data
   data
 })
 })

+ 41 - 13
src/components/Tinymce/components/EditorImage.vue

@@ -1,20 +1,13 @@
 <template>
 <template>
   <div class="upload-container">
   <div class="upload-container">
-    <el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true">
+    <el-button :style="{ background: color, borderColor: color }" icon="el-icon-upload" size="mini" type="primary"
+      @click=" dialogVisible = true">
       上传图片
       上传图片
     </el-button>
     </el-button>
     <el-dialog :visible.sync="dialogVisible">
     <el-dialog :visible.sync="dialogVisible">
-      <el-upload
-        :multiple="true"
-        :file-list="fileList"
-        :show-file-list="true"
-        :on-remove="handleRemove"
-        :on-success="handleSuccess"
-        :before-upload="beforeUpload"
-        class="editor-slide-upload"
-        action="https://httpbin.org/post"
-        list-type="picture-card"
-      >
+      <el-upload :multiple="false" :file-list="fileList" :show-file-list="true" :on-remove="handleRemove"
+        :on-success="handleSuccess" :before-upload="beforeUpload" :http-request="uploadImg" class="editor-slide-upload"
+        action="http://api.xysyszhd.dev.xmnk.cn/api//file/upload" list-type="picture-card" :data="uploadData">
         <el-button size="small" type="primary">
         <el-button size="small" type="primary">
           点击上传
           点击上传
         </el-button>
         </el-button>
@@ -31,6 +24,7 @@
 
 
 <script>
 <script>
 // import { getToken } from 'api/qiniu'
 // import { getToken } from 'api/qiniu'
+import { uploadFile } from '@/api/upload'
 
 
 export default {
 export default {
   name: 'EditorSlideUpload',
   name: 'EditorSlideUpload',
@@ -38,6 +32,9 @@ export default {
     color: {
     color: {
       type: String,
       type: String,
       default: '#1890ff'
       default: '#1890ff'
+    },
+    uploadData: {
+      default: { dir: 'image/company' }
     }
     }
   },
   },
   data() {
   data() {
@@ -48,7 +45,37 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
+    // uploadImg(params) {
+    //   const file = params.file
+    //   const imgType = ['image/png', 'image/jpg', 'image/jpeg']
+    //   if (imgType.indexOf(file.type) === -1) {
+    //     this.$message.warning('上传图片格式必须为: png或jpg格式')
+    //     return false
+    //   }
+    //   const formData = new FormData()
+    //   formData.append('file', file)
+    //   formData.append('dir', 'image/company')
+    //   uploadFile(formData)
+    //     .then(res => {
+    //       this.thumbLoad = false
+    //       try {
+    //         const { message, code, data } = res
+    //         if (code === 200) {
+    //           // 域名/storage/ 拼接
+    //           // this.ruleForm.img.push('http://api.xysyszhd.dev.xmnk.cn/storage/' + data)
+    //         } else {
+    //           this.$message.error(message)
+    //         }
+    //       } catch (e) {
+    //         console.log(`上传轮播图失败: ${e}`)
+    //       }
+    //     })
+    //     .catch(() => {
+    //       this.thumbLoad = false
+    //     })
+    // },
     checkAllSuccess() {
     checkAllSuccess() {
+      console.log(12121)
       return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
       return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
     },
     },
     handleSubmit() {
     handleSubmit() {
@@ -91,7 +118,7 @@ export default {
       return new Promise((resolve, reject) => {
       return new Promise((resolve, reject) => {
         const img = new Image()
         const img = new Image()
         img.src = _URL.createObjectURL(file)
         img.src = _URL.createObjectURL(file)
-        img.onload = function() {
+        img.onload = function () {
           _self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
           _self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
         }
         }
         resolve(true)
         resolve(true)
@@ -104,6 +131,7 @@ export default {
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .editor-slide-upload {
 .editor-slide-upload {
   margin-bottom: 20px;
   margin-bottom: 20px;
+
   ::v-deep .el-upload--picture-card {
   ::v-deep .el-upload--picture-card {
     width: 100%;
     width: 100%;
   }
   }

+ 105 - 3
src/components/Tinymce/index.vue

@@ -1,9 +1,32 @@
 <template>
 <template>
-  <div :class="{fullscreen:fullscreen}" class="tinymce-container" :style="{width:containerWidth}">
+  <div :class="{ fullscreen: fullscreen }" class="tinymce-container" :style="{ width: containerWidth }">
     <textarea :id="tinymceId" class="tinymce-textarea" />
     <textarea :id="tinymceId" class="tinymce-textarea" />
-    <div class="editor-custom-btn-container">
+    <!-- <div class="editor-custom-btn-container">
       <editorImage color="#1890ff" class="editor-upload-btn" @successCBK="imageSuccessCBK" />
       <editorImage color="#1890ff" class="editor-upload-btn" @successCBK="imageSuccessCBK" />
+    </div> -->
+    <div class="editor-custom-btn-container" v-if="showUpload">
+      <el-button :style="{ background: '#1890ff', borderColor: '#1890ff' }" icon="el-icon-upload" size="mini"
+        type="primary" @click="dialogVisible = true">
+        上传图片
+      </el-button>
+      <el-dialog :visible.sync="dialogVisible">
+        <el-upload :multiple="true" :file-list="fileList" :show-file-list="true" :on-remove="handleRemove"
+          :on-success="handleSuccess" :on-error="handleError" :before-upload="beforeUpload" class="editor-slide-upload"
+          action="http://api.xysyszhd.dev.xmnk.cn/api/file/upload" list-type="picture-card" :data="uploadData"
+          :headers="header">
+          <el-button size="small" type="primary">
+            点击上传
+          </el-button>
+        </el-upload>
+        <el-button @click="dialogVisible = false">
+          取消
+        </el-button>
+        <el-button type="primary" @click="handleSubmit">
+          确定
+        </el-button>
+      </el-dialog>
     </div>
     </div>
+
   </div>
   </div>
 </template>
 </template>
 
 
@@ -16,6 +39,10 @@ import editorImage from './components/EditorImage'
 import plugins from './plugins'
 import plugins from './plugins'
 import toolbar from './toolbar'
 import toolbar from './toolbar'
 import load from './dynamicLoadScript'
 import load from './dynamicLoadScript'
+import { uploadFile } from '@/api/upload'
+import {
+  getToken
+} from '@/utils/auth'
 
 
 // why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
 // why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
 const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
 const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
@@ -24,9 +51,19 @@ export default {
   name: 'Tinymce',
   name: 'Tinymce',
   components: { editorImage },
   components: { editorImage },
   props: {
   props: {
+    uploadData: {
+      type: Object,
+      default: () => {
+        return { dir: 'image/company' }
+      }
+    },
+    showUpload: {
+      type: Boolean,
+      default: true
+    },
     id: {
     id: {
       type: String,
       type: String,
-      default: function() {
+      default: function () {
         return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
         return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
       }
       }
     },
     },
@@ -34,6 +71,7 @@ export default {
       type: String,
       type: String,
       default: ''
       default: ''
     },
     },
+
     toolbar: {
     toolbar: {
       type: Array,
       type: Array,
       required: false,
       required: false,
@@ -58,6 +96,12 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      header: {
+        Authorization: 'Bearer ' + getToken()
+      },
+      dialogVisible: false,
+      listObj: {},
+      fileList: [],
       hasChange: false,
       hasChange: false,
       hasInit: false,
       hasInit: false,
       tinymceId: this.id,
       tinymceId: this.id,
@@ -109,6 +153,61 @@ export default {
     this.destroyTinymce()
     this.destroyTinymce()
   },
   },
   methods: {
   methods: {
+    checkAllSuccess() {
+      console.log(this.listObj, 111)
+      return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
+    },
+    handleSubmit() {
+      const arr = Object.keys(this.listObj).map(v => this.listObj[v])
+      if (!this.checkAllSuccess()) {
+        this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
+        return
+      }
+      this.imageSuccessCBK(arr)
+      // this.$emit('successCBK', arr)
+      this.listObj = {}
+      this.fileList = []
+      this.dialogVisible = false
+    },
+    handleSuccess(response, file) {
+      console.log(file, 'file')
+      const uid = file.uid
+      const objKeyArr = Object.keys(this.listObj)
+      for (let i = 0, len = objKeyArr.length; i < len; i++) {
+        if (this.listObj[objKeyArr[i]].uid === uid) {
+          this.listObj[objKeyArr[i]].url = 'http://api.xysyszhd.dev.xmnk.cn/storage/' + file.response.data
+          this.listObj[objKeyArr[i]].hasSuccess = true
+          return
+        }
+      }
+    },
+    handleError(res) {
+      console.log(res, 'err')
+    },
+    handleRemove(file) {
+      const uid = file.uid
+      const objKeyArr = Object.keys(this.listObj)
+      for (let i = 0, len = objKeyArr.length; i < len; i++) {
+        if (this.listObj[objKeyArr[i]].uid === uid) {
+          delete this.listObj[objKeyArr[i]]
+          return
+        }
+      }
+    },
+    beforeUpload(file) {
+      const _self = this
+      const _URL = window.URL || window.webkitURL
+      const fileName = file.uid
+      this.listObj[fileName] = {}
+      return new Promise((resolve, reject) => {
+        const img = new Image()
+        img.src = _URL.createObjectURL(file)
+        img.onload = function () {
+          _self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
+        }
+        resolve(true)
+      })
+    },
     init() {
     init() {
       // dynamic load tinymce from cdn
       // dynamic load tinymce from cdn
       load(tinymceCDN, (err) => {
       load(tinymceCDN, (err) => {
@@ -122,6 +221,8 @@ export default {
     initTinymce() {
     initTinymce() {
       const _this = this
       const _this = this
       window.tinymce.init({
       window.tinymce.init({
+        fontsize_formats: '12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px', // 字体大小
+        // font_formats: 'PingFang SC;微软雅黑=\'微软雅黑\';宋体=\'宋体\';黑体=\'黑体\';仿宋=\'仿宋\';楷体=\'楷体\';隶书=\'隶书\';幼圆=\'幼圆\';Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,;sans-serif', //  字体
         language: this.language,
         language: this.language,
         selector: `#${this.tinymceId}`,
         selector: `#${this.tinymceId}`,
         height: this.height,
         height: this.height,
@@ -205,6 +306,7 @@ export default {
       }
       }
     },
     },
     setContent(value) {
     setContent(value) {
+      console.log(value,'value')
       window.tinymce.get(this.tinymceId).setContent(value)
       window.tinymce.get(this.tinymceId).setContent(value)
     },
     },
     getContent() {
     getContent() {

+ 2 - 2
src/components/Tinymce/plugins.js

@@ -1,12 +1,12 @@
 /*
 /*
  * @Author: 阿小凉
  * @Author: 阿小凉
  * @Date: 2023-11-23 10:33:53
  * @Date: 2023-11-23 10:33:53
- * @LastEditTime: 2023-11-23 15:01:52
+ * @LastEditTime: 2023-11-29 12:36:57
  */
  */
 // Any plugins you want to use has to be imported
 // Any plugins you want to use has to be imported
 // Detail plugins list see https://www.tinymce.com/docs/plugins/
 // Detail plugins list see https://www.tinymce.com/docs/plugins/
 // Custom builds see https://www.tinymce.com/download/custom-builds/
 // Custom builds see https://www.tinymce.com/download/custom-builds/
 
 
-const plugins = ['advlist anchor autolink autosave colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount']
+const plugins = ['advlist  anchor autolink autosave colorpicker colorpicker contextmenu directionality emoticons fullscreen hr  imagetools insertdatetime link lists  nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount']
 
 
 export default plugins
 export default plugins

+ 6 - 4
src/components/Tinymce/toolbar.js

@@ -1,8 +1,10 @@
+/*
+ * @Author: 阿小凉
+ * @Date: 2023-11-25 09:01:46
+ * @LastEditTime: 2023-11-29 13:51:14
+ */
 // Here is a list of the toolbar
 // Here is a list of the toolbar
 // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
 // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
 
 
-const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent  blockquote undo redo removeformat subscript superscript ', 'hr bullist numlist link image charmap preview  pagebreak insertdatetime media table  forecolor backcolor fullscreen']
-// 
-//searchreplace 查找替换
-// bold 加粗
+const toolbar = ['searchreplace fontselect  fontsizeselect  bold italic underline strikethrough alignleft aligncenter alignright outdent indent  blockquote undo redo ', 'hr bullist numlist link  charmap preview  pagebreak insertdatetime  table  forecolor backcolor fullscreen']
 export default toolbar
 export default toolbar

+ 2 - 2
src/layout/components/Sidebar/Logo.vue

@@ -24,8 +24,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      title: 'Vue Element Admin',
-      logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
+      title: '管理系统',
+      logo: ''
     }
     }
   }
   }
 }
 }

+ 6 - 1
src/permission.js

@@ -1,3 +1,8 @@
+/*
+ * @Author: 阿小凉
+ * @Date: 2023-11-25 09:01:46
+ * @LastEditTime: 2023-11-29 15:56:38
+ */
 
 
 import router from './router'
 import router from './router'
 import store from './store'
 import store from './store'
@@ -29,7 +34,7 @@ router.beforeEach(async(to, from, next) => {
       next({ path: '/' })
       next({ path: '/' })
       NProgress.done()
       NProgress.done()
     } else if (to.path === '/') {
     } else if (to.path === '/') {
-      next({ path: '/friendlyLinks' })
+      next({ path: '/' })
     } else {
     } else {
       // 确定用户是否已通过getInfo获得其路由信息
       // 确定用户是否已通过getInfo获得其路由信息
       const hasRoutes = store.getters.permission_routes && store.getters.permission_routes.length > 0
       const hasRoutes = store.getters.permission_routes && store.getters.permission_routes.length > 0

+ 50 - 37
src/router/auth.js

@@ -26,22 +26,22 @@ export const defaultRoutes = [
     path: '/401',
     path: '/401',
     component: '/error-page/401',
     component: '/error-page/401',
     hidden: true
     hidden: true
-  }
-  // {
-  //   path: '/',
-  //   component: 'Layout',
-  //   redirect: "/dashboard",
-  //   children: [{
-  //     path: 'dashboard',
-  //     name:'',
-  //     component: '/dashboard/index',
-  //     meta: {
-  //       title: '首页',
-  //       icon: 'home',
-  //       affix: true,
-  //     }
-  //   }]
-  // },
+  },
+  {
+    path: '/',
+    component: 'Layout',
+    redirect: '/dashboard',
+    children: [{
+      path: 'dashboard',
+      name: '',
+      component: '/dashboard/index',
+      meta: {
+        title: '首页',
+        icon: 'home',
+        affix: true,
+      }
+    }]
+  },
 
 
 ]
 ]
 
 
@@ -73,21 +73,22 @@ export const developerRoutes = [
 ]
 ]
 
 
 // 权限路由
 // 权限路由
-export const asyncRoutes = [{
-    path: '/',
-    component: 'Layout',
-    redirect: '/dashboard',
-    children: [{
-      path: 'dashboard',
-      name: 'Dashboard',
-      component: '/dashboard/index',
-      meta: {
-        title: '首页',
-        icon: 'home',
-        affix: true
-      }
-    }]
-  },
+export const asyncRoutes = [
+  // {
+  //   path: '/',
+  //   component: 'Layout',
+  //   redirect: '/dashboard',
+  //   children: [{
+  //     path: 'dashboard',
+  //     name: 'Dashboard',
+  //     component: '/dashboard/index',
+  //     meta: {
+  //       title: '首页',
+  //       icon: 'home',
+  //       affix: true
+  //     }
+  //   }]
+  // },
   {
   {
     path: '/company',
     path: '/company',
     component: 'Layout',
     component: 'Layout',
@@ -114,8 +115,7 @@ export const asyncRoutes = [{
         hidden: true,
         hidden: true,
         meta: {
         meta: {
           title: '添加/修改企业',
           title: '添加/修改企业',
-          noCache: true,
-          icon: 'stock'
+          noCache: true
         }
         }
       },
       },
       {
       {
@@ -135,7 +135,7 @@ export const asyncRoutes = [{
         meta: {
         meta: {
           title: '知识产权',
           title: '知识产权',
           noCache: true,
           noCache: true,
-          icon: 'account'
+          icon: 'inte'
         }
         }
       },
       },
       {
       {
@@ -145,7 +145,7 @@ export const asyncRoutes = [{
         meta: {
         meta: {
           title: '企业项目',
           title: '企业项目',
           noCache: true,
           noCache: true,
-          icon: 'account'
+          icon: 'excel'
         }
         }
       },
       },
       {
       {
@@ -155,7 +155,7 @@ export const asyncRoutes = [{
         meta: {
         meta: {
           title: '企业产值',
           title: '企业产值',
           noCache: true,
           noCache: true,
-          icon: 'account'
+          icon: 'lock'
         }
         }
       },
       },
       {
       {
@@ -165,7 +165,7 @@ export const asyncRoutes = [{
         meta: {
         meta: {
           title: '企业产品',
           title: '企业产品',
           noCache: true,
           noCache: true,
-          icon: 'account'
+          icon: 'list'
         }
         }
       }
       }
     ]
     ]
@@ -215,6 +215,19 @@ export const asyncRoutes = [{
     }]
     }]
   },
   },
   {
   {
+    path: '/module',
+    component: 'Layout',
+    children: [{
+      path: 'module',
+      name: 'Module',
+      component: '/module/module',
+      meta: {
+        title: '动态模块',
+        icon: 'link'
+      }
+    }]
+  },
+  {
     path: '/notice',
     path: '/notice',
     component: 'Layout',
     component: 'Layout',
     children: [{
     children: [{

+ 45 - 31
src/router/index.js

@@ -51,23 +51,23 @@ export const constantRoutes = [{
     path: '/404',
     path: '/404',
     component: () => import('@/views/404'),
     component: () => import('@/views/404'),
     hidden: true
     hidden: true
-  }
+  },
 
 
-  // {
-  //   path: "/",
-  //   component: Layout,
-  //   redirect: "/dashboard",
-  //   children: [{
-  //     path: "dashboard",
-  //     name: "Dashboard",
-  //     component: () => import("@/views/dashboard/index"),
-  //     meta: {
-  //       title: "首页",
-  //       icon: "home",
-  //       affix: true,
-  //     }
-  //   }]
-  // },
+  {
+    path: "/",
+    component: Layout,
+    redirect: "/dashboard",
+    children: [{
+      path: "dashboard",
+      name: "Dashboard",
+      component: () => import("@/views/dashboard/index"),
+      meta: {
+        title: "首页",
+        icon: "home",
+        affix: true,
+      }
+    }]
+  },
 
 
 ]
 ]
 
 
@@ -76,21 +76,22 @@ export const constantRoutes = [{
  * asyncRoutes
  * asyncRoutes
  * the routes that need to be dynamically loaded based on user roles
  * the routes that need to be dynamically loaded based on user roles
  */
  */
-export const asyncRoutes = [{
-    path: '/',
-    component: Layout,
-    redirect: '/dashboard',
-    children: [{
-      path: 'dashboard',
-      name: 'Dashboard',
-      component: () => import('@/views/dashboard/index'),
-      meta: {
-        title: '首页',
-        icon: 'home',
-        affix: true
-      }
-    }]
-  },
+export const asyncRoutes = [
+  // {
+  //   path: '/',
+  //   component: Layout,
+  //   redirect: '/dashboard',
+  //   children: [{
+  //     path: 'dashboard',
+  //     name: 'Dashboard',
+  //     component: () => import('@/views/dashboard/index'),
+  //     meta: {
+  //       title: '首页',
+  //       icon: 'home',
+  //       affix: true
+  //     }
+  //   }]
+  // },
 
 
 
 
   {
   {
@@ -244,6 +245,19 @@ export const asyncRoutes = [{
       }
       }
     }]
     }]
   },
   },
+  {
+    path: '/module',
+    component: 'Layout',
+    children: [{
+      path: 'module',
+      name: 'Module',
+      component: () => import('@/views/module/module'),
+      meta: {
+        title: '动态模块',
+        icon: 'link'
+      }
+    }]
+  },
   backstageRouter, {
   backstageRouter, {
     path: '*',
     path: '*',
     redirect: '/404',
     redirect: '/404',

+ 61 - 37
src/views/company/edit.vue

@@ -6,16 +6,20 @@
         <el-form-item label="企业名称" prop="name">
         <el-form-item label="企业名称" prop="name">
           <el-input v-model="ruleForm.name" placeholder="请输入企业名称"></el-input>
           <el-input v-model="ruleForm.name" placeholder="请输入企业名称"></el-input>
         </el-form-item>
         </el-form-item>
+        <el-form-item label="排序:" prop="sort">
+          <el-input v-model="ruleForm.sort" placeholder="数字越大越靠前" type="number"></el-input>
+        </el-form-item>
         <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
         <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
+          <!-- <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
+            :style="{ width: '300px' }" filterable clearableruleFormruleForm
+            @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)"> -->
           <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
           <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
-            @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)" :style="{ width: '300px' }" filterable
-            clearableruleFormruleForm>
-            <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id"
-              @click.native="flterChange(item)">
+            :style="{ width: '300px' }" filterable clearableruleFormruleForm>
+            <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
               <span style="float: left" class="span-style">{{ temp.name }}</span>
               <span style="float: left" class="span-style">{{ temp.name }}</span>
-              <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
-                <i class="el-icon-delete" /></span>
-              <span style="float: right" class="span-style" @click.stop="editItem(item.id, temp, i)">
+              <!-- <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
+                <i class="el-icon-delete" /></span> -->
+              <span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, temp, i)">
                 <i class="el-icon-edit-outline" />
                 <i class="el-icon-edit-outline" />
               </span>
               </span>
             </el-option>
             </el-option>
@@ -47,7 +51,7 @@
               (建议尺寸画布600*480,大小50K)
               (建议尺寸画布600*480,大小50K)
             </div>
             </div>
           </el-upload>
           </el-upload>
-          <div class="flexS" style="flex-wrap: wrap;" v-if="ruleForm.img.length > 0">
+          <div class="flexS" style="flex-wrap: wrap;" v-if="ruleForm.img&&ruleForm.img.length > 0">
             <div v-for="(item, i) in ruleForm.img" :key="i" class="banner_item">
             <div v-for="(item, i) in ruleForm.img" :key="i" class="banner_item">
               <el-image :src="item" style="width: 100px;height: 100px;margin:0 10px 0 10px;"
               <el-image :src="item" style="width: 100px;height: 100px;margin:0 10px 0 10px;"
                 :preview-src-list="ruleForm.img" />
                 :preview-src-list="ruleForm.img" />
@@ -55,20 +59,20 @@
             </div>
             </div>
           </div>
           </div>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="企业简介" prop="introduction" required>
-          <tinymce v-model="ruleForm.introduction" :height="300" width="60%" />
-        </el-form-item>
         <el-form-item label="服务案例" prop="service_info" required>
         <el-form-item label="服务案例" prop="service_info" required>
-          <el-input type="service_info" v-model="ruleForm.service_info"></el-input>
+          <textarea name="" id="" cols="30" rows="10" v-model="ruleForm.service_info" style="width:60%;"></textarea>
+        </el-form-item>
+        <el-form-item label="企业简介" prop="introduction" required>
+          <tinymce v-model="ruleForm.introduction" :height="300" width="60%" menubar="" />
         </el-form-item>
         </el-form-item>
         <el-form-item label="企业荣誉" prop="honor" required>
         <el-form-item label="企业荣誉" prop="honor" required>
-          <tinymce v-model="ruleForm.honor" :height="300" width="60%" />
+          <tinymce v-model="ruleForm.honor" :height="300" width="60%" menubar="" />
         </el-form-item>
         </el-form-item>
         <el-form-item label="研究成果" prop="achievement" required>
         <el-form-item label="研究成果" prop="achievement" required>
-          <tinymce v-model="ruleForm.achievement" :height="300" width="60%" />
+          <tinymce v-model="ruleForm.achievement" :height="300" width="60%" menubar="" />
         </el-form-item>
         </el-form-item>
         <el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
+          <el-button type="primary" @click="submitForm('ruleForm')">{{ id ? '保存' : '立即创建' }}</el-button>
           <el-button @click="resetForm('ruleForm')">重置</el-button>
           <el-button @click="resetForm('ruleForm')">重置</el-button>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
@@ -77,7 +81,7 @@
 </template>
 </template>
 <script>
 <script>
 import Tinymce from '@/components/Tinymce'
 import Tinymce from '@/components/Tinymce'
-import { addCompany, companyCategory } from '@/api/company'
+import { addCompany, companyCategory, companyInfo, editCompany } from '@/api/company'
 import { addCategory, editCategory, deleteCategory } from '@/api/category'
 import { addCategory, editCategory, deleteCategory } from '@/api/category'
 import { uploadFile } from '@/api/upload'
 import { uploadFile } from '@/api/upload'
 
 
@@ -85,6 +89,7 @@ export default {
   name: 'EnterpriseAdd',
   name: 'EnterpriseAdd',
   data() {
   data() {
     return {
     return {
+      id: '',
       categoryList: [], // 类型列表
       categoryList: [], // 类型列表
       formData: {
       formData: {
         value: "",
         value: "",
@@ -148,35 +153,54 @@ export default {
   },
   },
   created() {
   created() {
     this.getCategory()
     this.getCategory()
-    const info = window.localStorage.getItem('companyInfo')
-    const { name, industry, high_tech, datatype, parks, is_leading, is_service, is_research, introduction, img, honor, service_info, achievement } = JSON.parse(info)
-    this.ruleForm = {
-      name,
-      industry,
-      high_tech,
-      datatype,
-      parks,
-      is_leading,
-      is_service,
-      is_research,
-      introduction,
-      img: [],
-      honor,
-      service_info,
-      achievement
+    let id = this.$route.params.id
+    if (id) {
+      this.getInfo(id)
+      this.id = id
     }
     }
+
   },
   },
   components: { Tinymce },
   components: { Tinymce },
   methods: {
   methods: {
+    getInfo(id) {
+      companyInfo({ id }).then(res => {
+        const { code, data, msg } = res
+        if (code === 200) {
+          const { name, industry, high_tech, datatype, parks, is_leading, is_service, is_research, introduction, img, honor, service_info, achievement, sort } = data
+          this.ruleForm = {
+            name,
+            industry: industry.id,
+            high_tech: high_tech.id,
+            datatype: datatype.id,
+            parks: parks.id,
+            is_leading,
+            is_service,
+            is_research,
+            introduction,
+            img,
+            honor,
+            service_info,
+            achievement,
+            sort
+          }
+        } else {
+          this.$message.error(msg)
+        }
+      })
+    },
     // 添加/修改企业
     // 添加/修改企业
     submitForm(formName) {
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
       this.$refs[formName].validate((valid) => {
         if (valid) {
         if (valid) {
-          addCompany(this.ruleForm).then(res => {
+          const http = this.id ? editCompany : addCompany
+          const { name, industry, high_tech, datatype, parks, is_leading, is_service, is_research, introduction, img, honor, service_info, achievement, sort } = this.ruleForm
+          const data = this.id ? { name, industry, high_tech, datatype, parks, is_leading, is_service, is_research, introduction, img, honor, service_info, achievement, sort, id: this.id } : this.ruleForm
+          http(data).then(res => {
             if (res.code === 200) {
             if (res.code === 200) {
-              this.$message.success('添加成功!')
+              this.$message.success(this.id ? '添加成功!' : '修改成功')
+              this.$router.push('/company/company')
             } else {
             } else {
-              this.$message.success('添加失败!')
+              this.$message.success(this.id ? '添加失败!' : '修改失败' || res.msg)
             }
             }
           })
           })
         } else {
         } else {
@@ -240,7 +264,7 @@ export default {
     },
     },
     // 添加/修改类型
     // 添加/修改类型
     addItem(fid, isEdit, info, idx) {
     addItem(fid, isEdit, info, idx) {
-      if (info && info != null && isEdit === 1) {
+      if (info && info != null && isEdit !== 1) {
         this.$message.error('无可编辑内容')
         this.$message.error('无可编辑内容')
         return
         return
       }
       }
@@ -305,7 +329,7 @@ export default {
           el.style =
           el.style =
             "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
             "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
           el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
           el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
-            <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增产品</span>
+            <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增</span>
             </li>`;
             </li>`;
           product.appendChild(el);
           product.appendChild(el);
           // 新增按钮点击事件
           // 新增按钮点击事件

+ 77 - 189
src/views/company/list.vue

@@ -1,7 +1,20 @@
 <template>
 <template>
   <div class="content">
   <div class="content">
     <div v-loading.fullscreen.lock="loadingFull" />
     <div v-loading.fullscreen.lock="loadingFull" />
-    <div class="search_box">
+    <div class="search_box flexS">
+      <div v-for="(item, idx) in categoryList" :key="idx">
+        <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()" clearable
+          @clear="toSearch()">
+          <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+      </div>
+      <el-input v-model="params.search_name" clearable placeholder="企业名称" prefix-icon="el-icon-search"
+        @keyup.enter.native="toSearch()" @clear="toSearch()" />
+      <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
+      <el-upload class="upload-demo" action="" :http-request="uploadFile" :multiple="false" :show-file-list="false">
+        <el-button type="primary" style="margin:0 10px;">导入</el-button>
+      </el-upload>
+
       <el-button type="primary" icon="el-icon-edit" class="filter-item" @click="handleAdd">添加</el-button>
       <el-button type="primary" icon="el-icon-edit" class="filter-item" @click="handleAdd">添加</el-button>
     </div>
     </div>
     <div class="table_box">
     <div class="table_box">
@@ -37,18 +50,19 @@
         </el-table-column>
         </el-table-column>
         <el-table-column label="是否第三方机构" prop="is_service" align="center">
         <el-table-column label="是否第三方机构" prop="is_service" align="center">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="row.is_leading == 1 ? 'success' : 'danger'">
-              {{ row.is_leading == 1 ? "是" : "不是" }}
+            <el-tag :type="row.is_service == 1 ? 'success' : 'danger'">
+              {{ row.is_service == 1 ? "是" : "不是" }}
             </el-tag>
             </el-tag>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column label="是否研发机构" prop="is_research" align="center">
         <el-table-column label="是否研发机构" prop="is_research" align="center">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="row.is_leading == 1 ? 'success' : 'danger'">
-              {{ row.is_leading == 1 ? "是" : "不是" }}
+            <el-tag :type="row.is_research == 1 ? 'success' : 'danger'">
+              {{ row.is_research == 1 ? "是" : "不是" }}
             </el-tag>
             </el-tag>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
+        <el-table-column prop="sort" label="排序" align="center" />
         <el-table-column label="操作" align="center" width="100">
         <el-table-column label="操作" align="center" width="100">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="handleEdit(scope.row)">编辑</el-button>
             <el-button type="text" size="mini" @click="handleEdit(scope.row)">编辑</el-button>
@@ -65,105 +79,87 @@
 </template>
 </template>
 
 
 <script>
 <script>
-// 商品详情字段
-const goodsInfo = {
-  contents: '',
-  id: '',
-  img_url: '',
-  name: '',
-  sku: [],
-  spec: {},
-  status: 0,
-  title: ''
-}
-import { companyList, companyInfo, companyAll, companyCategory, addCompany, editCompany, deleteCompany, importCompany } from '@/api/company'
+import { companyList, deleteCompany, importCompany, companyCategory } from '@/api/company'
 
 
 export default {
 export default {
-  name: 'GoodsList',
+  name: 'CompanyList',
   data() {
   data() {
     return {
     return {
       params: {
       params: {
         page_size: 20,
         page_size: 20,
         page_index: 1,
         page_index: 1,
         search_name: '',
         search_name: '',
-        search_industry: '',
-        search_tech: '',
-        search_type: '',
-        search_parks: ''
+        industry: '',
+        tech: '',
+        type: '',
+        parks: ''
       },
       },
       listData: [], // 商品列表
       listData: [], // 商品列表
       listTotal: 0,
       listTotal: 0,
-
-
-      sortList: [],
-      sortIdList: [],
-      choosedList: [],
-      startEndInfo: {},
-      goodListTotal: 0,
-      startEndInfoDate: [],
       dialogVisible: false,
       dialogVisible: false,
-      goodsInfo: goodsInfo,
-      dialogSortVisible: false,
-      dialogGoodsVisible: false,
-      dialogStartEndVisible: false,
       loadingFull: false,
       loadingFull: false,
-      updownType: '',
-      attrList: [], // 类型列表
-      attr: '',
-      sizeRemarkShow: false, // 显示尺码备注弹窗
-      remarkList: [], // 尺码备注列表
-      sizeImgList: [], // 尺码图
-      goodsName: '', // 商品名称
-      goods_id: '' // 商品id
+      industryOptions: [],
+      techOptions: [],
+      typeOptions: [],
+      parksOptions: [],
+      categoryList: []
     }
     }
   },
   },
   created() {
   created() {
-    //  this.getAttr()
     this.getList()
     this.getList()
-
+    this.getCategory()
   },
   },
   methods: {
   methods: {
-    // 尺码图上传
-    sizePictureUpload(params, idx) {
-      this.thumbLoad = true
-      const file = params.file
-      const imgType = ['image/png', 'image/jpg', 'image/jpeg']
-      if (imgType.indexOf(file.type) === -1) {
-        this.$message.warning('上传图片格式必须为: png或jpg格式')
-        return false
+    // 获取列表
+    async getCategory() {
+      try {
+        const res = await companyCategory()
+        const { msg, code, data } = res
+        if (code === 200) {
+          this.categoryList = data
+          // for (let i = 0; i < data.length; i++) {
+          //   if (data[i].mark === "industry") {
+          //     data[i].children.map(j => {
+          //       this.industryOptions.push({ name: j.name, value: j.id })
+          //     })
+          //   }else if(data[i].mark === '')
+          // }
+        } else {
+          this.$message.error(msg)
+        }
+      } catch (e) {
+        console.log(`获取失败:${e}`)
       }
       }
-      const formdata = new FormData()
-      formdata.append('img', file)
-      upLoadImg(formdata)
-        .then(res => {
-          this.thumbLoad = false
-          try {
-            const { message, code, data } = res
-            if (code === 200) {
-              this.sizeImgList[idx].size_img = data
-            } else {
-              this.$message.error(message)
-            }
-          } catch (e) {
-            console.log(`上传尺码图失败: ${e}`)
-          }
-        })
-        .catch(() => {
-          this.thumbLoad = false
-        })
-    },
-    // 删除某一个尺码图
-    deleteSize(i) {
-      this.sizeImgList[i].size_img = ''
     },
     },
-    handleTagToggle(tab) {
-      this.params.status = tab.name
+    // 搜索
+    toSearch() {
+      this.params.page_index = 1
       this.getList()
       this.getList()
     },
     },
     // 添加企业
     // 添加企业
     handleAdd() {
     handleAdd() {
       this.$router.push({
       this.$router.push({
-        name: 'goods_add'
+        name: 'EditCompany'
+      })
+    },
+    // 导入
+    uploadFile(params) {
+      const file = params.file
+      var formData = new FormData()
+      formData.append('file', file)
+      const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls')
+      console.log(file.name, 'file')
+      if (!isExcel) {
+        this.$message.error('仅支持上传 .xlsx 或 .xls 格式的文件!')
+        return
+      }
+      importCompany(formData).then(res => {
+        if (res.code === 200) {
+          this.$message.success('导入成功!')
+          this.getList()
+        } else {
+          this.$message.error(res.message || '导入失败!')
+        }
       })
       })
     },
     },
     // 获取列表
     // 获取列表
@@ -219,121 +215,13 @@ export default {
       this.params.page_index = page
       this.params.page_index = page
       this.getList()
       this.getList()
     },
     },
-    // 查看商品详情
-    handleSeeInfo(row) {
-      const { id } = row
-      this.getInfo(id)
-    },
-    // 查看商品详情
-    async getInfo(id) {
-      this.loadingFull = true
-      try {
-        const res = await getInfo({ id })
-        const { message, code, data } = res
-        if (code === 200) {
-          this.goodsInfo = data
-          this.dialogGoodsVisible = true
-          this.loadingFull = false
-        } else {
-          this.$message.error(message)
-          this.loadingFull = false
-        }
-      } catch (e) {
-        console.log(`查看商品详情失败:${e}`)
-        this.loadingFull = false
-      }
-    },
-    // 商品详情sku展示
-    skuShow(sku) {
-      if (sku.length < 1) {
-        return []
-      }
-      const item = sku[0]
-      const keyArr = Object.keys(item)
-      return keyArr
-    },
+
     // 编辑企业信息
     // 编辑企业信息
     handleEdit(row) {
     handleEdit(row) {
-      window.localStorage.setItem('companyInfo', JSON.stringify(row))
       this.$router.push({
       this.$router.push({
-        name: 'EditCompany'
+        name: 'EditCompany',
+        params: { id: row.id }
       })
       })
-    },
-    // 编号
-    indexMethod(index) {
-      const { page_index, page_size } = this.params
-      index += (page_index - 1) * page_size + 1
-      return index
-    },
-    handlerStartEnd(row) {
-      // 点击上下架
-      this.startEndInfo = row
-      this.dialogStartEndVisible = true
-    },
-    handlerStartEndList() {
-      // 点击批量上下架
-      this.updownType = 'list'
-      this.startEndInfo = this.choosedList[0]
-      this.dialogStartEndVisible = true
-    },
-    startEnd() {
-      // 点击定时上下架确定
-      if (this.startEndInfoDate && this.startEndInfoDate.length) {
-        // startEndList
-        if (this.updownType === 'list') {
-          // 如果是批量
-          this.$request(
-            startEndList({
-              id: this.choosedList.map(e => e.id),
-              start: +this.startEndInfoDate[0] / 1000,
-              end: +this.startEndInfoDate[1] / 1000
-            }),
-            data => {
-              this.updownType = ''
-              this.dialogStartEndVisible = false
-              this.$refs.goodsList.clearSelection()
-              this.getList()
-            }
-          )
-        } else {
-          this.$request(
-            upDownGoods({
-              id: this.startEndInfo.id,
-              start: +this.startEndInfoDate[0] / 1000,
-              end: +this.startEndInfoDate[1] / 1000
-            }),
-            data => {
-              this.$message.success('设置成功')
-              this.dialogStartEndVisible = false
-              this.startEndInfoDate = null
-              this.getList()
-            }
-          )
-        }
-      } else {
-        this.$message.error('请选择定时上下架的时间区间')
-      }
-    },
-    clearStartEnd() {
-      // 清除定时上下架
-      if (this.updownType === 'list') {
-        this.$request(
-          startEndList({ id: this.choosedList.map(e => e.id) }),
-          data => {
-            this.updownType = ''
-            this.dialogStartEndVisible = false
-            this.$refs.goodsList.clearSelection()
-            this.getList()
-          }
-        )
-      } else {
-        this.$request(clearUpDown({ id: this.startEndInfo.id }), data => {
-          this.$message.success('设置成功')
-          this.dialogStartEndVisible = false
-          this.startEndInfoDate = null
-          this.getList()
-        })
-      }
     }
     }
   }
   }
 }
 }

+ 3 - 2
src/views/company/output.vue

@@ -45,10 +45,11 @@
                     </el-date-picker>
                     </el-date-picker>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="企业产值:" prop="output">
                 <el-form-item label="企业产值:" prop="output">
-                    <el-input v-model="ruleForm.output" placeholder="请输入项目产值" style="width:300px" />
+                    <el-input v-model="ruleForm.output" placeholder="请输入项目产值" style="width:300px" type="number" />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="工业产值:" prop="industrial_output">
                 <el-form-item label="工业产值:" prop="industrial_output">
-                    <el-input v-model="ruleForm.industrial_output" placeholder="请输入项目产值" style="width:300px" />
+                    <el-input v-model="ruleForm.industrial_output" placeholder="请输入项目产值" style="width:300px"
+                        type="number" />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="研究经费支出:" prop="expend">
                 <el-form-item label="研究经费支出:" prop="expend">
                     <el-input v-model="ruleForm.expend" placeholder="请输入研究经费支出" style="width:300px" type="number" />
                     <el-input v-model="ruleForm.expend" placeholder="请输入研究经费支出" style="width:300px" type="number" />

+ 111 - 55
src/views/company/patent.vue

@@ -3,7 +3,17 @@
     <div class="content">
     <div class="content">
         <div v-loading.fullscreen.lock="loadingFull" />
         <div v-loading.fullscreen.lock="loadingFull" />
         <div class="search_box flexS">
         <div class="search_box flexS">
-            <el-input v-model="params.search_name" clearable placeholder="姓名" prefix-icon="el-icon-search"
+            <div v-for="(item, idx) in categoryList" :key="idx">
+                <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()"
+                    clearable @clear="toSearch()">
+                    <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+            </div>
+            <el-select v-model="params.search_company" placeholder="所属企业" class="select" @change="toSearch()" clearable
+                @clear="toSearch()">
+                <el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+            <el-input v-model="params.search_name" clearable placeholder="名称" prefix-icon="el-icon-search"
                 @keyup.enter.native="toSearch()" @clear="toSearch()" />
                 @keyup.enter.native="toSearch()" @clear="toSearch()" />
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
             <el-button @click="handleEdit(0)" type="primary" style="margin-right:24px;">添加</el-button>
             <el-button @click="handleEdit(0)" type="primary" style="margin-right:24px;">添加</el-button>
@@ -21,6 +31,11 @@
                         <span>{{ row.industry && row.industry.name }}</span>
                         <span>{{ row.industry && row.industry.name }}</span>
                     </template>
                     </template>
                 </el-table-column>
                 </el-table-column>
+                <el-table-column prop="industry" label="知识产权" align="center">
+                    <template slot-scope="{ row }">
+                        <span>{{ row.type && row.type.name }}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column prop="company_id" label="所属企业" align="center">
                 <el-table-column prop="company_id" label="所属企业" align="center">
                     <template slot-scope="{ row }">
                     <template slot-scope="{ row }">
                         <span>{{ row.company && row.company.name }}</span>
                         <span>{{ row.company && row.company.name }}</span>
@@ -39,7 +54,7 @@
         <el-drawer :title="type === 0 ? '添加知识产权' : '编辑知识产权'" :visible.sync="dialogVisible" width="35%">
         <el-drawer :title="type === 0 ? '添加知识产权' : '编辑知识产权'" :visible.sync="dialogVisible" width="35%">
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
                 <el-form-item label="名称:" prop="name">
                 <el-form-item label="名称:" prop="name">
-                    <el-input v-model="ruleForm.name" placeholder="请输入名" />
+                    <el-input v-model="ruleForm.name" placeholder="请输入名" />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="图片:">
                 <el-form-item label="图片:">
                     <el-upload ref="upload" action="" :show-file-list="false" :http-request="uploadImg">
                     <el-upload ref="upload" action="" :show-file-list="false" :http-request="uploadImg">
@@ -54,6 +69,11 @@
                         </div>
                         </div>
                     </el-upload>
                     </el-upload>
                 </el-form-item>
                 </el-form-item>
+                <el-form-item label="申请时间:" prop="start_time">
+                    <el-date-picker v-model="ruleForm.apply_time" type="datetime" placeholder="选择日期时间" style="width:300px"
+                        value-format="yyyy-MM-dd" format="yyyy-MM-dd">
+                    </el-date-picker>
+                </el-form-item>
                 <el-form-item label="所属企业:" prop="company_id">
                 <el-form-item label="所属企业:" prop="company_id">
                     <el-select v-model="ruleForm.company_id" placeholder="请选择所属企业">
                     <el-select v-model="ruleForm.company_id" placeholder="请选择所属企业">
                         <el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
                         <el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
@@ -61,26 +81,28 @@
                 </el-form-item>
                 </el-form-item>
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                     <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
                     <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
-                        @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)" :style="{ width: '300px' }"
-                        filterable clearableruleFormruleForm>
+                        :style="{ width: children.length > 0 ? '200px' : '300px' }" filterable clearableruleFormruleForm
+                        value-key="id">
                         <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
                         <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
                             <span style="float: left" class="span-style">{{ temp.name }}</span>
                             <span style="float: left" class="span-style">{{ temp.name }}</span>
-                            <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
-                                <i class="el-icon-delete" /></span>
+
                             <span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, temp, i)">
                             <span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, temp, i)">
                                 <i class="el-icon-edit-outline" />
                                 <i class="el-icon-edit-outline" />
                             </span>
                             </span>
                         </el-option>
                         </el-option>
                     </el-select>
                     </el-select>
-                </el-form-item>
-                <el-form-item label="是否研发机构" prop="is_research" required>
-                    <el-radio-group v-model="ruleForm.is_research">
-                        <el-radio :label="0">否</el-radio>
-                        <el-radio :label="1">是</el-radio>
-                    </el-radio-group>
+                    <el-select v-model="checkedType" placeholder="请选择" v-if="item.mark === 'type' && children.length > 0"
+                        style="margin-left:5px;" :ref="'template/' + i">
+                        <el-option v-for="c in children" :key="c.id" :label="c.name" :value="c.id">
+                            <span style="float: left" class="span-style">{{ c.name }}</span>
+                            <span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, c, i)">
+                                <i class="el-icon-edit-outline" />
+                            </span>
+                        </el-option>
+                    </el-select>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="简介:" prop="introduction" required>
                 <el-form-item label="简介:" prop="introduction" required>
-                    <textarea name="" id="" cols="30" rows="10" v-model="ruleForm.introduction" placeholder="请输入人才简介" />
+                    <textarea name="" id="" cols="30" rows="10" v-model="ruleForm.introduction" placeholder="请输知识产权简介" />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item>
                 <el-form-item>
                     <el-button @click="dialogVisible = false">取 消</el-button>
                     <el-button @click="dialogVisible = false">取 消</el-button>
@@ -96,12 +118,17 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-import { patentList, addPatent, editPatent, deletePatent, importPatent, patentCategory, companyAll } from '@/api/company'
+import { patentList, addPatent, editPatent, deletePatent, importPatent, patentCategory, companyAll, patentInfo } from '@/api/company'
 import { uploadFile } from '@/api/upload.js'
 import { uploadFile } from '@/api/upload.js'
 import { addCategory, editCategory, deleteCategory } from '@/api/category'
 import { addCategory, editCategory, deleteCategory } from '@/api/category'
 export default {
 export default {
     data() {
     data() {
         return {
         return {
+            typeList: [],
+            children: [],
+            checkedType: '',
+            fid: '', //新增专利的上一级id
+            typeId: '',
             categoryList: [],
             categoryList: [],
             category: [],
             category: [],
             dialogVisible: false,
             dialogVisible: false,
@@ -110,26 +137,22 @@ export default {
             listDataTotal: 0,
             listDataTotal: 0,
             type: '',
             type: '',
             id: '',
             id: '',
-            options1: [],
-            options2: [],
-            options3: [],
             companyList: [],
             companyList: [],
             ruleForm: {
             ruleForm: {
                 name: '',
                 name: '',
                 company_id: '',
                 company_id: '',
-                img: '',
+                apply_time: '',
                 industry: '',
                 industry: '',
-                degree: '',
-                introduction: '',
                 type: '',
                 type: '',
-                is_research: ''
+                img: '',
+                introduction: ''
             },
             },
             params: {
             params: {
                 page_index: 1,
                 page_index: 1,
                 page_size: 10,
                 page_size: 10,
                 search_name: '',
                 search_name: '',
                 search_company: '',
                 search_company: '',
-                search_type: ''
+                type: ''
             },
             },
             rules: {
             rules: {
                 name: [
                 name: [
@@ -145,16 +168,7 @@ export default {
                     { required: true, message: '请选择行业类型', trigger: 'change' }
                     { required: true, message: '请选择行业类型', trigger: 'change' }
                 ],
                 ],
                 type: [
                 type: [
-                    { required: true, message: '请选择人才类型', trigger: 'change' }
-                ],
-                degree: [
-                    { required: true, message: '请选择人才学历', trigger: 'change' }
-                ],
-                is_research: [
-                    { required: true, message: '请选择是否研发机构', trigger: 'change' }
-                ],
-                sort: [
-                    { required: true, message: '请输入排名', trigger: 'blur' }
+                    { required: true, message: '请选择知识产权类型', trigger: 'change' }
                 ],
                 ],
                 introduction: [
                 introduction: [
                     { required: true, message: '请输入简介', trigger: 'blur' }
                     { required: true, message: '请输入简介', trigger: 'blur' }
@@ -167,7 +181,27 @@ export default {
         this.getCategory()
         this.getCategory()
         this.getCompany()
         this.getCompany()
     },
     },
+    computed: {
+        checkId() {
+            return this.fid
+        }
+    },
     methods: {
     methods: {
+
+        selectOne(params) {
+            const data = this.typeList.children.find((item) => {
+                return item.id === params
+            })
+            if (data && data.children) {
+                this.children = data.children
+                this.fid = data.id
+            } else {
+                this.children = []
+            }
+        },
+        handleChange(value) {
+            console.log(value)
+        },
         // 修改类型
         // 修改类型
         editItem(fid, isEdit, info, idx) {
         editItem(fid, isEdit, info, idx) {
             this.addItem(fid, isEdit, info, idx)
             this.addItem(fid, isEdit, info, idx)
@@ -184,22 +218,22 @@ export default {
                 const obj = this.categoryList[idx].children[index]
                 const obj = this.categoryList[idx].children[index]
                 val = obj.name
                 val = obj.name
             }
             }
-            this.$prompt(' 请输入新的类型名称 ', isEdit === 1 ? '编辑' : '添加', {
+            this.$prompt(' 请输入新的名称 ', isEdit === 1 ? '编辑' : '添加', {
                 confirmButtonText: '确定',
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 cancelButtonText: '取消',
                 inputValue: val
                 inputValue: val
             }).then(async ({ value }) => {
             }).then(async ({ value }) => {
                 if (!value || value === '') {
                 if (!value || value === '') {
-                    this.$message.error('类型名称不能为空!')
+                    this.$message.error('名称不能为空!')
                 } else {
                 } else {
                     const http = isEdit === 1 ? editCategory : addCategory
                     const http = isEdit === 1 ? editCategory : addCategory
                     const data = isEdit === 1 ? { fid, id: info.id, name: value } : { fid, name: value }
                     const data = isEdit === 1 ? { fid, id: info.id, name: value } : { fid, name: value }
                     http(data).then(res => {
                     http(data).then(res => {
                         if (res.code === 200) {
                         if (res.code === 200) {
-                            this.$message.success(isEdit === 1 ? '修改类型成功' : '添加类型成功')
+                            this.$message.success(isEdit === 1 ? '修改成功' : '添加成功')
                             this.getCategory()
                             this.getCategory()
                         } else {
                         } else {
-                            this.$message.success(res.msg || isEdit === 1 ? '修改类型失败' : '添加类型失败')
+                            this.$message.success(res.msg || isEdit === 1 ? '修改失败' : '添加失败')
                         }
                         }
                     })
                     })
                 }
                 }
@@ -239,7 +273,7 @@ export default {
                     el.style =
                     el.style =
                         "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
                         "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
                     el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
                     el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
-              <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增产品</span>
+              <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增</span>
               </li>`;
               </li>`;
                     product.appendChild(el);
                     product.appendChild(el);
                     // 新增按钮点击事件
                     // 新增按钮点击事件
@@ -270,6 +304,13 @@ export default {
                 const { message, code, data } = res
                 const { message, code, data } = res
                 if (code === 200) {
                 if (code === 200) {
                     this.categoryList = data
                     this.categoryList = data
+                    for (let i = 0; i < data.length; i++) {
+                        if (data[i].mark === 'type') {
+                            this.typeList = data[i]
+                        }
+                    }
+                    console.log(this.categoryList)
+                    console.log(this.typeList, 'typelist')
                 } else {
                 } else {
                     this.$message.error(message)
                     this.$message.error(message)
                 }
                 }
@@ -337,15 +378,14 @@ export default {
             this.ruleForm = {
             this.ruleForm = {
                 name: '',
                 name: '',
                 company_id: '',
                 company_id: '',
-                img: '',
+                apply_time: '',
                 industry: '',
                 industry: '',
-                degree: '',
-                introduction: '',
                 type: '',
                 type: '',
-                is_research: ''
+                img: '',
+                introduction: ''
             }
             }
         },
         },
-        // 编辑或者添加人才信息
+        // 编辑或者添加
         handleEdit(type, row) {
         handleEdit(type, row) {
             this.dialogVisible = true
             this.dialogVisible = true
             this.type = type
             this.type = type
@@ -353,16 +393,31 @@ export default {
                 this.reset()
                 this.reset()
             } else { // 编辑
             } else { // 编辑
                 this.id = row.id
                 this.id = row.id
-                this.ruleForm = {
-                    name: row.name,
-                    company_id: row.company_id,
-                    img: row.img,
-                    industry: row.industry && row.industry.id,
-                    degree: row.degree && row.degree.id,
-                    introduction: row.introduction,
-                    type: row.type && row.type.id,
-                    is_research: row.is_research
-                }
+                patentInfo({ id: row.id }).then(res => {
+                    const { code, data, msg } = res
+                    if (code === 200) {
+                        this.ruleForm = {
+                            name: data.name,
+                            company_id: data.company_id,
+                            apply_time: data.apply_time,
+                            industry: data.industry && data.industry.id,
+                            img: data.img,
+                            introduction: data.introduction
+                        }
+                        const id = data.type.child.id
+                        this.ruleForm.type = id
+                        if (data.type.child.child) {
+                            // 两级选项
+                            this.children.push(data.type.child.child)
+                            this.checkedType = data.type && data.type.child.child.id
+                        } else {
+                            this.children = []
+                        }
+                    } else {
+                        this.$message.error(msg)
+                    }
+                })
+
             }
             }
         },
         },
         // 获取列表
         // 获取列表
@@ -389,8 +444,9 @@ export default {
             this.$refs[formName].validate((valid) => {
             this.$refs[formName].validate((valid) => {
                 if (valid) {
                 if (valid) {
                     const http = this.type === 0 ? addPatent : editPatent
                     const http = this.type === 0 ? addPatent : editPatent
-                    const { name, company_id, img, industry, degree, introduction, type, is_research } = this.ruleForm
-                    const data = this.type === 0 ? this.ruleForm : { name, company_id, img, industry, degree, introduction, type, is_research, id: this.id }
+                    this.ruleForm.type = this.checkedType ? this.checkedType : this.ruleForm.type
+                    const { name, company_id, apply_time, industry, type, img, introduction } = this.ruleForm
+                    const data = this.type === 0 ? this.ruleForm : { name, company_id, apply_time, industry, type, img, introduction, id: this.id }
                     http(data).then(res => {
                     http(data).then(res => {
                         if (res.code === 200) {
                         if (res.code === 200) {
                             this.$message.success(this.type === 0 ? '添加成功!' : '修改成功!')
                             this.$message.success(this.type === 0 ? '添加成功!' : '修改成功!')
@@ -410,7 +466,7 @@ export default {
         // 删除确认
         // 删除确认
         handleDelete(row) {
         handleDelete(row) {
             const { id } = row
             const { id } = row
-            this.$confirm('确认要删除该人才信息吗?', '删除确认', {
+            this.$confirm('确认要删除该条内容吗?', '删除确认', {
                 confirmButtonText: '确定',
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 cancelButtonText: '取消',
                 type: 'warning'
                 type: 'warning'

+ 1 - 1
src/views/company/product.vue

@@ -1,4 +1,4 @@
-<!-- 企业项目 -->
+<!-- 企业产品 -->
 <template>
 <template>
     <div class="content">
     <div class="content">
         <div v-loading.fullscreen.lock="loadingFull" />
         <div v-loading.fullscreen.lock="loadingFull" />

+ 9 - 16
src/views/company/project.vue

@@ -3,10 +3,12 @@
     <div class="content">
     <div class="content">
         <div v-loading.fullscreen.lock="loadingFull" />
         <div v-loading.fullscreen.lock="loadingFull" />
         <div class="search_box flexS">
         <div class="search_box flexS">
-            <el-select v-model="params.search_type" placeholder="项目分类" class="select" @change="toSearch()" clearable
-                @clear="toSearch()">
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
+            <div v-for="(item, idx) in categoryList" :key="idx">
+                <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()"
+                    clearable @clear="toSearch()">
+                    <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+            </div>
             <el-select v-model="params.search_company" placeholder="所属企业" class="select" @change="toSearch()" clearable
             <el-select v-model="params.search_company" placeholder="所属企业" class="select" @change="toSearch()" clearable
                 @clear="toSearch()">
                 @clear="toSearch()">
                 <el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
                 <el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
@@ -53,12 +55,11 @@
                 </el-form-item>
                 </el-form-item>
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                     <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
                     <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
-                        @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)" :style="{ width: '300px' }"
-                        filterable clearableruleFormruleForm style="width:300px">
+                        :style="{ width: '300px' }" filterable clearableruleFormruleForm style="width:300px">
                         <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
                         <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
                             <span style="float: left" class="span-style">{{ temp.name }}</span>
                             <span style="float: left" class="span-style">{{ temp.name }}</span>
-                            <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
-                                <i class="el-icon-delete" /></span>
+                            <!-- <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
+                                <i class="el-icon-delete" /></span> -->
                             <span style="float: right;margin-left:5px;" class="span-style"
                             <span style="float: right;margin-left:5px;" class="span-style"
                                 @click.stop="editItem(item.id, 1, temp, i)">
                                 @click.stop="editItem(item.id, 1, temp, i)">
                                 <i class="el-icon-edit-outline" />
                                 <i class="el-icon-edit-outline" />
@@ -94,7 +95,6 @@ import Tinymce from '@/components/Tinymce'
 export default {
 export default {
     data() {
     data() {
         return {
         return {
-            options: [], // 顶部下拉框选项
             categoryList: [], // 类型列表
             categoryList: [], // 类型列表
             dialogVisible: false,
             dialogVisible: false,
             loadingFull: false,
             loadingFull: false,
@@ -240,18 +240,11 @@ export default {
         },
         },
         // 获取分类列表
         // 获取分类列表
         async getCategory() {
         async getCategory() {
-            this.options = []
             try {
             try {
                 const res = await projectCategory()
                 const res = await projectCategory()
                 const { message, code, data } = res
                 const { message, code, data } = res
                 if (code === 200) {
                 if (code === 200) {
                     this.categoryList = data
                     this.categoryList = data
-                    for (let i = 0; i < data.length; i++) {
-                        for (let j = 0; j < data[i].children.length; j++) {
-                            this.options.push({ label: data[i].children[j].name, value: data[i].children[j].id })
-                        }
-                    }
-                    console.log(data, 111)
                 } else {
                 } else {
                     this.$message.error(message)
                     this.$message.error(message)
                 }
                 }

+ 35 - 25
src/views/company/talents.vue

@@ -3,10 +3,16 @@
   <div class="content">
   <div class="content">
     <div v-loading.fullscreen.lock="loadingFull" />
     <div v-loading.fullscreen.lock="loadingFull" />
     <div class="search_box flexS">
     <div class="search_box flexS">
+      <div v-for="(item, idx) in categoryList" :key="idx">
+        <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()" clearable
+          @clear="toSearch()">
+          <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+      </div>
       <el-input v-model="params.search_name" clearable placeholder="请输入姓名" prefix-icon="el-icon-search"
       <el-input v-model="params.search_name" clearable placeholder="请输入姓名" prefix-icon="el-icon-search"
         @keyup.enter.native="toSearch()" @clear="toSearch()" />
         @keyup.enter.native="toSearch()" @clear="toSearch()" />
       <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
       <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
-      <el-button @click="handleEdit(0)" type="primary" style="margin-right:24px;">添加</el-button>
+      <el-button @click="handleEdit(false)" type="primary" style="margin-right:24px;">添加</el-button>
       <el-upload class="upload-demo" action="" :http-request="uploadFile" :multiple="false" :show-file-list="false">
       <el-upload class="upload-demo" action="" :http-request="uploadFile" :multiple="false" :show-file-list="false">
         <el-button type="primary">导入</el-button>
         <el-button type="primary">导入</el-button>
       </el-upload>
       </el-upload>
@@ -30,15 +36,20 @@
             <span>{{ row.degree && row.degree.name }}</span>
             <span>{{ row.degree && row.degree.name }}</span>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
+        <el-table-column prop="type" label="人才类型" align="center">
+          <template slot-scope="{ row }">
+            <span>{{ row.type && row.type.name }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" width="280">
         <el-table-column label="操作" align="center" width="280">
           <template slot-scope="{row}">
           <template slot-scope="{row}">
-            <el-button type="text" size="mini" @click="handleEdit(1, row)">编辑</el-button>
+            <el-button type="text" size="mini" @click="handleEdit(true, row)">编辑</el-button>
             <el-button type="text" size="mini" @click="handleDelete(row)">删除</el-button>
             <el-button type="text" size="mini" @click="handleDelete(row)">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>
     </div>
     </div>
-    <el-drawer :title="type === 0 ? '添加人才信息' : '编辑人才信息'" :visible.sync="dialogVisible" width="35%">
+    <el-drawer :title="!isEdit ? '添加人才信息' : '编辑人才信息'" :visible.sync="dialogVisible" width="35%">
       <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
       <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
         <el-form-item label="姓名:" prop="name">
         <el-form-item label="姓名:" prop="name">
           <el-input v-model="ruleForm.name" placeholder="请输入姓名" />
           <el-input v-model="ruleForm.name" placeholder="请输入姓名" />
@@ -64,13 +75,12 @@
         </el-form-item>
         </el-form-item>
         <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
         <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
           <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
           <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
-            @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)" :style="{ width: '300px' }" filterable
-            clearableruleFormruleForm>
+            :style="{ width: '300px' }" filterable clearableruleFormruleForm>
             <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
             <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
               <span style="float: left" class="span-style">{{ temp.name }}</span>
               <span style="float: left" class="span-style">{{ temp.name }}</span>
-              <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
-                <i class="el-icon-delete" /></span>
-              <span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, temp, i)">
+              <!-- <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
+                <i class="el-icon-delete" /></span> -->
+              <span style="float: right" class="span-style" @click.stop="editItem(item.id, true, temp, i)">
                 <i class="el-icon-edit-outline" />
                 <i class="el-icon-edit-outline" />
               </span>
               </span>
             </el-option>
             </el-option>
@@ -87,7 +97,7 @@
         </el-form-item>
         </el-form-item>
         <el-form-item>
         <el-form-item>
           <el-button @click="dialogVisible = false">取 消</el-button>
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="submitForm('ruleForm')">{{ type === 0 ? '确 定' : '保存' }}</el-button>
+          <el-button type="primary" @click="submitForm('ruleForm')">{{ !isEdit ? '确 定' : '保存' }}</el-button>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
 
 
@@ -105,13 +115,13 @@ import { addCategory, editCategory, deleteCategory } from '@/api/category'
 export default {
 export default {
   data() {
   data() {
     return {
     return {
+      isEdit: false,
       categoryList: [],
       categoryList: [],
       category: [],
       category: [],
       dialogVisible: false,
       dialogVisible: false,
       loadingFull: false,
       loadingFull: false,
       listData: [],
       listData: [],
       listDataTotal: 0,
       listDataTotal: 0,
-      type: '',
       id: '',
       id: '',
       options1: [],
       options1: [],
       options2: [],
       options2: [],
@@ -132,7 +142,7 @@ export default {
         page_size: 10,
         page_size: 10,
         search_name: '',
         search_name: '',
         search_company: '',
         search_company: '',
-        search_type: ''
+        type: ''
       },
       },
       rules: {
       rules: {
         name: [
         name: [
@@ -177,7 +187,7 @@ export default {
     },
     },
     // 添加/修改类型
     // 添加/修改类型
     addItem(fid, isEdit, info, idx) {
     addItem(fid, isEdit, info, idx) {
-      if (info && info != null && isEdit === 1) {
+      if (info && info != null && !isEdit) {
         this.$message.error('无可编辑内容')
         this.$message.error('无可编辑内容')
         return
         return
       }
       }
@@ -187,7 +197,7 @@ export default {
         const obj = this.categoryList[idx].children[index]
         const obj = this.categoryList[idx].children[index]
         val = obj.name
         val = obj.name
       }
       }
-      this.$prompt(' 请输入新的类型名称 ', isEdit === 1 ? '编辑' : '添加', {
+      this.$prompt(' 请输入新的类型名称 ', isEdit ? '编辑' : '添加', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',
         inputValue: val
         inputValue: val
@@ -195,14 +205,14 @@ export default {
         if (!value || value === '') {
         if (!value || value === '') {
           this.$message.error('类型名称不能为空!')
           this.$message.error('类型名称不能为空!')
         } else {
         } else {
-          const http = isEdit === 1 ? editCategory : addCategory
-          const data = isEdit === 1 ? { fid, id: info.id, name: value } : { fid, name: value }
+          const http = isEdit ? editCategory : addCategory
+          const data = isEdit ? { fid, id: info.id, name: value } : { fid, name: value }
           http(data).then(res => {
           http(data).then(res => {
             if (res.code === 200) {
             if (res.code === 200) {
-              this.$message.success(isEdit === 1 ? '修改类型成功' : '添加类型成功')
+              this.$message.success(isEdit ? '修改类型成功' : '添加类型成功')
               this.getCategory()
               this.getCategory()
             } else {
             } else {
-              this.$message.success(res.msg || isEdit === 1 ? '修改类型失败' : '添加类型失败')
+              this.$message.success(res.msg || isEdit ? '修改类型失败' : '添加类型失败')
             }
             }
           })
           })
         }
         }
@@ -242,7 +252,7 @@ export default {
           el.style =
           el.style =
             "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
             "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
           el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
           el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
-            <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增产品</span>
+            <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增</span>
             </li>`;
             </li>`;
           product.appendChild(el);
           product.appendChild(el);
           // 新增按钮点击事件
           // 新增按钮点击事件
@@ -349,10 +359,10 @@ export default {
       }
       }
     },
     },
     // 编辑或者添加人才信息
     // 编辑或者添加人才信息
-    handleEdit(type, row) {
+    handleEdit(isEdit, row) {
       this.dialogVisible = true
       this.dialogVisible = true
-      this.type = type
-      if (type === 0) { // 添加
+      this.isEdit = isEdit
+      if (!isEdit) { // 添加
         this.reset()
         this.reset()
       } else { // 编辑
       } else { // 编辑
         this.id = row.id
         this.id = row.id
@@ -391,16 +401,16 @@ export default {
     submitForm(formName) {
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
       this.$refs[formName].validate((valid) => {
         if (valid) {
         if (valid) {
-          const http = this.type === 0 ? addTalent : editTalent
+          const http = !this.isEdit ? addTalent : editTalent
           const { name, company_id, img, industry, degree, introduction, type, is_research } = this.ruleForm
           const { name, company_id, img, industry, degree, introduction, type, is_research } = this.ruleForm
-          const data = this.type === 0 ? this.ruleForm : { name, company_id, img, industry, degree, introduction, type, is_research, id: this.id }
+          const data = !this.isEdit ? this.ruleForm : { name, company_id, img, industry, degree, introduction, type, is_research, id: this.id }
           http(data).then(res => {
           http(data).then(res => {
             if (res.code === 200) {
             if (res.code === 200) {
-              this.$message.success(this.type === 0 ? '添加成功!' : '修改成功!')
+              this.$message.success(!this.isEdit ? '添加成功!' : '修改成功!')
               this.getList()
               this.getList()
               this.dialogVisible = false
               this.dialogVisible = false
             } else {
             } else {
-              this.$message.error(this.type === 0 ? '添加失败!' : '修改失败!')
+              this.$message.error(!this.isEdit ? '添加失败!' : '修改失败!')
               this.$message.error(res.msg)
               this.$message.error(res.msg)
             }
             }
           })
           })

+ 0 - 133
src/views/dashboard/components/allRank.vue

@@ -1,133 +0,0 @@
-<template>
-  <div>
-    <div class="rank">总销量数据排名</div>
-    <el-table
-      ref="allTable"
-      style="width: 100%; max-height: 480px; overflow: auto"
-      border
-      :data="list"
-      height="480"
-    >
-      <el-table-column
-        label="排名"
-        type="index"
-        align="center"
-        width="60"
-        :index="
-          (index) => params.page_size * (params.page_index - 1) + index + 1
-        "
-      />
-      <el-table-column
-        label="头像"
-        prop="img"
-        width="80"
-        label-class-name="label"
-        align="center"
-        style="padding: 0"
-      >
-        <template slot-scope="{ row }">
-          <img width="36" height="36" :src="row.store&&row.store.img" class="hoverImg">
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="店铺名称"
-        prop="name"
-        align="center"
-      >
-        <template slot-scope="{ row }">
-          {{ row.store&&row.store.name }}
-        </template>
-      </el-table-column>
-      <!-- <el-table-column label="店铺名称" prop="name" align="center" /> -->
-      <el-table-column
-        label="销售数量"
-        prop="total"
-        align="center"
-        sortable="custom"
-      >
-        <template slot-scope="{ row }">
-          {{ format(row.total,true) }}
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="销售金额"
-        prop="account"
-        align="center"
-        sortable="custom"
-      >
-        <template slot-scope="{ row }">
-          {{ format(row.account) }}
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="batch-container">
-      <el-pagination
-        :total="totalPage"
-        :current-page="params.page_index"
-        :page-sizes="[10, 15, 20, 30,100]"
-        :page-size="params.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-      />
-    </div>
-  </div>
-</template>
-<script>
-import { allOrderBy } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  data() {
-    return {
-      list: [],
-      params: {
-        page_index: 1,
-        page_size: 10
-      },
-      totalPage: 0
-    }
-  },
-  created() {
-    this.getAllOrder()
-    this.format = format
-  },
-  methods: {
-    // 总销量数据排名
-    async getAllOrder() {
-      const res = await allOrderBy(this.params)
-      try {
-        const { msg, code, data } = res
-        if (code === 200) {
-          this.list = data.list
-          this.totalPage = data.total
-        } else {
-          this.$message.error(msg || '获取数据失败')
-        }
-      } catch (e) {
-        this.$message.error(e || '获取数据失败')
-      }
-    },
-    handleSizeChange(val) {
-      this.params.page_size = val
-      this.getAllOrder()
-    },
-    handleCurrentChange(val) {
-      this.params.page_index = val
-      this.getAllOrder()
-    }
-  }
-}
-</script>
-<style scoped lang="scss">
-.rank {
-  font-size: 18px;
-  font-weight: bold;
-  padding: 10px 0;
-}
-.batch-container{
-  width: 100%;
-  text-align: center;
-  margin-top:10px;
-}
-</style>

+ 0 - 166
src/views/dashboard/components/dailyNum.vue

@@ -1,166 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 15px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { dailySale } from '@/api/index'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      dateVal: ''
-    }
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getData()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    formatDate(date) {
-      var myyear = date.getFullYear()
-      var mymonth = date.getMonth() + 1
-      var myweekday = date.getDate()
-
-      if (mymonth < 10) {
-        mymonth = '0' + mymonth
-      }
-      if (myweekday < 10) {
-        myweekday = '0' + myweekday
-      }
-      return myyear + '-' + mymonth + '-' + myweekday
-    },
-    // 切换日期
-    changeDate() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await dailySale({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          for (const key in data) {
-            this.timeLineMap.push(key)
-            this.lengedMap.push(data[key].total)
-          }
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    // 初始化echarts图标
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '日总销售数量统计'
-          },
-          xAxis: {
-            type: 'category',
-            name: '日期',
-            data: this.timeLineMap,
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            }
-          },
-          lenged: ['销量'],
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          yAxis: {
-            type: 'value',
-            name: '数量',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.lengedMap,
-              type: 'line',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black'
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#FC721E'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 173
src/views/dashboard/components/dailySale.vue

@@ -1,173 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 15px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { dailySale } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      dateVal: ''
-    }
-  },
-  created() {
-    this.format = format
-    this.getData()
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    formatDate(date) {
-      var myyear = date.getFullYear()
-      var mymonth = date.getMonth() + 1
-      var myweekday = date.getDate()
-
-      if (mymonth < 10) {
-        mymonth = '0' + mymonth
-      }
-      if (myweekday < 10) {
-        myweekday = '0' + myweekday
-      }
-      return myyear + '-' + mymonth + '-' + myweekday
-    },
-    changeDate() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await dailySale({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          for (const key in data) {
-            this.timeLineMap.push(key)
-            this.lengedMap.push(data[key].money)
-          }
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '日总销售金额统计'
-          },
-          xAxis: {
-            type: 'category',
-            name: '日期',
-            data: this.timeLineMap,
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            }
-          },
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          yAxis: {
-            type: 'value',
-            name: '金额',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              },
-              formatter: val => {
-                return this.format(val)
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.lengedMap,
-              type: 'line',
-              // showBackground: true,
-              // backgroundStyle: {
-              //   color: "rgba(220, 220, 220, 0.8)"
-              // },
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#FC721E'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 192
src/views/dashboard/components/historyTotal.vue

@@ -1,192 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 20px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { getHistoryTotal } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      numMap: [],
-      dateVal: ''
-    }
-  },
-  created() {
-    this.format = format
-    // this.getData()
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getData()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    // 选择时间时切换折线图
-    changeDate() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      this.numMap = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await getHistoryTotal({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          for (const k in data) {
-            let name = ''
-            if (k === 'all') {
-              name = '销售额'
-            }
-            if (k === 'cancel') {
-              name = '取消额'
-            }
-            if (k === 'refund') {
-              name = '退货额'
-            }
-            this.timeLineMap.push(name)
-            this.lengedMap.push(data[k].account)
-            this.numMap.push(data[k].total)
-          }
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    // 生成柱状图
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '销售取消退货数据汇总'
-          },
-          tooltip: {
-            trigger: 'axis'
-          },
-          legend: {
-            data: ['金额', '数量']
-          },
-          xAxis: {
-            type: 'category',
-            data: this.timeLineMap
-          },
-          yAxis:
-          [
-            {
-              type: 'value',
-              name: '数量',
-              axisLine: {
-                show: true
-              }
-            },
-            {
-              type: 'value',
-              name: '金额',
-              axisLine: {
-                show: true
-              }
-            }
-          ],
-          series: [
-            {
-              data: this.numMap,
-              yAxisIndex: 0,
-              type: 'bar',
-              label: {
-                show: true,
-                position: 'top',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              name: '数量',
-              barWidth: 30,
-              itemStyle: {
-                normal: {
-                  color: '#FE8463'
-                }
-              }
-            },
-            {
-              data: this.lengedMap,
-              yAxisIndex: 1,
-              type: 'bar',
-              label: {
-                show: true,
-                position: 'top',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              name: '金额',
-              barWidth: 30,
-              itemStyle: {
-                normal: {
-                  color: '#26C0C0'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 163
src/views/dashboard/components/newDaily.vue

@@ -1,163 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 15px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { addAgent } from '@/api/index'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      dateVal: ''
-    }
-  },
-  created() {
-    this.getData()
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    formatDate(date) {
-      var myyear = date.getFullYear()
-      var mymonth = date.getMonth() + 1
-      var myweekday = date.getDate()
-
-      if (mymonth < 10) {
-        mymonth = '0' + mymonth
-      }
-      if (myweekday < 10) {
-        myweekday = '0' + myweekday
-      }
-      return myyear + '-' + mymonth + '-' + myweekday
-    },
-    // 选择时间切换数据
-    changeDate() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await addAgent({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          for (const key in data) {
-            this.timeLineMap.push(key)
-            this.lengedMap.push(data[key])
-          }
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '每日新增注册人数'
-          },
-          xAxis: {
-            type: 'category',
-            name: '日期',
-            data: this.timeLineMap,
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            }
-          },
-          lenged: ['销量'],
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          yAxis: {
-            type: 'value',
-            name: '数量',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.lengedMap,
-              type: 'line',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black'
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#FC721E'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 124
src/views/dashboard/components/payRate.vue

@@ -1,124 +0,0 @@
-<template>
-  <div>
-    <div class="rank">公司客户/客户支付占比分析</div>
-    <el-table
-      ref="allTable"
-      style="width: 100%; max-height: 480px; overflow: auto"
-      border
-      :data="list"
-      height="480"
-    >
-      <el-table-column
-        label="序号"
-        type="index"
-        align="center"
-        width="60"
-        :index="
-          (index) => params.page_size * (params.page_index - 1) + index + 1
-        "
-      />
-      <el-table-column label="昵称" prop="name" align="center" />
-      <el-table-column label="手机号" prop="phone" align="center" width="120" />
-      <el-table-column align="center" label="成交套数" prop="all" width="100" />
-      <el-table-column
-        label="代支付套数"
-        prop="no_self_pay_total"
-        align="center"
-        width="100"
-      />
-      <el-table-column align="center" label="代支付套数占比" prop="agent" width="130" />
-      <el-table-column align="center" label="客户支付套数" prop="pay_total" width="120" />
-      <el-table-column align="center" label="客户支付套数占比" prop="user" />
-    </el-table>
-    <div class="batch-container">
-      <el-pagination
-        :current-page="params.page_index"
-        :page-sizes="[10, 15, 20, 30, 100]"
-        :page-size="params.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="totalPage"
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-      />
-    </div>
-  </div>
-</template>
-<script>
-import { payRate } from '@/api/index'
-export default {
-  data() {
-    return {
-      list: [],
-      params: {
-        page_index: 1,
-        page_size: 10
-      },
-      totalPage: 0
-    }
-  },
-  created() {
-    this.getAllOrder()
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    // 计算百分比
-    Percentage(num, total) {
-      if (num === 0 || total === 0) {
-        return 0
-      }
-      return (Math.round(num / total * 10000) / 100.00 + '%')// 小数点后两位百分比
-    },
-    // 总销量数据排名
-    async getAllOrder() {
-      const res = await payRate(this.params)
-      try {
-        const { msg, code, data } = res
-        if (code === 200) {
-          const list = data.list
-          list.map(i => {
-            const all = Number(i.pay_total) + Number(i.no_self_pay_total)
-            const agent = this.Percentage(Number(i.no_self_pay_total), all)
-            const user = this.Percentage(Number(i.pay_total), all)
-
-            this.$set(i, 'all', all)
-            this.$set(i, 'user', user)
-            this.$set(i, 'agent', agent)
-          })
-          this.list = list
-          this.totalPage = data.total
-        } else {
-          this.$message.error(msg || '获取数据失败')
-        }
-      } catch (e) {
-        this.$message.error(e || '获取数据失败')
-      }
-    },
-    handleSizeChange(val) {
-      this.params.page_size = val
-      this.getAllOrder()
-    },
-    handleCurrentChange(val) {
-      this.params.page_index = val
-      this.getAllOrder()
-    }
-  }
-}
-</script>
-<style scoped lang="scss">
-.rank {
-  font-size: 18px;
-  font-weight: bold;
-  padding: 10px 0;
-}
-.batch-container {
-  width: 100%;
-  text-align: center;
-  margin-top:20px;
-}
-</style>

+ 0 - 253
src/views/dashboard/components/saleInfo.vue

@@ -1,253 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 20px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { getSaleInfo } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      accountMap: [],
-      cotton: [],
-      old: [],
-      simple: [],
-      super: [],
-      dateVal: ''
-    }
-  },
-  created() {
-    this.format = format
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getData()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    // 选择时间时切换折线图
-    changeDate() {
-      this.timeLineMap = []
-      this.cotton = []
-      this.old = []
-      this.simple = []
-      this.super = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await getSaleInfo({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          const arr = []
-          for (const k in data) {
-            for (const j in data[k]) {
-              if (this.timeLineMap.indexOf(j) === -1) {
-                arr.push(j)
-                this.timeLineMap = arr.sort()
-              }
-              if (k === 'cotton') {
-                this.cotton.push(data[k][j].account)
-              }
-              if (k === 'old') {
-                this.old.push(data[k][j].account)
-              }
-              if (k === 'simple') {
-                this.simple.push(data[k][j].account)
-              }
-              if (k === 'super') {
-                this.super.push(data[k][j].account)
-              }
-            }
-          }
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '款式日销售金额'
-          },
-          tooltip: {
-            trigger: 'axis'
-          },
-          legend: {
-            data: ['精装版', '简约版', '老人版', '纯棉老人版']
-          },
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          xAxis: {
-            type: 'category',
-            name: '日期',
-            data: this.timeLineMap,
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            }
-          },
-          yAxis: {
-            type: 'value',
-            name: '金额',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              },
-              formatter: val => {
-                return this.format(val)
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.super,
-              type: 'line',
-              name: '精装版',
-              stack: '总量',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#9BCA63'
-                }
-              }
-            },
-            {
-              data: this.simple,
-              type: 'line',
-              name: '简约版',
-              stack: '总量',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#F4E001'
-                }
-              }
-            },
-            {
-              data: this.old,
-              type: 'line',
-              stack: '总量',
-              name: '老人版',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#D7504B'
-                }
-              }
-            },
-            {
-              data: this.cotton,
-              type: 'line',
-              stack: '总量',
-              name: '纯棉老人版',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#f00'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 256
src/views/dashboard/components/saleNum.vue

@@ -1,256 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 20px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { getSaleInfo } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      accountMap: [],
-      cotton: [],
-      old: [],
-      simple: [],
-      super: [],
-      dateVal: ''
-    }
-  },
-  created() {
-    // this.getData()
-    this.format = format
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getData()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    changeDate() {
-      this.timeLineMap = []
-      this.cotton = []
-      this.old = []
-      this.simple = []
-      this.super = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await getSaleInfo({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          const arr = []
-          for (const k in data) {
-            for (const j in data[k]) {
-              if (this.timeLineMap.indexOf(j) === -1) {
-                arr.push(j)
-                this.timeLineMap = arr.sort()
-              }
-              if (k === 'cotton') {
-                this.cotton.push(data[k][j].total)
-              }
-              if (k === 'old') {
-                this.old.push(data[k][j].total)
-              }
-              if (k === 'simple') {
-                this.simple.push(data[k][j].total)
-              }
-              if (k === 'super') {
-                this.super.push(data[k][j].total)
-              }
-            }
-          }
-
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '款式日销售数量'
-          },
-          tooltip: {
-            trigger: 'axis'
-          },
-          legend: {
-            data: ['精装版', '简约版', '老人版', '纯棉老人版']
-          },
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          xAxis: {
-            type: 'category',
-            name: '日期',
-            data: this.timeLineMap,
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            }
-          },
-          yAxis: {
-            type: 'value',
-            name: '数量',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              },
-              formatter: val => {
-                return this.format(val, true)
-              }
-            },
-
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.super,
-              type: 'line',
-              name: '精装版',
-              stack: '总量',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#9BCA63'
-                }
-              }
-            },
-            {
-              data: this.simple,
-              type: 'line',
-              name: '简约版',
-              stack: '总量',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#F4E001'
-                }
-              }
-            },
-            {
-              data: this.old,
-              type: 'line',
-              stack: '总量',
-              name: '老人版',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#D7504B'
-                }
-              }
-            },
-            {
-              data: this.cotton,
-              type: 'line',
-              stack: '总量',
-              name: '纯棉老人版',
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              barWidth: 60,
-              itemStyle: {
-                normal: {
-                  color: '#f00'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 128
src/views/dashboard/components/skuRank.vue

@@ -1,128 +0,0 @@
-<template>
-  <div>
-    <div class="rank">尺码总销售排名</div>
-    <el-table
-      ref="skuTable"
-      style="width: 100%; max-height: 480px; overflow: auto"
-      border
-      :data="skuList"
-      height="480"
-      @sort-change="toSort"
-    >
-      <el-table-column
-        label="排名"
-        type="index"
-        align="center"
-        width="60"
-        :index="(index) => index + 1"
-      />
-      <!-- <el-table-column label="商品名称" prop="name" align="center" /> -->
-      <el-table-column
-        label="商品名称"
-        prop="name"
-        align="center"
-      >
-        <template slot-scope="{ row }">
-          {{ row.goods&&row.goods.main_attr }}
-        </template>
-      </el-table-column>
-      <el-table-column label="款式" prop="type" align="center" />
-      <el-table-column label="尺码" prop="size" align="center" />
-      <el-table-column
-        label="销售数量"
-        prop="total"
-        align="center"
-        sortable="custom"
-      >
-        <template slot-scope="{ row }">
-          {{ format(row.detail.total,true) }}
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="销售金额"
-        prop="account"
-        align="center"
-        sortable="custom"
-      >
-        <template slot-scope="{ row }">
-          {{ format(row.detail.account) }}
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="batch-container">
-      <!-- <pagination
-        :total="totalPage"
-        :limit="params.page_size"
-        :page="params.page_index"
-        @pagination="changePagination"
-        @update:limit="changePagination"
-      /> -->
-    </div>
-  </div>
-</template>
-<script>
-import { skuOrderBy } from '@/api/index'
-import { format } from '@/filters/common'
-export default {
-  data() {
-    return {
-      skuList: []
-    }
-  },
-  created() {
-    this.getSku()
-    this.format = format
-  },
-  methods: {
-    // 尺码销售总排名
-    async getSku() {
-      const res = await skuOrderBy()
-      try {
-        const { msg, code, data } = res
-        if (code === 200) {
-          this.skuList = data
-        } else {
-          this.$message.error(msg || '获取数据失败')
-        }
-      } catch (e) {
-        this.$message.error(e || '获取数据失败')
-      }
-    },
-    descending(property) {
-      return function(a, b) {
-        var value1 = a.detail[property]
-        var value2 = b.detail[property]
-        return value1 - value2
-      }
-    },
-    ascending(property) {
-      return function(a, b) {
-        var value1 = a.detail[property]
-        var value2 = b.detail[property]
-        return value2 - value1
-      }
-    },
-    toSort({ column, prop, order }) {
-      const sku = this.skuList
-      if (prop === 'total') {
-        order === 'ascending'
-          ? sku.sort(this.descending('total'))
-          : sku.sort(this.ascending('total'))
-        return false
-      }
-      if (prop === 'account') {
-        order === 'ascending'
-          ? sku.sort(this.descending('account'))
-          : sku.sort(this.ascending('account'))
-      }
-    }
-  }
-}
-</script>
-<style scoped lang="scss">
-.rank {
-  font-size: 18px;
-  font-weight: bold;
-  padding: 10px 0;
-}
-</style>

+ 0 - 164
src/views/dashboard/components/skudaySale.vue

@@ -1,164 +0,0 @@
-<template>
-  <div>
-    <el-date-picker
-      v-model="value1"
-      type="datetime"
-      placeholder="选择日期时间"
-      format="yyyy-MM-dd"
-      value-format="yyyy-MM-dd"
-      @change="getOrderAccount"
-    />
-    <div ref="style_num_echart" :style="{ height: height, width: width }" />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { skuDaySale } from '@/api/index'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      dataMap: {},
-      lengedMap: [],
-      cycle: '3', // 时间
-      value1: ''
-    }
-  },
-  created() {
-    this.value1 = this.getTime()
-    // this.getOrderAccount()
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getOrderAccount()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    getTime() {
-      var date = new Date()
-      var year = date.getFullYear()
-      var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
-      var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
-      var today = year + '-' + month + '-' + day
-      return today
-    },
-    createObjectByArray(arr, type) {
-      const obj = {}
-      arr.forEach(k => {
-        obj[k] = type ? [] : {}
-      })
-      return obj
-    },
-    // 获取所有商品销量,销售额
-    async getOrderAccount() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      const loading = this.$loading()
-      try {
-        const { code, data } = await skuDaySale({ date: this.value1 })
-        loading.close()
-        if (code === 200) {
-          data.map(i => {
-            this.timeLineMap.push(`${i.goods.main_attr}-${i.type}-${i.size}`)
-            this.lengedMap.push(i.sale_num)
-          })
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`获取商品销售量失败:${e}`)
-      }
-    },
-    // 生成柱状图
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '尺码日销量统计',
-            top: '2%'
-          },
-          tooltip: {
-            trigger: 'axis'
-          },
-          xAxis: {
-            type: 'category',
-            axisLabel: {
-              interval: 0,
-              rotate: 40
-            },
-            data: this.timeLineMap
-          },
-          yAxis: {
-            type: 'value',
-            axisLine: {
-              show: true
-            }
-          },
-          grid: {
-            bottom: '25%',
-            top: '10%'
-          },
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          series: [
-            {
-              data: this.lengedMap,
-              type: 'bar',
-
-              // showBackground: true,
-              label: {
-                show: true,
-                position: 'top'
-              },
-              barWidth: 20,
-              itemStyle: {
-                normal: {
-                  // color: "#1A9F90"
-                  color: function(d) {
-                    return (
-                      '#' +
-                      Math.floor(
-                        Math.random() * (256 * 256 * 256 - 1)
-                      ).toString(16)
-                    )
-                  }
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 138
src/views/dashboard/components/topTen.vue

@@ -1,138 +0,0 @@
-<template>
-  <div>
-    <div ref="style_num_echart" :style="{ height: height, width: width }" />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-import { topTen } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      cycle: '3',
-      first: ''
-    }
-  },
-  created() {
-    this.format = format
-    // this.getOrderAccount()
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getOrderAccount()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    createObjectByArray(arr, type) {
-      const obj = {}
-      arr.forEach(k => {
-        obj[k] = type ? [] : {}
-      })
-      return obj
-    },
-    // 获取所有商品销量,销售额
-    async getOrderAccount() {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await topTen()
-        loading.close()
-        if (code === 200) {
-          data.map(i => {
-            if (i.store && i.store.name) {
-              this.timeLineMap.push(i.store.name.length < 10 ? i.store.name : i.store.name.slice(0, 10) + '...')
-            }
-            this.lengedMap.push(i.money)
-          })
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(e)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '店铺销售前十'
-          },
-          xAxis: {
-            type: 'category',
-            data: this.timeLineMap,
-            name: '店铺',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              },
-              interval: 0
-              //  rotate:40
-            }
-          },
-          yAxis: {
-            type: 'value',
-            name: '金额',
-            axisLabel: {
-              show: true,
-              textStyle: {
-                color: '#000'
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.lengedMap,
-              type: 'bar',
-              // showBackground: true,
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              barWidth: 30,
-              itemStyle: {
-                normal: {
-                  color: '#1A9F90'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 177
src/views/dashboard/components/typeAll.vue

@@ -1,177 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 20px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { getSkuHistoryNum } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      numMap: [],
-      dateVal: ''
-    }
-  },
-  created() {
-    this.format = format
-    this.getData()
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    // 选择时间时切换折线图
-    changeDate() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      this.numMap = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      const loading = this.$loading()
-      try {
-        const { code, data } = await getSkuHistoryNum({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          data.map((i) => {
-            this.timeLineMap.push(i.goods.main_attr)
-            this.lengedMap.push(i.account)
-            this.numMap.push(i.total)
-          })
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    // 生成柱状图
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '款式总销售汇总'
-          },
-          tooltip: {
-            trigger: 'axis'
-          },
-          legend: {
-            data: ['数量', '金额']
-          },
-          xAxis: {
-            type: 'category',
-            data: this.timeLineMap
-          },
-          yAxis: [
-            {
-              type: 'value',
-              name: '数量',
-              axisLine: {
-                show: true
-              }
-            },
-            {
-              type: 'value',
-              name: '金额',
-              axisLine: {
-                show: true
-              }
-            }
-
-          ],
-          series: [
-            {
-              data: this.numMap,
-              type: 'bar',
-              label: {
-                show: true,
-                position: 'top',
-                formatter: val => {
-                  return this.format(val.data, true)
-                }
-              },
-              name: '数量',
-              barWidth: 30,
-              itemStyle: {
-                normal: {
-                  color: '#C1232B'
-                }
-              },
-              yAxisIndex: 0
-            },
-            {
-              data: this.lengedMap,
-              type: 'bar',
-              label: {
-                show: true,
-                position: 'top',
-                formatter: val => {
-                  return this.format(val.data)
-                }
-              },
-              name: '金额',
-              barWidth: 30,
-              itemStyle: {
-                normal: {
-                  color: '#F3A43B'
-                }
-              },
-              yAxisIndex: 1
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 170
src/views/dashboard/components/wareaLine.vue

@@ -1,170 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-date-picker
-        v-model="dateVal"
-        value-format="yyyy-MM-dd"
-        format="yyyy-MM-dd"
-        type="datetimerange"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        @change="changeDate"
-      />
-    </div>
-    <div
-      ref="style_num_echart"
-      :style="{ height: height, width: width }"
-      style="margin-top: 20px"
-    />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-
-import { addSortLine } from '@/api/index'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      accountMap: [],
-      legendMap: [],
-      cotton: [],
-      old: [],
-      simple: [],
-      super: [],
-      dateVal: '',
-      showData: []
-    }
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.getData()
-    })
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    // 选择时间时切换折线图
-    changeDate() {
-      this.timeLineMap = []
-      this.cotton = []
-      this.old = []
-      this.simple = []
-      this.super = []
-      if (this.dateVal) {
-        const startdate = this.dateVal[0]
-        const enddate = this.dateVal[1]
-        this.getData(startdate, enddate)
-      } else {
-        this.getData()
-      }
-    },
-    // 获取所有商品销量,销售额
-    async getData(startdate, enddate) {
-      this.legendMap = []
-      this.timeLineMap = []
-      const loading = this.$loading()
-      try {
-        const { code, data } = await addSortLine({ startdate, enddate })
-        loading.close()
-        if (code === 200) {
-          const arrData = []
-          for (const k in data) {
-            var arr = []
-            this.legendMap.push(k)
-            for (const j in data[k]) {
-              arr.push(data[k][j])
-              if (this.timeLineMap.indexOf(j) === -1) {
-                this.timeLineMap.push(j)
-              }
-              arrData.push({
-                name: k,
-                type: 'line',
-                stack: '数量',
-                data: arr
-              })
-            }
-          }
-          const obj2 = {}
-          this.showData = arrData.reduce((prev, item) => {
-            obj2[item.name] ? '' : (obj2[item.name] = true && prev.push(item))
-            return prev
-          }, [])
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(`${e}`)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '服务每日新增注册人数'
-          },
-          tooltip: {
-            trigger: 'axis'
-          },
-          legend: {
-            data: this.legendMap
-          },
-          dataZoom: [
-            {
-              type: 'slider'
-            },
-            { type: 'inside' }
-          ],
-          xAxis: {
-            type: 'category',
-            name: '日期',
-            data: this.timeLineMap,
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            }
-          },
-          yAxis: {
-            type: 'value',
-            name: '人数',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: this.showData
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 146
src/views/dashboard/components/wareaNew.vue

@@ -1,146 +0,0 @@
-<template>
-  <div>
-    <el-date-picker
-      v-model="date"
-      type="datetime"
-      placeholder="选择日期时间"
-      format="yyyy-MM-dd"
-      value-format="yyyy-MM-dd"
-      @change="getOrderAccount"
-    />
-    <div ref="style_num_echart" :style="{ height: height, width: width }" />
-  </div>
-</template>
-
-<script>
-import * as echarts from 'echarts'
-import resize from '../mixins/resize'
-import { addSort } from '@/api/index'
-
-export default {
-  mixins: [resize],
-  props: {
-    width: {
-      type: String,
-      default: '600px'
-    },
-    height: {
-      type: String,
-      default: '600px'
-    }
-  },
-  data() {
-    return {
-      chart: null,
-      timeLineMap: [],
-      lengedMap: [],
-      date: ''
-    }
-  },
-  created() {
-    this.date = this.getTime()
-    this.getOrderAccount()
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
-  methods: {
-    getTime() {
-      var date = new Date()
-      var year = date.getFullYear()
-      var month =
-        date.getMonth() + 1 < 10
-          ? '0' + (date.getMonth() + 1)
-          : date.getMonth() + 1
-      var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
-      var today = year + '-' + month + '-' + day
-      return today
-    },
-    createObjectByArray(arr, type) {
-      const obj = {}
-      arr.forEach((k) => {
-        obj[k] = type ? [] : {}
-      })
-      return obj
-    },
-    // 获取所有商品销量,销售额
-    async getOrderAccount() {
-      this.timeLineMap = []
-      this.lengedMap = []
-      const loading = this.$loading()
-      try {
-        const { code, data } = await addSort({ date: this.date })
-        loading.close()
-        if (code === 200) {
-          data.map((i) => {
-            this.timeLineMap.push(i.warea.name)
-            this.lengedMap.push(i.count)
-          })
-          this.initChart()
-        }
-      } catch (e) {
-        loading.close()
-        console.log(e)
-      }
-    },
-    initChart() {
-      this.$nextTick(() => {
-        this.chart = echarts.init(this.$refs.style_num_echart)
-        this.chart.clear()
-        this.chart.setOption({
-          title: {
-            text: '服务每日新增注册人数排行'
-          },
-          xAxis: {
-            type: 'category',
-            data: this.timeLineMap,
-            name: '服务',
-            axisLabel: {
-              textStyle: {
-                color: '#000'
-              },
-              interval: 0
-            }
-          },
-          yAxis: {
-            type: 'value',
-            name: '人数',
-            axisLabel: {
-              show: true,
-              textStyle: {
-                color: '#000'
-              }
-            },
-            axisLine: {
-              show: true
-            }
-          },
-          series: [
-            {
-              data: this.lengedMap,
-              type: 'bar',
-              // showBackground: true,
-              label: {
-                show: true,
-                position: 'top',
-                color: 'black'
-              },
-              barWidth: 30,
-              itemStyle: {
-                normal: {
-                  color: '#FB231F'
-                }
-              }
-            }
-          ]
-        })
-        window.onresize = this.chart.resize
-      })
-    }
-  }
-}
-</script>

+ 0 - 172
src/views/dashboard/components/yesRank.vue

@@ -1,172 +0,0 @@
-<template>
-  <div>
-    <div class="rank">昨日销量数据排名</div>
-    <div class="tabs">
-      <div :class="current == 1 ? 'active' : ''" @click="choose(1)">精装版</div>
-      <div :class="current == 2 ? 'active' : ''" @click="choose(2)">简约版</div>
-      <div :class="current == 3 ? 'active' : ''" @click="choose(3)">老人版</div>
-      <div :class="current == 4 ? 'active' : ''" @click="choose(4)">
-        纯棉老人版
-      </div>
-    </div>
-    <el-table
-      ref="yesTable"
-      v-loading="loading"
-      style="width: 100%; max-height: 480px; overflow: auto"
-      border
-      :data="yeslist"
-      height="480"
-    >
-      <el-table-column
-        label="排名"
-        type="index"
-        align="center"
-        width="60"
-        :index="
-          (index) => params.page_size * (params.page_index - 1) + index + 1
-        "
-      />
-      <el-table-column
-        label="头像"
-        prop="img"
-        width="80"
-        label-class-name="label"
-        align="center"
-        style="padding: 0"
-      >
-        <template slot-scope="{ row }">
-          <img width="36" height="36" :src="row.img" class="hoverImg">
-        </template>
-      </el-table-column>
-      <el-table-column label="店铺名称" prop="name" align="center" />
-      <el-table-column label="销售数量" prop="total" align="center">
-        <template slot-scope="{row}">
-          {{ format(row.total,true) }}
-        </template>
-      </el-table-column>
-      <el-table-column label="销售金额" prop="account" align="center">
-        <template slot-scope="{row}">
-          {{ format(row.account) }}
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="batch-container">
-      <el-pagination
-        :current-page="params.page_index"
-        :page-sizes="[10, 15, 20, 30, 100]"
-        :page-size="params.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="totalPage"
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-      />
-    </div>
-  </div>
-</template>
-<script>
-import { yesterdayOrderBy } from '@/api/index'
-import { format } from '@/filters/common'
-
-export default {
-  data() {
-    return {
-      yeslist: [],
-      current: 1,
-      params: {
-        page_index: 1,
-        page_size: 20
-      },
-      totalPage: 0,
-      loading: false
-    }
-  },
-  created() {
-    this.format = format
-    this.getList()
-  },
-  methods: {
-    // tab切换
-    choose(type) {
-      this.params.page_index = 1
-      this.current = type
-      this.getList()
-    },
-    // 昨日销量排名
-    async getList() {
-      this.loading = true
-      const res = await yesterdayOrderBy(this.params)
-      try {
-        const { msg, code, data } = res
-        if (code === 200) {
-          const { cotton_info, old_info, simple_info, super_info } = data
-          switch (this.current) {
-            case 1:
-              this.yeslist = super_info.list
-              this.totalPage = super_info.total
-              break
-            case 2:
-              this.yeslist = simple_info.list
-              this.totalPage = simple_info.total
-
-              break
-            case 3:
-              this.yeslist = old_info.list
-              this.totalPage = old_info.total
-
-              break
-            case 4:
-              this.yeslist = cotton_info.list
-              this.totalPage = cotton_info.total
-
-              break
-            default:
-              this.yeslist = super_info.list
-              this.totalPage = super_info.total
-          }
-        } else {
-          this.$message.error(msg || '获取数据失败')
-        }
-        this.loading = false
-      } catch (e) {
-        this.loading = false
-        console.log(`获取排行失败:${e}`)
-      }
-    },
-    handleSizeChange(val) {
-      this.params.page_size = val
-      this.getList()
-    },
-    handleCurrentChange(val) {
-      this.params.page_index = val
-      this.getList()
-    }
-  }
-}
-</script>
-<style scoped lang="scss">
-.rank {
-  font-size: 18px;
-  font-weight: bold;
-  padding: 10px 0;
-}
-.tabs {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-  div {
-    width: 200px;
-    height: 50px;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-  }
-  .active {
-    color: #f00;
-  }
-}
-.batch-container {
-  width: 100%;
-  text-align: center;
-  margin-top:20px;
-}
-</style>

+ 71 - 321
src/views/dashboard/index.vue

@@ -1,371 +1,121 @@
 <template>
 <template>
   <div class="home">
   <div class="home">
-    <div class="home_data">
-      <el-row :gutter="20" type="flex" justify="space-between">
-        <el-col :span="6">
-          <div class="grid-content">
-            <div>
-              <div class="name">用户总数</div>
-              <div class="num">{{ format(sum.user_count) }}</div>
-            </div>
-            <svg-icon icon-class="user" class-name="custom-class" />
-          </div>
-        </el-col>
-        <el-col :span="6">
-          <div class="grid-content">
-            <div>
-              <div class="name">店铺总数</div>
-              <div class="num">{{ format(sum.store_count) }}</div>
-            </div>
-            <svg-icon icon-class="store" class-name="custom-class" />
-          </div>
-        </el-col>
-        <el-col :span="6">
-          <div class="grid-content">
-            <div>
-              <div class="name">商品总数</div>
-              <div class="num">{{ sum.goods_count }}</div>
-            </div>
-            <svg-icon icon-class="goods" class-name="custom-class" />
-          </div>
-        </el-col>
-        <!-- <el-col :span="6">
-          <div class="grid-content">
-            <div>
-              <div class="name">总销售额</div>
-              <div class="num">{{ format(sum.order_sale) }}</div>
-            </div>
-            <svg-icon icon-class="sale" class-name="custom-class" />
-          </div>
-        </el-col> -->
-      </el-row>
-    </div>
-    <div class="echarts">
-
-      <!-- 日新增注册人数 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart12">
-            <new-daily width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 客服日新增注册人数 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart13">
-            <warea-new width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 服务日增人数曲线图 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart14">
-            <warea-line width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 款式日销售额 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart1">
-            <sale-info width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 款式日销售数量 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart2">
-            <sale-num width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 款式总销售金额 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart3">
-            <type-all width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 日销售总金额 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart4">
-            <daily-sale width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 日销售总数量 -->
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart5">
-            <daily-num width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 尺码数据排名  表格 -->
-      <el-row class="table_con">
-        <el-col :span="24">
-          <div ref="echart6">
-            <sku-rank width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 总销量数据排名   表格-->
-      <el-row class="table_con">
-        <el-col :span="24">
-          <div ref="echart7">
-            <all-rank width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 昨日销售排名  表格-->
-      <el-row class="table_con" style="height: 650px">
-        <el-col :span="24">
-          <div ref="echart8">
-            <yes-rank width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <!-- 支付比例显示-->
-      <el-row class="table_con" style="height: 650px">
-        <el-col :span="24">
-          <div ref="echart15">
-            <pay-rate width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart8">
-            <history-total width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-
-
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart10">
-            <top-ten width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-
-      <el-row class="style_num_container">
-        <el-col :span="24">
-          <div ref="echart11">
-            <skuday-sale width="100%" />
-          </div>
-        </el-col>
-      </el-row>
-    </div>
-    <div class="nav">
-      <div
-        v-for="(item, idx) in navList"
-        :key="idx"
-        :class="cur == item.id ? 'active' : ''"
-        @click="toPosition(item.id)"
-      >
-        {{ item.text }}
-      </div>
-    </div>
+    <!-- 首页 -->
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { mapGetters } from 'vuex'
 import { mapGetters } from 'vuex'
-import { getData } from '@/api/index'
-import skudaySale from './components/skudaySale'
-import topTen from './components/topTen'
-import dailySale from './components/dailySale'
-import dailyNum from './components/dailyNum'
-import saleInfo from './components/saleInfo.vue'
-import saleNum from './components/saleNum.vue'
-import historyTotal from './components/historyTotal.vue'
-import typeAll from './components/typeAll.vue'
-import newDaily from './components/newDaily.vue'
-import wareaNew from './components/wareaNew.vue'
-import wareaLine from './components/wareaLine.vue'
-
-import allRank from './components/allRank.vue'
-import skuRank from './components/skuRank.vue'
-import yesRank from './components/yesRank.vue'
-import payRate from './components/payRate.vue'
 import { format } from '@/filters/common'
 import { format } from '@/filters/common'
 
 
 export default {
 export default {
   name: 'Dashboard',
   name: 'Dashboard',
 
 
   components: {
   components: {
-    dailySale,
-    dailyNum,
-    skudaySale,
-    topTen,
-    saleInfo,
-    saleNum,
-    historyTotal,
-    typeAll,
-    newDaily,
-    wareaNew,
-    wareaLine,
-    allRank,
-    skuRank,
-    yesRank,
-    payRate
   },
   },
   data() {
   data() {
     return {
     return {
-      yeslist: [],
-      skuList: [],
-      sum: {
-        user_count: 0,
-        store_count: 0,
-        goods_count: 0,
-        order_sale: 0
-      }, // 顶部展示数据
-      cur: '',
-      navList: [
-        { id: 12, text: '每日新增注册人数' },
-        { id: 13, text: '服务每日新增注册人数排行' },
-        { id: 14, text: '服务每日新增注册人数' },
-        { id: 1, text: '款式日销售金额' },
-        { id: 2, text: '款式日销售数量' },
-        { id: 3, text: '款式总销售汇总' },
-        { id: 4, text: '日总销售金额统计' },
-        { id: 5, text: '日总销售数量统计' },
-        { id: 6, text: '尺码总销售排名' },
-        { id: 7, text: '昨日销量数据排名' },
-        { id: 15, text: '公司客户/客户支付占比分析' },
-        { id: 8, text: '销售取消退货数据汇总' },
-        { id: 10, text: '店铺销售前十' },
-        { id: 11, text: '尺码日销量统计' }
-      ]
+
     }
     }
   },
   },
   computed: {
   computed: {
     ...mapGetters(['name'])
     ...mapGetters(['name'])
   },
   },
   created() {
   created() {
-    this.format = format
-    this.$nextTick(() => {
-      this.getData()
-    })
+
   },
   },
   destroyed() {
   destroyed() {
-    window.removeEventListener('resize', this.initEchart, 20)
+
   },
   },
   methods: {
   methods: {
-    toPosition(type) {
-      this.cur = type
-      const position = `echart${type}`
-      this.$refs[position].scrollIntoView(true)
-    },
-    // 获取顶部展示数据
-    async getData() {
-      const res = await getData()
-      try {
-        const { msg, code, data } = res
-        if (code === 200) {
-          this.sum = data
-        } else {
-          this.$message.error(msg || '获取数据失败')
-        }
-      } catch (e) {
-        this.$message.error(e || '获取数据失败')
-      }
-    }
   }
   }
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-  .home {
-    width: 100%;
-    height: 100%;
-    background: rgb(240, 242, 245);
-    position: relative;
-
-    .nav {
-      position: fixed;
-      top: 230px;
-      right: 5px;
-      padding: 10px 0;
-      text-align: center;
-      background: #fff;
-      z-index: 9999;
-      box-shadow: 0 0 9px 3px #ddd;
-      border-radius: 8px;
-
-      div {
-        width: 100%;
-        height: 40px;
-        line-height: 40px;
-        padding: 0 10px;
-        cursor: pointer;
-      }
-
-      .active {
-        background: #f2f2f2;
-      }
+.home {
+  width: 100%;
+  height: 100%;
+  background: rgb(240, 242, 245);
+  position: relative;
+
+  .nav {
+    position: fixed;
+    top: 230px;
+    right: 5px;
+    padding: 10px 0;
+    text-align: center;
+    background: #fff;
+    z-index: 9999;
+    box-shadow: 0 0 9px 3px #ddd;
+    border-radius: 8px;
+
+    div {
+      width: 100%;
+      height: 40px;
+      line-height: 40px;
+      padding: 0 10px;
+      cursor: pointer;
     }
     }
 
 
-    .table_con {
-      height: 580px;
+    .active {
+      background: #f2f2f2;
     }
     }
+  }
 
 
-    .home_data {
-      width: 95%;
-      margin: 0 auto;
+  .table_con {
+    height: 580px;
+  }
 
 
-      .el-row {
-        .el-col {
-          border-radius: 4px;
+  .home_data {
+    width: 95%;
+    margin: 0 auto;
 
 
-          .grid-content {
-            margin-top: 20px;
-            background: #fff;
-            border-radius: 4px;
-            min-height: 36px;
-            font-weight: bold;
-            padding: 0 15px;
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
+    .el-row {
+      .el-col {
+        border-radius: 4px;
 
 
-            .name {
-              color: rgba(0, 0, 0, 0.45);
-            }
+        .grid-content {
+          margin-top: 20px;
+          background: #fff;
+          border-radius: 4px;
+          min-height: 36px;
+          font-weight: bold;
+          padding: 0 15px;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+
+          .name {
+            color: rgba(0, 0, 0, 0.45);
+          }
 
 
-            .num {
-              margin-top: 15px;
-              font-size: 22px;
-            }
+          .num {
+            margin-top: 15px;
+            font-size: 22px;
+          }
 
 
-            .custom-class {
-              width: 135px;
-              height: 135px;
-            }
+          .custom-class {
+            width: 135px;
+            height: 135px;
           }
           }
         }
         }
       }
       }
     }
     }
+  }
 
 
-    .echarts {
-      .el-row {
-        background: #fff;
-        width: 95%;
-        margin: 20px auto 0;
-        padding: 15px;
-        border-radius: 4px;
+  .echarts {
+    .el-row {
+      background: #fff;
+      width: 95%;
+      margin: 20px auto 0;
+      padding: 15px;
+      border-radius: 4px;
 
 
-        &:last-child {
-          margin-bottom: 0px;
-        }
+      &:last-child {
+        margin-bottom: 0px;
       }
       }
     }
     }
   }
   }
+}
 </style>
 </style>

+ 46 - 9
src/views/invest/achievement.vue

@@ -15,6 +15,9 @@
                 @clear="toSearch()">
                 @clear="toSearch()">
                 <el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
                 <el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
             </el-select>
+            <el-upload class="upload-demo" action="" :http-request="uploadFile" :multiple="false" :show-file-list="false">
+                <el-button type="primary" style="margin:0 10px;">导入</el-button>
+            </el-upload>
             <el-button @click="handleEdit(false)" type="primary" style="margin-left:10px;">添加</el-button>
             <el-button @click="handleEdit(false)" type="primary" style="margin-left:10px;">添加</el-button>
         </div>
         </div>
         <div class="table_box">
         <div class="table_box">
@@ -58,17 +61,18 @@
                     </el-select>
                     </el-select>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="企业:" prop="company_id">
                 <el-form-item label="企业:" prop="company_id">
-                    <el-select v-model="ruleForm.company_id" placeholder="请选择企业" class="select" style="width:300px">
+                    <el-select v-model="ruleForm.company_id" placeholder="请选择企业" class="select" style="width:300px"
+                        @change="changeCompany">
                         <el-option v-for=" item in companyList" :key="item.id" :label="item.name" :value="item.id" />
                         <el-option v-for=" item in companyList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                     </el-select>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="项目:" prop="project_id">
                 <el-form-item label="项目:" prop="project_id">
                     <el-select v-model="ruleForm.project_id" placeholder="请选择项目" class="select" style="width:300px">
                     <el-select v-model="ruleForm.project_id" placeholder="请选择项目" class="select" style="width:300px">
-                        <el-option v-for=" item in projectList" :key="item.id" :label="item.name" :value="item.id" />
+                        <el-option v-for=" item in comProjectList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                     </el-select>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="金额:" prop="amount">
                 <el-form-item label="金额:" prop="amount">
-                    <el-input placeholder="请输入金额" v-model="ruleForm.amount" style="width:300px"></el-input>
+                    <el-input placeholder="请输入金额" v-model="ruleForm.amount" style="width:300px" type="number"></el-input>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item>
                 <el-form-item>
 
 
@@ -85,8 +89,8 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-import { investAchievementList, addInvestAchievement, editInvestAchievement, deleteInvestAchievement, investActAll } from '@/api/invest'
-import { projectAll, companyAll } from '@/api/company'
+import { investAchievementList, addInvestAchievement, editInvestAchievement, deleteInvestAchievement, investActAll, importInvestAchievement } from '@/api/invest'
+import { projectAll, companyAll, companyProject } from '@/api/company'
 import Tinymce from '@/components/Tinymce'
 import Tinymce from '@/components/Tinymce'
 export default {
 export default {
     data() {
     data() {
@@ -99,6 +103,7 @@ export default {
             companyList: [],
             companyList: [],
             projectList: [],
             projectList: [],
             actList: [],
             actList: [],
+            comProjectList: [],
             id: '', // 修改时的id
             id: '', // 修改时的id
             isEdit: false,
             isEdit: false,
             ruleForm: {
             ruleForm: {
@@ -119,9 +124,6 @@ export default {
                 company_id: [
                 company_id: [
                     { required: true, message: '请选择企业', trigger: 'change' }
                     { required: true, message: '请选择企业', trigger: 'change' }
                 ],
                 ],
-                project_id: [
-                    { required: true, message: '请选择项目', trigger: 'change' }
-                ],
                 act_id: [
                 act_id: [
                     { required: true, message: '请选择活动', trigger: 'change' }
                     { required: true, message: '请选择活动', trigger: 'change' }
                 ],
                 ],
@@ -139,6 +141,40 @@ export default {
         this.getOptions()
         this.getOptions()
     },
     },
     methods: {
     methods: {
+        // 选择企业后项目联动
+        changeCompany(id) {
+            this.getComPoject(id)
+        },
+        getComPoject(id) {
+            companyProject({ company_id: id }).then(res => {
+                const { code, data, msg } = res
+                if (code === 200) {
+                    this.comProjectList = data
+                } else {
+                    this.$message.error(msg)
+                }
+            })
+        },
+        // 导入
+        uploadFile(params) {
+            const file = params.file
+            var formData = new FormData()
+            formData.append('file', file)
+            const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls')
+            console.log(file.name, 'file')
+            if (!isExcel) {
+                this.$message.error('仅支持上传 .xlsx 或 .xls 格式的文件!')
+                return
+            }
+            importInvestAchievement(formData).then(res => {
+                if (res.code === 200) {
+                    this.$message.success('导入成功!')
+                    this.getList()
+                } else {
+                    this.$message.error(res.message || '导入失败!')
+                }
+            })
+        },
         getOptions() {
         getOptions() {
             companyAll().then(res => {
             companyAll().then(res => {
                 const { code, msg, data } = res
                 const { code, msg, data } = res
@@ -179,7 +215,7 @@ export default {
                 date: ''
                 date: ''
             }
             }
         },
         },
-        // 编辑或者添加人才信息
+        // 编辑或者添加信息
         handleEdit(isEdit, row) {
         handleEdit(isEdit, row) {
             this.dialogVisible = true
             this.dialogVisible = true
             this.isEdit = isEdit
             this.isEdit = isEdit
@@ -188,6 +224,7 @@ export default {
             } else { // 编辑
             } else { // 编辑
                 this.id = row.id
                 this.id = row.id
                 const { company_id, project_id, act_id, amount, date } = row
                 const { company_id, project_id, act_id, amount, date } = row
+                this.getComPoject(company_id)
                 this.ruleForm = {
                 this.ruleForm = {
                     company_id,
                     company_id,
                     project_id,
                     project_id,

+ 24 - 1
src/views/invest/activity.vue

@@ -7,6 +7,9 @@
                 @keyup.enter.native="toSearch()" @clear="toSearch()" style="width:320px;" />
                 @keyup.enter.native="toSearch()" @clear="toSearch()" style="width:320px;" />
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
             <el-button @click="handleEdit(false)" type="primary">添加</el-button>
             <el-button @click="handleEdit(false)" type="primary">添加</el-button>
+            <el-upload class="upload-demo" action="" :http-request="uploadFile" :multiple="false" :show-file-list="false">
+                <el-button type="primary" style="margin:0 10px;">导入</el-button>
+            </el-upload>
         </div>
         </div>
         <div class="table_box">
         <div class="table_box">
             <el-table ref="list" :data="listData" align="center" :header-cell-style="{ background: '#f8fbfc' }"
             <el-table ref="list" :data="listData" align="center" :header-cell-style="{ background: '#f8fbfc' }"
@@ -58,7 +61,7 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-import { investActList, investActAll, addInvestAct, editInvestAct, deleteInvestAct } from '@/api/invest'
+import { investActList, investActAll, addInvestAct, editInvestAct, deleteInvestAct ,importInvestAct} from '@/api/invest'
 import Tinymce from '@/components/Tinymce'
 import Tinymce from '@/components/Tinymce'
 export default {
 export default {
     data() {
     data() {
@@ -105,6 +108,26 @@ export default {
         this.getList()
         this.getList()
     },
     },
     methods: {
     methods: {
+        // 导入
+        uploadFile(params) {
+            const file = params.file
+            var formData = new FormData()
+            formData.append('file', file)
+            const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls')
+            console.log(file.name, 'file')
+            if (!isExcel) {
+                this.$message.error('仅支持上传 .xlsx 或 .xls 格式的文件!')
+                return
+            }
+            importInvestAct(formData).then(res => {
+                if (res.code === 200) {
+                    this.$message.success('导入成功!')
+                    this.getList()
+                } else {
+                    this.$message.error(res.message || '导入失败!')
+                }
+            })
+        },
         // 搜索
         // 搜索
         toSearch() {
         toSearch() {
             this.params.page_index = 1
             this.params.page_index = 1

+ 5 - 4
src/views/login/index.vue

@@ -170,10 +170,11 @@ export default {
           this.$store
           this.$store
             .dispatch('user/login', this.loginForm) // 登录
             .dispatch('user/login', this.loginForm) // 登录
             .then((res) => {
             .then((res) => {
-              this.$router.push({
-                path: this.redirect || '/friendlyLinks',
-                query: this.otherQuery
-              })
+              // this.$router.push({
+              //   path: this.redirect || '/friendlyLinks',
+              //   query: this.otherQuery
+              // })
+              this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
               this.loading = false
               this.loading = false
             })
             })
             .catch(() => {
             .catch(() => {

+ 339 - 0
src/views/module/module.vue

@@ -0,0 +1,339 @@
+<!-- 动态模块 -->
+<template>
+    <div class="content">
+        <div v-loading.fullscreen.lock="loadingFull" />
+        <div class="search_box">
+            <el-button @click="handleEdit(0)" type="primary" style="margin-right:24px;">添加</el-button>
+            <el-button @click="reset(), intrDialogVisible = true, isEdit = false" type="primary"
+                style="margin-right:24px;">添加行业简介</el-button>
+        </div>
+        <div class="table_box">
+            <el-table ref="list" :data="listData" align="center" :header-cell-style="{ background: '#f8fbfc' }"
+                class="tableBorder" border stripe>
+                <el-table-column prop="title" label="标题" align="center" />
+                <el-table-column label="操作" align="center" width="280">
+                    <template slot-scope="{row}">
+                        <el-button type="text" size="mini" @click="handleEdit(true, row)">编辑</el-button>
+                        <el-button type="text" size="mini" @click="handleDelete(row)">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <el-drawer :title="isEdit ? '修改' : '添加'" :visible.sync="dialogVisible" size="50%">
+            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
+                <el-form-item label="标题:" prop="title">
+                    <el-input v-model="ruleForm.title" placeholder="请输入标题" style="width:300px" />
+                </el-form-item>
+                <el-form-item label="内容:" prop="content" required>
+                    <tinymce v-model="ruleForm.content" :height="300" width="85%" :showUpload="false" />
+                </el-form-item>
+                <el-form-item>
+                    <el-button @click="dialogVisible = false">取 消</el-button>
+                    <el-button type="primary" @click="submitForm('ruleForm')">{{ !isEdit ? '确 定' : '保存' }}</el-button>
+                </el-form-item>
+            </el-form>
+
+        </el-drawer>
+        <el-drawer :title="isEdit ? '修改' : '添加'" :visible.sync="intrDialogVisible" size="50%">
+            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
+                <el-form-item label="标题:" prop="title" v-if="isEdit">
+                    <el-input v-model="ruleForm.title" placeholder="请输入标题" style="width:300px" disabled />
+                </el-form-item>
+                <el-form-item v-for="(item, i) in categoryList  " :key="i" :label="item.name" :prop="item.mark"
+                    v-if="!isEdit">
+                    <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
+                        :style="{ width: '300px' }" filterable clearableruleFormruleForm style="width:300px"
+                        @change="handleChange" value-key="id" :disabled="isEdit ? true : false">
+                        <el-option v-for="(  temp, idx  ) in   item.children  " :key="idx" :label="temp.name" :value="temp">
+                            <span style="float: left" class="span-style">{{ temp.name }}</span>
+                            <span style="float: right;margin-left:5px;" class="span-style"
+                                @click.stop="editItem(item.id, 1, temp, i)">
+                                <i class="el-icon-edit-outline" />
+                            </span>
+                        </el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="内容:" prop="content" required>
+                    <tinymce v-model="ruleForm.content" :height="300" width="85%" :showUpload="false" />
+                </el-form-item>
+                <el-form-item>
+                    <el-button @click="dialogVisible = false">取 消</el-button>
+                    <el-button type="primary" @click="submitForm('ruleForm')">{{ !isEdit ? '确 定' : '保存' }}</el-button>
+                </el-form-item>
+            </el-form>
+
+        </el-drawer>
+        <div class="paging_box">
+            <pagination :total="listDataTotal" :limit="params.page_size" :page="params.page_index"
+                @pagination="changePagination" @update:limit="changePagination" />
+        </div>
+    </div>
+</template>
+<script>
+import { moduleList, addModule, editModule, deleteModule, moduleCategory } from '@/api/module'
+import Tinymce from '@/components/Tinymce'
+import { addCategory, editCategory, deleteCategory } from '@/api/category'
+export default {
+    data() {
+        return {
+            isIntr: false,
+            categoryList: [], // 类型列表
+            dialogVisible: false,
+            intrDialogVisible: false,
+            loadingFull: false,
+            listData: [],
+            listDataTotal: 0,
+            id: '',// 当前修改公告的id
+            isEdit: false,
+            ruleForm: {
+                title: '',
+                content: '',
+                industry: '',
+                mark: ''
+            },
+            params: {
+                page_index: 1,
+                page_size: 10,
+                search: '',
+                type: ''
+            },
+            rules: {
+                title: [
+                    { required: true, message: '请输入标题', trigger: 'blur' }
+                ],
+                content: [
+                    { required: true, message: '请输入内容', trigger: 'blur' }
+                ],
+                industry: [
+                    { required: true, message: '请选择行业类型', trigger: 'change' }
+                ]
+            }
+        }
+    },
+    mounted() {
+        this.getList()
+        this.getCategory()
+    },
+    components: { Tinymce },
+    methods: {
+        handleChange(e) {
+            console.log(e, 'e')
+            this.ruleForm.title = e.name
+        },
+        // 修改类型
+        editItem(fid, isEdit, info, idx) {
+            this.addItem(fid, isEdit, info, idx)
+        },
+        // 添加/修改类型
+        addItem(fid, isEdit, info, idx) {
+            if (info && info != null && isEdit === 1) {
+                this.$message.error('无可编辑内容')
+                return
+            }
+            let val = ''
+            if (info) {
+                const index = this.categoryList[idx].children.findIndex((e) => e.id === info.id)
+                const obj = this.categoryList[idx].children[index]
+                val = obj.name
+            }
+            this.$prompt(' 请输入新的类型名称 ', isEdit === 1 ? '编辑' : '添加', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                inputValue: val
+            }).then(async ({ value }) => {
+                if (!value || value === '') {
+                    this.$message.error('类型名称不能为空!')
+                } else {
+                    const http = isEdit === 1 ? editCategory : addCategory
+                    const data = isEdit === 1 ? { fid, id: info.id, name: value } : { fid, name: value }
+                    http(data).then(res => {
+                        if (res.code === 200) {
+                            this.$message.success(isEdit === 1 ? '修改类型成功' : '添加类型成功')
+                            this.getCategory()
+                        } else {
+                            this.$message.success(res.msg || isEdit === 1 ? '修改类型失败' : '添加类型失败')
+                        }
+                    })
+                }
+            })
+        },
+        // 删除类型
+        deleteItem(info) {
+            this.$confirm("确定要删除" + "' " + info.name + " '" + "吗?", "删除", {
+                type: 'warning'
+            })
+                .then(() => {
+                    // 本地静态删除
+                    deleteCategory({ id: info.id }).then(res => {
+                        if (res.code === 200) {
+                            this.$message.success('删除成功')
+                            this.getCategory()
+                        } else {
+                            this.$message.error(res.message || '删除失败')
+                        }
+                    })
+                })
+                .catch(() => { });
+        },
+        // 下拉时显示底下的新增按钮
+        visibleChange(visible, refName, fid) {
+            if (visible) {
+                const ref = this.$refs[refName][0];
+                let product = ref.$refs.popper;
+                if (product.$el) product = product.$el;
+                if (
+                    !Array.from(product.children).some(
+                        (v) => v.className === "el-template-menu__list"
+                    )
+                ) {
+                    const el = document.createElement("ul");
+                    el.className = "el-template-menu__list";
+                    el.style =
+                        "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
+                    el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
+              <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增公告</span>
+              </li>`;
+                    product.appendChild(el);
+                    // 新增按钮点击事件
+                    el.onclick = () => {
+                        this.addItem(fid, 0);
+                    };
+                }
+            }
+        },
+        // 获取分类列表
+        async getCategory() {
+            this.options = []
+            try {
+                const res = await moduleCategory()
+                const { message, code, data } = res
+                if (code === 200) {
+                    this.categoryList = data
+                } else {
+                    this.$message.error(message)
+                }
+            } catch (e) {
+                console.log(`获取列表失败:${e}`)
+            }
+        },
+        // 搜索
+        toSearch() {
+            this.params.page_index = 1
+            this.getList()
+        },
+        reset() {
+            this.ruleForm = {
+                title: '',
+                content: '',
+                mark: '',
+                industry: ''
+            }
+        },
+        // 编辑或者添加信息
+        handleEdit(isEdit, row) {
+            this.isEdit = isEdit
+            if (!isEdit) { // 添加
+                this.reset()
+                this.dialogVisible = true
+            } else { // 编辑
+                this.id = row.id
+                const { title, content, mark } = row
+                if (row.mark) {
+                    this.intrDialogVisible = true
+                } else {
+                    this.dialogVisible = true
+                }
+
+                this.ruleForm = {
+                    title,
+                    content,
+                    mark
+                }
+            }
+        },
+        // 获取列表
+        async getList() {
+            this.loadingFull = true
+            try {
+                const res = await moduleList(this.params)
+                const { message, code, data } = res
+                if (code === 200) {
+                    const { list, total } = data
+                    this.listData = list
+                    this.listDataTotal = total
+                } else {
+                    this.$message.error(message)
+                }
+            } catch (e) {
+                console.log(`获取列表失败:${e}`)
+                this.loadingFull = false
+            }
+            this.loadingFull = false
+        },
+        // 添加/编辑事件
+        submitForm(formName) {
+            this.$refs[formName].validate((valid) => {
+                if (valid) {
+                    this.ruleForm.mark = 'industry-' + this.ruleForm.industry
+                    const http = this.isEdit ? editModule : addModule
+                    const { title, content, mark } = this.ruleForm
+                    const data = this.isEdit ? { title, content, mark, id: this.id } : { title, content, mark }
+                    http(data).then(res => {
+                        if (res.code === 200) {
+                            this.$message.success(this.isEdit ? '修改成功!' : '添加成功!')
+                            this.getList()
+                            this.dialogVisible = false
+                        } else {
+                            this.$message.error(this.isEdit ? '修改失败!' : '添加失败!')
+                            this.$message.error(res.msg)
+                        }
+                    })
+                } else {
+                    console.log('error submit!!')
+                    return false
+                }
+            })
+        },
+        // 删除确认
+        handleDelete(row) {
+            const { id } = row
+            this.$confirm('确认要删除该信息吗?', '删除确认', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.deleteEvent(id)
+            })
+        },
+        // 删除事件
+        async deleteEvent(id) {
+            const res = await deleteModule({ id })
+            try {
+                const { message, code } = res
+                if (code === 200) {
+                    this.$message.success('删除成功!')
+                    this.getList()
+                } else {
+                    this.$message.error(message)
+                }
+            } catch (e) {
+                this.$message.error(e.message)
+            }
+        },
+        // 分页页码变化
+        changePagination(data) {
+            const { page, limit } = data
+            this.params.page_size = limit
+            this.params.page_index = page
+            this.getList()
+        }
+    }
+
+}
+</script>
+<style lang="scss" scoped>
+.el-input,
+textarea {
+    width: 350px;
+}
+</style>

+ 17 - 27
src/views/notice/notice.vue

@@ -3,10 +3,12 @@
     <div class="content">
     <div class="content">
         <div v-loading.fullscreen.lock="loadingFull" />
         <div v-loading.fullscreen.lock="loadingFull" />
         <div class="search_box flexS">
         <div class="search_box flexS">
-            <el-select v-model="params.search_type" placeholder="公告分类" class="select" @change="toSearch()" clearable
-                @clear="toSearch()">
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
+            <div v-for="(item, idx) in categoryList" :key="idx">
+                <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()"
+                    clearable @clear="toSearch()">
+                    <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+            </div>
             <el-input v-model="params.search" clearable placeholder="公告名称" prefix-icon="el-icon-search"
             <el-input v-model="params.search" clearable placeholder="公告名称" prefix-icon="el-icon-search"
                 @keyup.enter.native="toSearch()" @clear="toSearch()" />
                 @keyup.enter.native="toSearch()" @clear="toSearch()" />
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
@@ -45,7 +47,8 @@
                     <el-input v-model="ruleForm.source" placeholder="请输入来源" style="width:300px" />
                     <el-input v-model="ruleForm.source" placeholder="请输入来源" style="width:300px" />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="发布时间:" prop="time">
                 <el-form-item label="发布时间:" prop="time">
-                    <el-date-picker v-model="ruleForm.time" type="datetime" placeholder="选择日期时间" style="width:300px">
+                    <el-date-picker v-model="ruleForm.time" type="datetime" placeholder="选择日期时间" style="width:300px"
+                        format="yyyy-MM-dd" value-format="yyyy-MM-dd">
                     </el-date-picker>
                     </el-date-picker>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
@@ -63,10 +66,8 @@
                         </el-option>
                         </el-option>
                     </el-select>
                     </el-select>
                 </el-form-item>
                 </el-form-item>
-
-
                 <el-form-item label="内容:" prop="content" required>
                 <el-form-item label="内容:" prop="content" required>
-                    <tinymce v-model="ruleForm.content" :height="300" width="80%" />
+                    <tinymce v-model="ruleForm.content" :height="300" width="80%" :uploadData="{ dir: 'image/notice' }" />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item>
                 <el-form-item>
                     <el-button @click="dialogVisible = false">取 消</el-button>
                     <el-button @click="dialogVisible = false">取 消</el-button>
@@ -88,7 +89,6 @@ import Tinymce from '@/components/Tinymce'
 export default {
 export default {
     data() {
     data() {
         return {
         return {
-            options: [], // 顶部下拉框选项
             categoryList: [], // 类型列表
             categoryList: [], // 类型列表
             dialogVisible: false,
             dialogVisible: false,
             loadingFull: false,
             loadingFull: false,
@@ -107,7 +107,7 @@ export default {
                 page_index: 1,
                 page_index: 1,
                 page_size: 10,
                 page_size: 10,
                 search: '',
                 search: '',
-                search_type: ''
+                type: ''
             },
             },
             rules: {
             rules: {
                 title: [
                 title: [
@@ -217,18 +217,11 @@ export default {
         },
         },
         // 获取分类列表
         // 获取分类列表
         async getCategory() {
         async getCategory() {
-            this.options = []
             try {
             try {
                 const res = await noticeCategory()
                 const res = await noticeCategory()
                 const { message, code, data } = res
                 const { message, code, data } = res
                 if (code === 200) {
                 if (code === 200) {
                     this.categoryList = data
                     this.categoryList = data
-                    for (let i = 0; i < data.length; i++) {
-                        for (let j = 0; j < data[i].children.length; j++) {
-                            this.options.push({ label: data[i].children[j].name, value: data[i].children[j].id })
-                        }
-                    }
-                    console.log(data, 111)
                 } else {
                 } else {
                     this.$message.error(message)
                     this.$message.error(message)
                 }
                 }
@@ -263,14 +256,11 @@ export default {
         },
         },
         reset() {
         reset() {
             this.ruleForm = {
             this.ruleForm = {
-                name: '',
-                company_id: '',
-                img: '',
-                industry: '',
-                degree: '',
-                introduction: '',
-                type: '',
-                is_research: ''
+                title: '',
+                time: '',
+                source: '',
+                content: '',
+                type: ''
             }
             }
         },
         },
         // 编辑或者添加人才信息
         // 编辑或者添加人才信息
@@ -315,8 +305,8 @@ export default {
             this.$refs[formName].validate((valid) => {
             this.$refs[formName].validate((valid) => {
                 if (valid) {
                 if (valid) {
                     const http = this.isEdit ? editNotice : addNotice
                     const http = this.isEdit ? editNotice : addNotice
-                    const { name, company_id, img, industry, degree, introduction, type, is_research } = this.ruleForm
-                    const data = this.isEdit ? { name, company_id, img, industry, degree, introduction, type, is_research, id: this.id } : this.ruleForm
+                    const { title, time, content, source, type } = this.ruleForm
+                    const data = this.isEdit ? { title, time, content, source, type, id: this.id } : this.ruleForm
                     http(data).then(res => {
                     http(data).then(res => {
                         if (res.code === 200) {
                         if (res.code === 200) {
                             this.$message.success(this.isEdit ? '修改成功!' : '添加成功!')
                             this.$message.success(this.isEdit ? '修改成功!' : '添加成功!')

+ 13 - 10
src/views/workstation/workstation.vue

@@ -3,9 +3,12 @@
     <div class="content">
     <div class="content">
         <div v-loading.fullscreen.lock="loadingFull" />
         <div v-loading.fullscreen.lock="loadingFull" />
         <div class="search_box flexS">
         <div class="search_box flexS">
-            <el-select v-model="params.search_type" placeholder="工作站类型" class="select" @change="toSearch()">
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
+            <div v-for="(item, idx) in categoryList" :key="idx">
+                <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()"
+                    clearable @clear="toSearch()">
+                    <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+            </div>
             <el-input v-model="params.search" clearable placeholder="工作站名称" prefix-icon="el-icon-search"
             <el-input v-model="params.search" clearable placeholder="工作站名称" prefix-icon="el-icon-search"
                 @keyup.enter.native="toSearch()" @clear="toSearch()" />
                 @keyup.enter.native="toSearch()" @clear="toSearch()" />
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
             <el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
@@ -39,12 +42,11 @@
                 </el-form-item>
                 </el-form-item>
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                 <el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
                     <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
                     <el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
-                        @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)" :style="{ width: '300px' }"
-                        filterable clearableruleFormruleForm style="width:300px">
+                        :style="{ width: '300px' }" filterable clearableruleFormruleForm style="width:300px">
                         <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
                         <el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
                             <span style="float: left" class="span-style">{{ temp.name }}</span>
                             <span style="float: left" class="span-style">{{ temp.name }}</span>
-                            <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
-                                <i class="el-icon-delete" /></span>
+                            <!-- <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
+                                <i class="el-icon-delete" /></span> -->
                             <span style="float: right;margin-left:5px;" class="span-style"
                             <span style="float: right;margin-left:5px;" class="span-style"
                                 @click.stop="editItem(item.id, 1, temp, i)">
                                 @click.stop="editItem(item.id, 1, temp, i)">
                                 <i class="el-icon-edit-outline" />
                                 <i class="el-icon-edit-outline" />
@@ -111,7 +113,7 @@ export default {
                 page_index: 1,
                 page_index: 1,
                 page_size: 10,
                 page_size: 10,
                 search: '',
                 search: '',
-                search_type: ''
+                type: ''
             },
             },
             rules: {
             rules: {
                 name: [
                 name: [
@@ -222,6 +224,7 @@ export default {
         },
         },
         // 下拉时显示底下的新增按钮
         // 下拉时显示底下的新增按钮
         visibleChange(visible, refName, fid) {
         visibleChange(visible, refName, fid) {
+
             if (visible) {
             if (visible) {
                 const ref = this.$refs[refName][0];
                 const ref = this.$refs[refName][0];
                 let product = ref.$refs.popper;
                 let product = ref.$refs.popper;
@@ -236,9 +239,9 @@ export default {
                     el.style =
                     el.style =
                         "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
                         "border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
                     el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
                     el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
-              <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增公告</span>
+              <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增</span>
               </li>`;
               </li>`;
-                    product.appendChild(el);
+
                     // 新增按钮点击事件
                     // 新增按钮点击事件
                     el.onclick = () => {
                     el.onclick = () => {
                         this.addItem(fid, 0);
                         this.addItem(fid, 0);

+ 5 - 5
vue.config.js

@@ -30,11 +30,11 @@ module.exports = {
   },
   },
   pwa: {
   pwa: {
     iconPaths: {
     iconPaths: {
-      favicon32: 'favicon.ico',
-      favicon16: 'favicon.ico',
-      appleTouchIcon: 'favicon.ico',
-      maskIcon: 'favicon.ico',
-      msTileImage: 'favicon.ico'
+      favicon32: '',
+      favicon16: '',
+      appleTouchIcon: '',
+      maskIcon: '',
+      msTileImage: ''
     }
     }
   },
   },
   configureWebpack: {
   configureWebpack: {