Forráskód Böngészése

始宁农业管理后台:农户管理

panyong 1 éve
szülő
commit
a4c8eaa000

+ 1 - 1
htmldev/shiningManage/config/dev.env.js

@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  API_DOMAIN: '"http://swago-admin.codedreamit.com"'
+  API_DOMAIN: '"http://shining-admin.codedreamit.com"'
 })

+ 1 - 1
htmldev/shiningManage/config/prod.env.js

@@ -2,5 +2,5 @@
 
 module.exports = {
   NODE_ENV: '"production"',
-  API_DOMAIN: '"http://swago-admin.codedreamit.com"'
+  API_DOMAIN: '""'
 }

+ 0 - 39
htmldev/shiningManage/src/mixin/downloadExcel.js

@@ -1,4 +1,3 @@
-// import axios from 'axios'
 import qs from 'qs'
 
 export default {
@@ -15,43 +14,5 @@ export default {
       a.href = href
       a.click()
     }
-    /**
-     *
-     downloadExcel() {
-      this.isDownload = true
-      axios({
-        method: 'GET',
-        url: this.exportUrl,
-        params: {
-          ...this.searchForm
-        },
-        responseType: 'blob',
-        headers: { 'Content-Type': 'application/json; application/octet-stream' },
-        timeout: 180000
-      }).then(res => {
-        if (res.status === 200) {
-          // 构造一个blob对象来处理数据,并设置文件类型
-          const blob = new Blob([res.data], { type: 'text/csv' })
-          if (window.navigator.msSaveOrOpenBlob) { // 兼容IE10
-            navigator.msSaveBlob(blob, this.filename + '.csv')
-          } else {
-            const href = URL.createObjectURL(blob) // 创建新的URL表示指定的blob对象
-            const a = document.createElement('a') // 创建a标签
-            a.style.display = 'none'
-            a.href = href // 指定下载链接
-            a.download = this.filename + '.csv' // 指定下载文件名
-            a.click() //触发下载
-            URL.revokeObjectURL(a.href) // 释放URL对象
-          }
-        } else {
-          this.$message.error('下载出错,请联系管理员')
-        }
-        this.isDownload = false
-      }).catch(err => {
-        this.isDownload = false
-        console.log(err)
-      })
-    }
-     */
   }
 }

+ 3 - 18
htmldev/shiningManage/src/mixin/page.js

@@ -11,11 +11,6 @@ export default {
     vheight() {
       return document.body.clientHeight - 280
     },
-    // 是否有total_price字段
-    hasTotalPrice() {
-      const arrTableUrl = ['/v1/finance/coin/log', '/v1/finance/recharge/log', '/v1/finance/crash/log/list', '/v1/finance/diamond/log']
-      return arrTableUrl.findIndex(item => item === this.tableUrl) > -1
-    },
     isPC() {
       return this.$store.state.app.isPC
     }
@@ -27,11 +22,10 @@ export default {
           this.searchForm[key] = undefined
         }
       })
-      if (this.tableUrl === '/v1/finance/apply/list') {
-        this.isApplyAll = true
-      }
+
       this.tableLoading = true
