Explorar el Código

Merge branch 'developer' of http://git.caimei365.com/chao/caimei365-manager-ui into developer

zhengjinyi hace 3 años
padre
commit
4718df8237

+ 2 - 1
.env.development

@@ -2,6 +2,7 @@
 ENV = 'development'
 
 # base api
-VUE_APP_BASE_API = 'http://192.168.2.75:18015'
+# VUE_APP_BASE_API = 'http://192.168.2.75:18015'
+VUE_APP_BASE_API = 'http://localhost:18015'
 # 图片上传,索引更新等
 VUE_APP_CORE_API = 'https://core-b.caimei365.com'

+ 16 - 3
package-lock.json

@@ -6886,6 +6886,11 @@
       "version": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1",
       "from": "git://github.com/adobe-webplatform/eve.git#eef80ed"
     },
+    "eve-raphael": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmjs.org/eve-raphael/-/eve-raphael-0.5.0.tgz",
+      "integrity": "sha1-F8dUt5K+7z+maE15z1pHxjxM2jA="
+    },
     "event-pubsub": {
       "version": "4.3.0",
       "resolved": "https://registry.npmjs.org/event-pubsub/-/event-pubsub-4.3.0.tgz",
@@ -13906,10 +13911,11 @@
       "dev": true
     },
     "raphael": {
-      "version": "git+https://github.com/nhn/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0",
-      "from": "git+https://github.com/nhn/raphael.git#2.2.0-c",
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/raphael/-/raphael-2.3.0.tgz",
+      "integrity": "sha512-w2yIenZAQnp257XUWGni4bLMVxpUpcIl7qgxEgDIXtmSypYtlNxfXWpOBxs7LBTps5sDwhRnrToJrMUrivqNTQ==",
       "requires": {
-        "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed"
+        "eve-raphael": "0.5.0"
       }
     },
     "raw-body": {
@@ -16600,6 +16606,13 @@
         "tui-code-snippet": "^2.3.1"
       },
       "dependencies": {
+        "raphael": {
+          "version": "git+https://github.com/nhn/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0",
+          "from": "git+https://github.com/nhn/raphael.git#2.2.0-c",
+          "requires": {
+            "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed"
+          }
+        },
         "tui-code-snippet": {
           "version": "2.3.3",
           "resolved": "https://registry.npmjs.org/tui-code-snippet/-/tui-code-snippet-2.3.3.tgz",

+ 1 - 0
package.json

@@ -31,6 +31,7 @@
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
+    "raphael": "^2.3.0",
     "screenfull": "4.2.0",
     "script-loader": "0.7.2",
     "sortablejs": "1.8.4",

+ 0 - 0
src/api/caimei/finance.js → src/api/caimei/finance/receipt-user.js


+ 23 - 0
src/api/caimei/finance/receipt.js

@@ -0,0 +1,23 @@
+import request from '@/utils/request'
+
+export function fetchList(query) {
+  return request({
+    url: '/finance/receipt/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getReceiptType() {
+  return request({
+    url: '/finance/receipt/type',
+    method: 'get'
+  })
+}
+
+export function getReceipt(id) {
+  return request({
+    url: '/finance/receipt/' + id,
+    method: 'get'
+  })
+}

+ 25 - 2
src/router/modules/finance.js

@@ -11,7 +11,30 @@ const financeRouter = {
     {
       path: 'receipt',
       component: () => import('@/views/finance/index'),
-      redirect: '/finance/receipt/users',
+      redirect: '/finance/receipt/list',
+      name: 'ReceiptManage',
+      meta: { title: '收款列表', icon: 'documentation' },
+      children: [
+        {
+          path: 'list',
+          hidden: true,
+          component: () => import('@/views/finance/receipt/list.vue'),
+          name: 'ReceiptList',
+          meta: { title: '收款列表' }
+        },
+        {
+          path: 'detail',
+          hidden: true,
+          component: () => import('@/views/finance/receipt/detail.vue'),
+          name: 'ReceiptDetail',
+          meta: { title: '收款详情', noCache: true }
+        }
+      ]
+    },
+    {
+      path: 'receipts',
+      component: () => import('@/views/finance/index'),
+      redirect: '/finance/receipts/users',
       name: 'ReceiptUserManage',
       meta: { title: '收款人权限', icon: 'documentation' },
       children: [
@@ -20,7 +43,7 @@ const financeRouter = {
           hidden: true,
           component: () => import('@/views/finance/receipt/users.vue'),
           name: 'ReceiptUserList',
-          meta: { title: '收款人列表' }
+          meta: { title: '收款人权限' }
         },
         {
           path: 'user/edit',

+ 1 - 1
src/utils/request.js

@@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth'
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 5000 // request timeout
+  timeout: 10000 // request timeout
 })
 
 // request interceptor

+ 40 - 0
src/views/finance/receipt/detail.vue

@@ -0,0 +1,40 @@
+<template>
+  <div class="app-container">
+    <p>敬请期待...</p>
+  </div>
+</template>
+
+<script>
+import { getReceipt, getReceiptType } from '@/api/caimei/finance/receipt'
+export default {
+  name: 'ReceiptDetail',
+  data() {
+    return {
+      payTypeOptions: [],
+      receipt: {}
+    }
+  },
+  created() {
+    this.getType()
+    this.getReceipt()
+  },
+  methods: {
+    getType() {
+      getReceiptType().then(response => {
+        this.payTypeOptions = response.data
+      })
+    },
+    getReceipt() {
+      if (this.$route.query.id) {
+        getReceipt(this.$route.query.id).then(response => {
+          this.receipt = response.data
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 267 - 0
src/views/finance/receipt/list.vue

@@ -0,0 +1,267 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input v-model="listQuery.id" placeholder="收款ID" class="filter-item" />
+      <el-input v-model="listQuery.orderId" placeholder="订单ID" class="filter-item" />
+      <el-input v-model="listQuery.orderNo" placeholder="订单编号" class="filter-item" />
+      <el-input v-model="listQuery.userName" placeholder="客户名称" class="filter-item" />
+      <el-select v-model="listQuery.payWay" placeholder="收款方式" class="filter-item">
+        <el-option v-for="item in payWayOptions" :key="item.id" :label="item.type" :value="item.id" />
+      </el-select>
+      <el-select v-model="listQuery.receiptType" placeholder="收款类别" class="filter-item">
+        <el-option v-for="item in receiptTypeOptions" :key="item.id" :label="item.type" :value="item.id" />
+      </el-select>
+      <el-select v-model="listQuery.receiptStatus" placeholder="收款状态" class="filter-item">
+        <el-option v-for="item in receiptStatusOptions" :key="item.id" :label="item.type" :value="item.id" />
+      </el-select>
+      <el-select v-model="listQuery.payType" placeholder="收款账号" class="filter-item">
+        <el-option v-for="item in payTypeOptions" :key="item.id" :label="item.type" :value="item.id" />
+      </el-select>
+      <el-select v-model="listQuery.receiptProgress" placeholder="收款进度" class="filter-item">
+        <el-option label="收款进度" value="" />
+        <el-option label="待收" value="1" />
+        <el-option label="部分收" value="2" />
+        <el-option label="全收" value="2" />
+      </el-select>
+      <el-select v-model="listQuery.receiptOrderType" placeholder="订单类型" class="filter-item">
+        <el-option v-for="item in orderTypeOptions" :key="item.id" :label="item.type" :value="item.id" />
+      </el-select>
+      <el-select v-model="listQuery.associationNum" placeholder="关联数量" class="filter-item">
+        <el-option label="关联数量" value="" />
+        <el-option label="单个" value="1" />
+        <el-option label="多个" value="2" />
+      </el-select>
+      <el-select v-model="listQuery.organizeId" placeholder="组织" class="filter-item">
+        <el-option label="组织" value="" />
+        <el-option label="采美" value="0" />
+        <el-option label="呵呵商城" value="9999" />
+        <el-option label="维沙" value="3" />
+      </el-select>
+      <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
+        查询
+      </el-button>
+      <el-button class="filter-item" type="primary" icon="el-icon-document" @click="handleDownload">
+        导出Excel
+      </el-button>
+    </div>
+    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width:100%">
+      <el-table-column label="序号" align="center" width="50">
+        <template slot-scope="scope">{{ scope.$index + 1 }}</template>
+      </el-table-column>
+      <el-table-column label="收款ID" align="center">
+        <template slot-scope="{row}">{{ row.id }}</template>
+      </el-table-column>
+      <el-table-column label="收款时间" align="center">
+        <template slot-scope="{row}">{{ row.receiptDate }}</template>
+      </el-table-column>
+      <el-table-column label="金额(¥)" align="center">
+        <template slot-scope="{row}">{{ row.receiptAmount }}</template>
+      </el-table-column>
+      <el-table-column label="收款方式" align="center">
+        <template slot-scope="{row}">
+          <span v-text="getPayWayText(row.payWay)" />
+        </template>
+      </el-table-column>
+      <el-table-column label="款项类别" align="center">
+        <template slot-scope="{row}">
+          <span v-text="getReceiptTypeText(row.receiptType)" />
+        </template>
+      </el-table-column>
+      <el-table-column label="收款账号" align="center">
+        <template slot-scope="{row}">
+          <span v-text="getPayTypeText(row.payType)" />
+        </template>
+      </el-table-column>
+      <el-table-column label="收款状态" align="center">
+        <template slot-scope="{row}">
+          <span v-text="getReceiptStatusText(row.receiptStatus)" />
+        </template>
+      </el-table-column>
+      <el-table-column label="机构名称" align="center">
+        <template slot-scope="{row}">
+          {{ row.userName }}
+          <span v-if="row.suffix" style="color:red;">({{ row.suffix }})</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单类型" align="center">
+        <template slot-scope="{row}">
+          <span v-text="getOrderTypeText(row.orderType)" />
+        </template>
+      </el-table-column>
+      <el-table-column label="关联订单号" align="center">
+        <template slot-scope="{row}">{{ row.orders }}</template>
+      </el-table-column>
+      <el-table-column label="操作" width="150" align="center">
+        <template slot-scope="{row}">
+          <el-button size="mini" type="primary" @click="handleDetail(row)">查看详情</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
+
+  </div>
+</template>
+
+<script>
+import { fetchList, getReceiptType } from '@/api/caimei/finance/receipt'
+import { parseTime } from '@/utils'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'ReceiptList',
+  components: { Pagination },
+  data() {
+    return {
+      tableKey: 0,
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        pageNum: 1,
+        pageSize: 20,
+        id: '',
+        orderId: '',
+        orderNo: '',
+        userName: '',
+        payWay: '',
+        receiptType: '',
+        receiptStatus: '',
+        payType: '',
+        receiptProgress: '',
+        receiptOrderType: '',
+        associationNum: '',
+        organizeId: ''
+      },
+      payTypeOptions: [{ id: '', type: '收款账号' }],
+      payWayOptions: [
+        { id: '', type: '收款方式' },
+        { id: '1', type: '线上' },
+        { id: '2', type: '线下' },
+        { id: '3', type: '余额抵扣' }
+      ],
+      receiptTypeOptions: [
+        { id: '', type: '款项类别' },
+        { id: '1', type: '订单款' },
+        { id: '2', type: '非订单款' },
+        { id: '3', type: '返佣款' },
+        { id: '5', type: '供应商退款' },
+        { id: '6', type: '超级会员款' },
+        { id: '7', type: '二手商品上架费' }
+      ],
+      receiptStatusOptions: [
+        { id: '', type: '收款状态' },
+        { id: '1', type: '待确认' },
+        { id: '2', type: '已确认' },
+        { id: '3', type: '审核通过' },
+        { id: '4', type: '审核未通过' },
+        { id: '5', type: '收款撤销' }
+      ],
+      orderTypeOptions: [
+        { id: '', type: '订单类型' },
+        { id: '0', type: '协销' },
+        { id: '1', type: '自主' },
+        { id: '2', type: '呵呵' }
+      ]
+    }
+  },
+  created() {
+    this.getType()
+    this.getList()
+  },
+  methods: {
+    handleFilter() {
+      this.listQuery.pageNum = 1
+      this.getList()
+    },
+    getList() {
+      this.listLoading = true
+      fetchList(this.listQuery).then(response => {
+        this.listLoading = false
+        this.list = response.data.results
+        this.total = response.data.totalRecord
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoading = false
+        }, 1.5 * 1000)
+      })
+    },
+    getType() {
+      getReceiptType().then(response => {
+        this.payTypeOptions = response.data
+        this.payTypeOptions.unshift({ id: '', type: '收款账号' })
+      })
+    },
+    getOptionText(id, options) {
+      let text = ''
+      options.forEach(item => {
+        if (item.id === id) {
+          text = item.type
+        }
+      })
+      return text
+    },
+    getPayTypeText(id) {
+      return this.getOptionText(id, this.payTypeOptions)
+    },
+    getPayWayText(id) {
+      return this.getOptionText(id, this.payWayOptions)
+    },
+    getReceiptTypeText(id) {
+      return this.getOptionText(id, this.receiptTypeOptions)
+    },
+    getReceiptStatusText(id) {
+      return this.getOptionText(id, this.receiptStatusOptions)
+    },
+    getOrderTypeText(id) {
+      return this.getOptionText(id, this.orderTypeOptions)
+    },
+    handleDetail(row) {
+      this.$router.push({ path: '/finance/receipt/detail', query: { id: row.id }})
+    },
+    handleDownload() {
+      this.downloadLoading = true
+      import('@/vendor/Export2Excel').then(excel => {
+        // 序号	进账时间	金额(¥)	进账方式	款项类别	进账账号 状态	订单类型	关联订单号	订单ID	运费	税费	订单金额(¥)	关联金额
+        const tHeader = ['Id', '进账时间', '金额(¥)', '进账方式', '款项类别', '进账账号', '状态', '订单类型', '关联订单号', '订单ID', '运费', '税费', '订单金额(¥)', '关联金额', '备注']
+        const filterVal = ['id', 'receiptDate', 'receiptAmount', 'payWay', 'receiptType', 'payType', 'receiptStatus', 'orderType', 'orders', 'orderId', 'freight', 'orderTax', 'orderFee', 'associateAmount', 'noOrderReason']
+        const list = this.list
+        const data = this.formatJson(filterVal, list)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data,
+          filename: '收款列表',
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+        this.downloadLoading = false
+      })
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v => filterVal.map(j => {
+        if (j === 'receiptDate') {
+          return parseTime(v[j])
+        } else if (j === 'payType') {
+          return this.getPayTypeText(v[j])
+        } else if (j === 'payWay') {
+          return this.getPayWayText(v[j])
+        } else if (j === 'receiptType') {
+          return this.getReceiptTypeText(v[j])
+        } else if (j === 'receiptStatus') {
+          return this.getReceiptStatusText(v[j])
+        } else if (j === 'orderType') {
+          return this.getOrderTypeText(v[j])
+        } else {
+          return v[j]
+        }
+      }))
+    }
+  }
+}
+</script>
+
+<style scoped>
+.filter-item{
+  width: 120px;
+  margin-right: 15px;
+}
+</style>

+ 1 - 1
src/views/finance/receipt/user.vue

@@ -39,7 +39,7 @@
 </template>
 
 <script>
-import { getUser, updateUser, createUser, fetchPermissionList } from '@/api/caimei/finance'
+import { getUser, updateUser, createUser, fetchPermissionList } from '@/api/caimei/finance/receipt-user'
 
 const defaultUser = {
   id: '',

+ 5 - 5
src/views/finance/receipt/users.vue

@@ -6,7 +6,7 @@
       </el-button>
     </div>
     <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width:100%">
-      <el-table-column label="序号" align="center" width="30">
+      <el-table-column label="序号" align="center" width="60">
         <template slot-scope="scope">{{ scope.$index + 1 }}</template>
       </el-table-column>
       <el-table-column label="姓名" align="center">
@@ -18,7 +18,7 @@
       <el-table-column label="用户类型" align="center">
         <template slot-scope="scope">{{ scope.row.userTypeText }}</template>
       </el-table-column>
-      <el-table-column label="微信openid" align="center">
+      <el-table-column label="收款小程序openid" align="center">
         <template slot-scope="scope">{{ scope.row.openid }}</template>
       </el-table-column>
       <el-table-column label="用户权限" align="center" min-width="180">
@@ -37,7 +37,7 @@
 </template>
 
 <script>
-import { fetchList, deleteUser } from '@/api/caimei/finance'
+import { fetchList, deleteUser } from '@/api/caimei/finance/receipt-user'
 
 export default {
   name: 'ReceiptUserList',
@@ -68,10 +68,10 @@ export default {
       })
     },
     handleCreate() {
-      this.$router.push({ path: '/finance/receipt/user/add' })
+      this.$router.push({ path: '/finance/receipts/user/add' })
     },
     handleUpdate(row) {
-      this.$router.push({ path: '/finance/receipt/user/edit', query: { id: row.id }})
+      this.$router.push({ path: '/finance/receipts/user/edit', query: { id: row.id }})
     },
     handleDelete(row) {
       this.$confirm('是否要删除该收款用户', '提示', {

+ 1 - 1
src/views/product/classify/form.vue

@@ -6,7 +6,7 @@
 
 <script>
 export default {
-  name: 'WebPageEdit',
+  name: 'ClassifyEdit',
   data() {
     return {
     }

+ 1 - 1
src/views/product/classify/list.vue

@@ -6,7 +6,7 @@
 
 <script>
 export default {
-  name: 'WebPageList',
+  name: 'ClassifyList',
   data() {
     return {
     }

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

@@ -6,7 +6,7 @@
 
 <script>
 export default {
-  name: 'WebPageEdit',
+  name: 'ProductEdit',
   data() {
     return {
     }

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

@@ -6,7 +6,7 @@
 
 <script>
 export default {
-  name: 'WebPageList',
+  name: 'ProductList',
   data() {
     return {
     }

+ 2 - 2
src/views/sys/login/index.vue

@@ -136,8 +136,8 @@ export default {
             .dispatch('user/login', this.loginForm)
             .then(() => {
               this.$router.push({
-                // path: this.redirect || '/',
-                path: '/profile/index',
+                path: this.redirect || '/profile/index',
+                // path: '/profile/index',
                 query: this.otherQuery
               })
               this.loading = false