-      const api = (/^\/v1/.test(this.tableUrl) ? '' : '/api/auth') + this.tableUrl
+
+      const api = (/^\/api/.test(this.tableUrl) ? '' : '/api/auth') + this.tableUrl
       const { code, data } = await this.$fetch(api, {
         page: this.page,
         page_size: this.page_size,
@@ -41,15 +35,6 @@ export default {
       if (this.tableData && code === 200 && data && (Array.isArray(data) || Array.isArray(data.data) || Array.isArray(data.list))) {
         this.tableData = data.data || data.list || data
         this.totalCount = Number(data.total || data.count)
-        if (this.hasTotalPrice) {
-          this.total_price = data.total_price
-        }
-        if (this.tableUrl === '/v1/finance/apply/list' && this.searchForm.apply_status === 1 && this.tableData.length > 0) {
-          this.isApplyAll = false
-        }
-        if (this.tableUrl === '/v1/setting/game/slot/element/list') {
-          this.$store.dispatch('common/fetchSlotsElement')
-        }
 
         this.pageCallBack && this.pageCallBack(data)
       }

+ 7 - 7
htmldev/shiningManage/src/router/modules/businessManage.js

@@ -1,20 +1,20 @@
 /**
- * 系统设置 system setting
+ * 农户管理
  */
 import Layout from '@/layout'
 
-const sys = {
+const businessManage = {
   path: '/businessManage',
   component: Layout,
-  redirect: '/businessManage',
+  redirect: '/businessManage/business',
   alwaysShow: true,
   name: 'businessManage',
   meta: { title: '农户管理', icon: 'el-icon-s-shop' },
   children: [
     {
-      path: 'apply',
-      name: 'businessManageApply',
-      component: () => import('@/views/businessManage/apply/index'),
+      path: 'toBeReviewed',
+      name: 'businessManageToBeReviewed',
+      component: () => import('@/views/businessManage/toBeReviewed/index'),
       meta: { title: '入驻申请' }
     },
     {
@@ -26,4 +26,4 @@ const sys = {
   ]
 }
 
-export default sys
+export default businessManage

+ 24 - 5
htmldev/shiningManage/src/router/modules/productManage.js

@@ -1,16 +1,35 @@
 /**
- * 系统设置 system setting
+ * 农产品管理
  */
 import Layout from '@/layout'
 
-const sys = {
+const productManage = {
   path: '/productManage',
   component: Layout,
-  redirect: '/productManage',
+  redirect: '/productManage/products',
   alwaysShow: true,
   name: 'productManage',
   meta: { title: '农产品管理', icon: 'el-icon-goods' },
-  children: []
+  children: [
+    {
+      path: 'toBeReviewed',
+      name: 'productManageToBeReviewed',
+      component: () => import('@/views/productManage/toBeReviewed/index'),
+      meta: { title: '上架申请' }
+    },
+    {
+      path: 'products',
+      name: 'productManageProducts',
+      component: () => import('@/views/productManage/products/index'),
+      meta: { title: '农产品管理' }
+    },
+    {
+      path: 'recommend',
+      name: 'productManageRecommend',
+      component: () => import('@/views/productManage/recommend/index'),
+      meta: { title: '优秀产品管理' }
+    }
+  ]
 }
 
-export default sys
+export default productManage

+ 1 - 1
htmldev/shiningManage/src/router/modules/sys.js

@@ -9,7 +9,7 @@ const sys = {
   redirect: '/sys/project/list',
   alwaysShow: true,
   name: 'sys',
-  meta: { title: '系统设置', icon: 'el-icon-setting', roleValue: 'sys_set' },
+  meta: { title: '系统设置', icon: 'el-icon-setting'},
   children: [
     {
       path: 'project/list',

+ 255 - 0
htmldev/shiningManage/src/views/businessManage/business/details.vue

@@ -0,0 +1,255 @@
+<template>
+  <div>
+    <el-dialog
+      :title="exData.id ? '编辑': '新增'"
+      :visible.sync="dialog"
+      width="900px"
+      :close-on-click-modal="false"
+      top="50px">
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="formRules"
+        label-width="120px">
+        <el-form-item
+          prop="rotation_name"
+          :rules="formRules.required"
+          label="农户姓名:">
+          <el-input v-model="form.rotation_name"
+                    placeholder="请输入农户姓名"
+                    clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="rotation_name"
+          :rules="formRules.required"
+          label="身份证号:">
+          <el-input v-model="form.rotation_name"
+                    placeholder="请输入身份证号"
+                    clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="sort_id"
+          :rules="formRules.required"
+          label="手机号:">
+          <el-input v-model="form.sort_id"
+                    placeholder="请输入手机号"
+                    clearable
+                    @input="form.sort_id = form.sort_id.replace(/[^\d]$/, '').replace(/^0\d/, '')"></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="rotation_name"
+          :rules="formRules.required"
+          label="村信息:">
+          <el-input v-model="form.rotation_name"
+                    placeholder="请输入村信息"
+                    clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="rotation_name"
+          :rules="formRules.required"
+          label="微信号:">
+          <el-input v-model="form.rotation_name"
+                    placeholder="请输入微信号"
+                    clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          prop="rotation_img_url"
+          :rules="formRules.uploadImgs"
+          label="个人二维码:">
+          <el-upload
+            :on-remove="handleRemove"
+            :on-success="handleAvatarSuccess"
+            :before-upload="beforeAvatarUpload"
+            :on-exceed="hadnleExceed"
+            :accept="'image/*'"
+            :limit="1"
+            :file-list="fileList"
+            list-type="picture-card"
+            action="/api/admin/v1/upload/file"
+            multiple>
+            <i class="el-icon-plus"></i>
+            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5M</div>
+          </el-upload>
+        </el-form-item>
+        <el-form-item
+          prop="rotation_name"
+          :rules="formRules.required"
+          label="详细地址:">
+          <el-input v-model="form.rotation_name"
+                    placeholder="请输入详细地址"
+                    clearable></el-input>
+        </el-form-item>
+        <el-form-item
+          label="备注:"
+          prop="rotation_url"
+          v-show="form.rotation_link_type !== 1">
+          <el-input type="textarea"
+                    :rows="4"
+                    placeholder="上限200字符"
+                    maxlength="200"
+                    show-word-limit
+                    v-model="form.rotation_url">
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer text-center">
+        <el-button @click="dialog = false">取 消</el-button>
+        <el-button type="primary" :disabled="booLock" @click="handleSubmit">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { yuan2Fen, fen2Yuan } from '@/utils'
+
+export default {
+  props: {
+    value: {
+      type: Boolean,
+      default: true
+    },
+    exData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data() {
+    return {
+      dialog: !!this.value,
+      form: {
+        'rotation_img_url': [], // 轮播图片地址
+        'rotation_status': '', // 轮播图状态(0无效1有效)
+        'rotation_url': '', // 链接
+        'rotation_name': '', // 轮播图名称
+        'sort_id': '', // 排序ID
+        'rotation_type': '', // 轮播类型(1首页2直播间)
+        'rotation_channel': '', // 应用包
+        'rotation_link_type': ''
+      },
+      fileList: [],
+      booLock: false
+    }
+  },
+  computed: {
+    arrRotationType() {
+      return []
+    },
+    arrRotationStatus() {
+      return []
+    },
+    rotationChannelList() {
+      return []
+    },
+    arrRotationLinkType() {
+      return []
+    }
+  },
+  methods: {
+    beforeAvatarUpload(file) {
+      const isLt2M = file.size / 1024 / 1024 < 5
+      if (!isLt2M) {
+        this.$message.error('上传图片大小不能超过 5MB!')
+      }
+      return isLt2M
+    },
+    handleRemove(file) {
+      let path = file.url
+      if (file.response && file.response.data) {
+        path = file.response.data.path
+      }
+      this.form.rotation_img_url = this.form.rotation_img_url.filter(item => item !== path)
+    },
+    handleAvatarSuccess(res) {
+      if (res.code === 200) {
+        const { path } = res.data
+        this.form.rotation_img_url.push(path)
+      } else {
+        this.$message.error('图片上传失败')
+      }
+    },
+    hadnleExceed(files, fileList) {
+      this.$message({
+        message: '最多上传一张',
+        type: 'warning'
+      })
+    },
+    handleSubmit() {
+      const url = this.exData.id ? '/v1/setting/rotation/modify' : '/v1/setting/rotation/add'
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(this.form))
+          const postData = {
+            ...formData,
+            rotation_img_url: formData.rotation_img_url[0]
+          }
+          if (this.form.rotation_link_type === 1) {
+            postData.rotation_url = ''
+          }
+          this.booLock = true
+          const data = await this.$fetch(url, postData)
+          this.booLock = false
+          if (data.code === 200) {
+            this.$message.success('提交成功')
+            this.$emit('success')
+            this.dialog = false
+          }
+        }
+      })
+    }
+  },
+  mounted() {
+    if (this.exData.id) {
+      this.$set(this.form, 'id', this.exData.id)
+      this.fileList = [
+        {
+          name: '',
+          url: this.exData.rotation_img_url
+        }
+      ]
+      for (const key in this.exData) {
+        if (this.form.hasOwnProperty(key)) {
+          let value = this.exData[key]
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
+            if (key === 'rotation_img_url') {
+              value = [value]
+            }
+            if (key === 'sort_id') {
+              value = value.toString()
+            }
+            this.$set(this.form, key, value)
+          }
+        }
+      }
+    }
+  },
+  watch: {
+    dialog(val) {
+      if (!val) this.$emit('input', val)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.top-tip {
+  margin-top: -20px;
+  margin-bottom: 20px;
+}
+
+.af-put-line-radio {
+  display: flex;
+  align-items: center;
+
+  p.lalel {
+    padding: 0 10px;
+  }
+
+  p {
+    padding: 0;
+    margin: 0;
+  }
+}
+</style>

+ 133 - 0
htmldev/shiningManage/src/views/businessManage/business/index.vue

@@ -0,0 +1,133 @@
+<template>
+  <div class="padding-20">
+    <div class="search-box">
+      <el-form ref="form" :inline="true" :model="searchForm" clearable label-width="100px" class="mt-10">
+        <el-form-item label="姓名:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入姓名" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="手机号:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入手机号后4位" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="身份证:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入身份证后6位" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="申请时间:">
+          <el-date-picker
+            :editable="false"
+            v-model="time"
+            @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item class="ml-10">
+          <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table
+      :data="tableData"
+      stripe
+      v-loading="tableLoading"
+      fit
+      class="marginT-10 order-table"
+      border
+      :max-height="vheight">
+      <el-table-column label="农户姓名" prop="id"></el-table-column>
+      <el-table-column label="身份证号" prop="created_at"></el-table-column>
+      <el-table-column label="手机号" prop="department_name"></el-table-column>
+      <el-table-column label="村信息" prop="department_desc" show-overflow-tooltip></el-table-column>
+      <el-table-column label="微信号" prop="department_project_name" show-overflow-tooltip></el-table-column>
+      <el-table-column label="个人二维码" prop="department_project_name">
+        <template slot-scope="scope">
+          <el-image
+            style="display: block;width: 80px; height: 80px;font-size: 0;"
+            :src="scope.row.element_img_url"
+            :preview-src-list="[]">
+          </el-image>
+        </template>
+      </el-table-column>
+      <el-table-column label="详细地址" prop="department_project_name" show-overflow-tooltip></el-table-column>
+      <el-table-column label="备注" prop="department_project_name" show-overflow-tooltip></el-table-column>
+      <el-table-column label="申请时间" prop="department_project_name"></el-table-column>
+      <el-table-column label="状态" prop="department_project_name"></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" @click="edit(scope.row)">编辑</el-button>
+          <el-button type="text" @click="del(scope.row)">农户产品</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      class="marginT-20"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :hide-on-single-page="true"
+      :current-page="page"
+      :page-size="page_size"
+      :page-sizes="[10, 20, 100, 200, 300, 400]"
+      background
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="totalCount"/>
+    <detail
+      v-if="detailsDialog.show"
+      v-model="detailsDialog.show"
+      :exData="detailsDialog.exData"
+      @success="init"></detail>
+  </div>
+</template>
+
+<script>
+import page from '@/mixin/page'
+import detail from './details'
+
+export default {
+  mixins: [page],
+  components: {
+    detail
+  },
+  data() {
+    return {
+      detailsDialog: {
+        show: false,
+        exData: {}
+      },
+      time: [],
+      searchForm: {},
+      tableData: [],
+      tableUrl: '/department/list'
+    }
+  },
+  methods: {
+    add() {
+      this.detailsDialog.exData = {}
+      this.detailsDialog.show = true
+    },
+    edit(row) {
+      this.detailsDialog.exData = row
+      this.detailsDialog.show = true
+    },
+    del(row) {
+      this.$confirm('确定要删除吗', '确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const data = await this.$fetch('/api/auth/department/del', { id: row.id })
+        if (data.code == 200) {
+          this.$message.success('删除成功')
+          this.init()
+        }
+      }).catch(() => {})
+    }
+  },
+  mounted() {
+    this.init()
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 1 - 1
htmldev/shiningManage/src/views/businessManage/apply/details.vue → htmldev/shiningManage/src/views/businessManage/toBeReviewed/details.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-dialog
-      :title="exData.id ? '': '编辑'"
+      :title="exData.id ? '编辑': ''"
       :visible.sync="dialog"
       width="800px"
       :close-on-click-modal="false"

+ 2 - 2
htmldev/shiningManage/src/views/businessManage/apply/index.vue → htmldev/shiningManage/src/views/businessManage/toBeReviewed/index.vue

@@ -96,7 +96,7 @@ export default {
       time: [],
       searchForm: {},
       tableData: [],
-      tableUrl: '/department/list'
+      tableUrl: '/api/admin/shop/apply/list'
     }
   },
   methods: {
@@ -115,7 +115,7 @@ export default {
         type: 'warning'
       }).then(async () => {
         const data = await this.$fetch('/api/auth/department/del', { id: row.id })
-        if (data.code == 200) {
+        if (data.code === 200) {
           this.$message.success('删除成功')
           this.init()
         }

+ 13 - 0
htmldev/shiningManage/src/views/productManage/products/details.vue

@@ -0,0 +1,13 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  name: 'details'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
htmldev/shiningManage/src/views/productManage/products/index.vue

@@ -0,0 +1,13 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  name: 'index'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
htmldev/shiningManage/src/views/productManage/recommend/details.vue

@@ -0,0 +1,13 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  name: 'details'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
htmldev/shiningManage/src/views/productManage/recommend/index.vue

@@ -0,0 +1,13 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  name: 'index'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 132 - 0
htmldev/shiningManage/src/views/productManage/toBeReviewed/details.vue

@@ -0,0 +1,132 @@
+<template>
+  <div>
+    <el-dialog
+      :title="exData.id ? '编辑': ''"
+      :visible.sync="dialog"
+      width="800px"
+      :close-on-click-modal="false"
+      top="50px">
+      <el-form
+        ref="formOfForbid"
+        :rules="formRules"
+        :model="form"
+        label-width="120px">
+        <el-form-item
+          label="审核:"
+          prop="crash_status">
+          <el-radio-group v-model="form.crash_status">
+            <el-radio
+              :label="item.value"
+              v-for="item in statusOptions"
+              :key="item.value">{{ item.name }}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item
+          label="备注:"
+          prop="user_ids"
+          :rules="formRules.required">
+          <el-input
+            type="textarea"
+            :rows="6"
+            placeholder="请输入未通过理由"
+            v-model="form.user_ids"
+            maxlength="1000"
+            show-word-limit>
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" style="text-align: center">
+        <el-button @click="dialog = false">取 消</el-button>
+        <el-button type="primary" @click="handleSubmit" :disabled="booLock">保存</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    value: {
+      type: Boolean,
+      default: true
+    },
+    exData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data() {
+    return {
+      dialog: !!this.value,
+      form: {
+        user_ids: ''
+      },
+      booLock: false
+    }
+  },
+  computed: {
+    paymentInformationReviewStatus() {
+      // return this.$store.state.common.paymentInformationReviewStatus
+      return [
+        {
+          name: '通过',
+          value: '1'
+        },
+        {
+          name: '拒绝',
+          value: '2'
+        }
+      ]
+    },
+    statusOptions() {
+      return this.paymentInformationReviewStatus
+    }
+  },
+  methods: {
+    async handleSubmit() {
+      this.$refs.formOfForbid.validate(async valid => {
+        if (valid) {
+          this.booLock = true
+          const postData = {
+            user_ids: this.form.user_ids
+          }
+          const data = await this.$fetch('/v1/user/special/account/open', postData)
+          if (data.code === 200) {
+            this.dialog = false
+            this.$message.success('添加成功')
+            this.$emit('success')
+          } else if (data.code === 500) {
+            // 新增失败
+            this.$alert(data.msg, '提示', {
+              confirmButtonText: '确定',
+              type: 'error',
+              callback: action => {
+
+              }
+            })
+          }
+          this.booLock = false
+        }
+      })
+    }
+  },
+  mounted() {
+  },
+  watch: {
+    dialog(val) {
+      if (!val) this.$emit('input', val)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.hide-el-upload {
+  ::v-deep .el-upload--picture-card {
+    visibility: hidden;
+  }
+}
+</style>

+ 137 - 0
htmldev/shiningManage/src/views/productManage/toBeReviewed/index.vue

@@ -0,0 +1,137 @@
+<template>
+  <div class="padding-20">
+    <div class="search-box">
+      <el-form ref="form" :inline="true" :model="searchForm" clearable label-width="100px" class="mt-10">
+        <el-form-item label="姓名:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入姓名" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="手机号:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入手机号后4位" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="身份证:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入身份证后6位" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="申请时间:">
+          <el-date-picker
+            :editable="false"
+            v-model="time"
+            @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item class="ml-10">
+          <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table
+      :data="tableData"
+      stripe
+      v-loading="tableLoading"
+      fit
+      class="marginT-10 order-table"
+      border
+      :max-height="vheight">
+      <el-table-column label="农产品名字" prop="id"></el-table-column>
+      <el-table-column label="类型" prop="created_at"><!--(预售、现货)--></el-table-column>
+      <el-table-column label="批发价" prop="department_name"></el-table-column>
+      <el-table-column label="零售价" prop="department_desc" show-overflow-tooltip></el-table-column>
+      <el-table-column label="库存" prop="department_desc" show-overflow-tooltip></el-table-column>
+      <el-table-column label="申请人" prop="department_project_name" show-overflow-tooltip><!-- 农户编号、农户名字 --></el-table-column>
+
+      <el-table-column label="个人二维码" prop="department_project_name">
+        <template slot-scope="scope">
+          <el-image
+            style="display: block;width: 80px; height: 80px;font-size: 0;"
+            :src="scope.row.element_img_url"
+            :preview-src-list="[]">
+          </el-image>
+        </template>
+      </el-table-column>
+      <el-table-column label="详细地址" prop="department_project_name" show-overflow-tooltip></el-table-column>
+      <el-table-column label="备注" prop="department_project_name" show-overflow-tooltip></el-table-column>
+
+
+      <el-table-column label="申请时间" prop="department_project_name"></el-table-column>
+      <el-table-column label="审核状态" prop="department_project_name"></el-table-column>
+      <el-table-column label="审核人" prop="department_project_name"></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" @click="edit(scope.row)">操作</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      class="marginT-20"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :hide-on-single-page="true"
+      :current-page="page"
+      :page-size="page_size"
+      :page-sizes="[10, 20, 100, 200, 300, 400]"
+      background
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="totalCount"/>
+    <detail
+      v-if="detailsDialog.show"
+      v-model="detailsDialog.show"
+      :exData="detailsDialog.exData"
+      @success="init"></detail>
+  </div>
+</template>
+
+<script>
+import page from '@/mixin/page'
+import detail from './details'
+
+export default {
+  mixins: [page],
+  components: {
+    detail
+  },
+  data() {
+    return {
+      detailsDialog: {
+        show: false,
+        exData: {}
+      },
+      time: [],
+      searchForm: {},
+      tableData: [],
+      tableUrl: '/department/list'
+    }
+  },
+  methods: {
+    add() {
+      this.detailsDialog.exData = {}
+      this.detailsDialog.show = true
+    },
+    edit(row) {
+      this.detailsDialog.exData = row
+      this.detailsDialog.show = true
+    },
+    del(row) {
+      this.$confirm('确定要删除吗', '确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const data = await this.$fetch('/api/auth/department/del', { id: row.id })
+        if (data.code == 200) {
+          this.$message.success('删除成功')
+          this.init()
+        }
+      }).catch(() => {})
+    }
+  },
+  mounted() {
+    this.init()
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 2 - 2
htmldev/shiningManage/vue.config.js

@@ -34,14 +34,14 @@ module.exports = {
     // before: require('./mock/mock-server.js')
     proxy: {
       '/api/auth': {
-        target: 'http://swago-admin.codedreamit.com',
+        target: 'http://shining-admin.codedreamit.com',
         changeOrigin: true,
         pathRewrite: {
           '^/api/auth': '/api/auth'
         }
       },
       '/api/admin': {
-        target: 'http://swago-admin.codedreamit.com',
+        target: 'http://shining-admin.codedreamit.com',
         changeOrigin: true,
         pathRewrite: {
           '^/api/admin': '/api/admin'