瀏覽代碼

订单商品

zhengjinyi 1 年之前
父節點
當前提交
bed540ab77
共有 50 個文件被更改,包括 3432 次插入2668 次删除
  1. 2 2
      .env.development
  2. 32 0
      src/api/centralized.js
  3. 10 0
      src/api/club.js
  4. 82 14
      src/api/finance.js
  5. 58 5
      src/api/order.js
  6. 二進制
      src/assets/favicon.png
  7. 121 0
      src/components/UploadImage/index.vue
  8. 2 0
      src/components/index.js
  9. 23 0
      src/filters/index.js
  10. 9 2
      src/router/modules/finance.js
  11. 1 1
      src/router/modules/floor.js
  12. 24 3
      src/router/modules/order.js
  13. 9 0
      src/styles/index.scss
  14. 39 0
      src/utils/index.js
  15. 112 55
      src/views/campaign/activity-edit.vue
  16. 1 1
      src/views/campaign/activity-list.vue
  17. 33 14
      src/views/campaign/banner-edit.vue
  18. 13 4
      src/views/campaign/category-edit.vue
  19. 2 2
      src/views/campaign/components/activity/index.vue
  20. 5 5
      src/views/campaign/components/banner/index.vue
  21. 21 4
      src/views/campaign/components/category/index.vue
  22. 3 0
      src/views/campaign/components/good-dialog.vue
  23. 2 0
      src/views/campaign/components/good-multi-dialog.vue
  24. 6 6
      src/views/campaign/components/special/index.vue
  25. 21 16
      src/views/campaign/special-edit.vue
  26. 41 210
      src/views/centralized/details.vue
  27. 97 226
      src/views/centralized/list.vue
  28. 142 117
      src/views/club/list.vue
  29. 1 1
      src/views/finance/list.vue
  30. 378 0
      src/views/finance/payapply-edit.vue
  31. 155 198
      src/views/finance/payapply-list.vue
  32. 190 203
      src/views/finance/paycents-list.vue
  33. 174 462
      src/views/finance/payfinance-list.vue
  34. 18 188
      src/views/finance/payfinance-refund-record.vue
  35. 282 176
      src/views/finance/payment-details.vue
  36. 162 162
      src/views/finance/payment-list.vue
  37. 166 198
      src/views/finance/paysettle-list.vue
  38. 2 0
      src/views/floor/components/good-multi-dialog.vue
  39. 6 2
      src/views/floor/edit.vue
  40. 12 10
      src/views/goods/components/price-edit.vue
  41. 4 5
      src/views/goods/list.vue
  42. 361 0
      src/views/order/addLogistics.vue
  43. 149 0
      src/views/order/deliver-record.vue
  44. 168 0
      src/views/order/deliver.vue
  45. 99 31
      src/views/order/detail.vue
  46. 14 17
      src/views/order/list.vue
  47. 146 290
      src/views/order/refund-detail.vue
  48. 12 15
      src/views/order/refund-record.vue
  49. 12 13
      src/views/order/refund-return.vue
  50. 10 10
      src/views/order/refund.vue

+ 2 - 2
.env.development

@@ -4,8 +4,8 @@ ENV = 'development'
 # base api
 # VUE_APP_BASE_API = '/dev-api'
 # VUE_APP_BASE_API = 'http://192.168.1.22:9104'
-VUE_APP_BASE_API = 'http://192.168.2.67:9104'
-# VUE_APP_BASE_API = 'https://mai-b.caimei365.com'
+# VUE_APP_BASE_API = 'http://192.168.2.67:9104'
+VUE_APP_BASE_API = 'https://mai-b.caimei365.com'
 # VUE_APP_BASE_API = 'http://192.168.78.1:9104/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

+ 32 - 0
src/api/centralized.js

@@ -0,0 +1,32 @@
+import request from '@/utils/request'
+
+/**
+ * 集采列表
+ */
+export function getList(query) {
+  return request({
+    url: '/group/buy/buy/list',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ * 集采详情
+ */
+export function buyDetail(query) {
+  return request({
+    url: '/group/buy/detail',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ * 集采置为已完成
+ */
+export function buyDone(query) {
+  return request({
+    url: '/group/buy/done',
+    method: 'get',
+    params: query
+  })
+}

+ 10 - 0
src/api/club.js

@@ -10,6 +10,16 @@ export function addNewClub(query) {
     params: query
   })
 }
+/**
+ *审核机构
+ */
+export function clubAudit(query) {
+  return request({
+    url: '/user/cmUserOrganize/audit',
+    method: 'get',
+    params: query
+  })
+}
 /**
  *上线机构
  */

+ 82 - 14
src/api/finance.js

@@ -30,40 +30,108 @@ export function getReceiptDetail(id) {
   })
 }
 /**
- * 楼层排序
+ * 付款列表
  */
-export function getFloorSort(id, sort) {
+export function getOrganizePayList(params) {
   return request({
-    url: `/home/page/floor/${id}/${sort}`,
+    url: '/order/organize/pay/list',
+    method: 'get',
+    params: params
+  })
+}
+/**
+ * 申请付款列表
+ */
+export function getPayOrderList(params) {
+  return request({
+    url: '/order/organize/payOrder/list',
+    method: 'get',
+    params: params
+  })
+}
+/**
+ * 付款详情
+ */
+export function getPayDetails(id) {
+  return request({
+    url: '/order/organize/pay/form/' + id,
     method: 'get'
   })
 }
 /**
- * 楼层保存
+ * 付款单初始化详情
  */
-export function savePageFloor(params) {
+export function getApplyPays(data) {
   return request({
-    url: '/home/page/save/floor',
+    url: '/order/organize/apply/pays',
     method: 'post',
-    data: params
+    data: data
   })
 }
 /**
- * 楼层删除
+ * 提交付款申请
  */
-export function delPageFloor(id) {
+export function subPayApply(data) {
   return request({
-    url: '/home/page/del/floor/' + id,
+    url: '/order/organize/pay/apply',
+    method: 'post',
+    data: data
+  })
+}
+/**
+ * 审核付款申请
+ */
+export function subPayCheck(data) {
+  return request({
+    url: '/order/organize/pay/check',
+    method: 'post',
+    data: data
+  })
+}
+/**
+ * 取消付款
+ */
+export function cancelPayApply(id) {
+  return request({
+    url: '/order/organize/pay/cancel/' + id,
     method: 'get'
   })
 }
 /**
- * 楼层详情
+ * 撤销付款
  */
-export function formPageFloor(id) {
+export function cancelPayBack(id) {
   return request({
-    url: '/home/page/floor/form/' + id,
+    url: '/order/organize/pay/back/' + id,
     method: 'get'
   })
 }
-
+/**
+ * 订单财富信息列表
+ */
+export function organizePayInfos(params) {
+  return request({
+    url: '/order/organize/pay/infos',
+    method: 'get',
+    params: params
+  })
+}
+/**
+ * 订单首付款记录
+ */
+export function organizeReceiptRecord(id) {
+  return request({
+    url: '/order/organize/receipt/record/' + id,
+    method: 'get'
+  })
+}
+/**
+ * 申请分账
+ */
+export function subPaySplit(data) {
+  return request({
+    url: '/order/organize/pay/split',
+    method: 'post',
+    data: data
+  })
+}

+ 58 - 5
src/api/order.js

@@ -32,14 +32,19 @@ export function saveRemarks(query) {
   })
 }
 
+/**
+ * 订单退款退货记录
+ */
 export function getRefundReturn(query) {
   return request({
-    url: '/order/organize/toRecturnRecordByOrderID',
+    url: '/order/organize/toRecturnRecordByOrderId',
     method: 'get',
     params: query
   })
 }
-
+/**
+ * 收退款记录
+ */
 export function getRefundRecord(query) {
   return request({
     url: '/order/organize/toRefundRecord',
@@ -64,11 +69,59 @@ export function getRefundList(query) {
     params: query
   })
 }
-
-export function getRefundDetail(query) {
+/**
+ * 用户退款详情
+ */
+export function getRefundDetail(id) {
+  return request({
+    url: '/order/cmReturnedPurchase/toReturnRecord/' + id,
+    method: 'get'
+  })
+}
+/**
+ * 更改订单收款状态
+ */
+export function orderCheckReceipt(query) {
   return request({
-    url: '/order/cmReturnedPurchase/toRecturnRecord',
+    url: '/order/organize/check/receipt',
     method: 'get',
     params: query
   })
 }
+/**
+ * 去发货
+ */
+export function orderTodeliver(id) {
+  return request({
+    url: '/order/deliver/to/deliver/' + id,
+    method: 'get'
+  })
+}
+/**
+ * 确认发货
+ */
+export function confirmDeliver(data) {
+  return request({
+    url: '/order/deliver/confirm/deliver',
+    method: 'post',
+    data: data
+  })
+}
+/**
+ * 物流公司
+ */
+export function deliverShipCompany() {
+  return request({
+    url: '/order/deliver/ship/company',
+    method: 'get'
+  })
+}
+/**
+ * 物流公司
+ */
+export function deliverDetails(id) {
+  return request({
+    url: '/order/deliver/deliver/details/' + id,
+    method: 'get'
+  })
+}

二進制
src/assets/favicon.png


+ 121 - 0
src/components/UploadImage/index.vue

@@ -0,0 +1,121 @@
+<template>
+  <div>
+    <el-upload
+      ref="upload"
+      :list-type="listType"
+      :action="action"
+      :headers="headers"
+      :show-file-list="false"
+      :on-success="uploadImageSuccess"
+      :on-remove="handleImageRemove"
+      :before-upload="beforeUpload"
+      :on-error="uploadError"
+      :multiple="multiple"
+      :accept="accept"
+    >
+      <div v-loading="loadImgLoading" class="avatar">
+        <img v-if="dialogImageUrl" :src="dialogImageUrl" @error="reloadImage" @load="loadSucess">
+        <i v-else class="el-icon-plus avatar-uploader-icon" />
+      </div>
+      <button v-if="trigger" ref="trigger" slot="trigger" size="small" type="primary">选取文件</button>
+    </el-upload>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+export default {
+  name: 'UploadImage',
+  props: {
+    domIndex: {
+      type: Number,
+      default: 0
+    },
+    dialogImageUrl: {
+      type: String,
+      default: ''
+    },
+    multiple: {
+      type: Boolean,
+      default: false
+    },
+    limit: {
+      type: Number,
+      default: 1
+    },
+    accept: {
+      type: String,
+      default: '.jpg,.png,.gif'
+    },
+    listType: {
+      type: String,
+      default: 'picture-card'
+    },
+    imageList: {
+      type: Array,
+      default: () => []
+    },
+    uuid: {
+      type: Number,
+      default: 0
+    },
+    beforeUpload: {
+      type: Function,
+      default: () => true
+    },
+    trigger: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      loadImgLoading: false
+    }
+  },
+  computed: {
+    ...mapGetters(['token']),
+    chooseState() {
+      return this.imageList.length < this.limit
+    },
+    action() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    },
+    headers() {
+      return {
+        'token': this.$store.getters.token
+      }
+    }
+  },
+  methods: {
+    // 上传成功
+    uploadImageSuccess(response, file, fileList) {
+      this.dialogImageUrl = response.data
+      const data = { data: response.data, index: this.domIndex }
+      this.$emit('success', { data, file, fileList })
+    },
+    // 删除
+    handleImageRemove(file, fileList) {
+      this.dialogImageUrl = ''
+      const data = { index: this.domIndex }
+      this.$emit('remove', { data, file, fileList })
+    },
+    // 上传失败
+    uploadError(err, file, fileList) {
+      this.$emit('error', { err, file, fileList })
+    },
+    handleClick() {
+      this.$refs.trigger.click()
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.dialogImageUrl = this.dialogImageUrl.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    }
+  }
+}
+</script>

+ 2 - 0
src/components/index.js

@@ -1,7 +1,9 @@
 import Pagination from './Pagination'
+import UploadImage from './UploadImage'
 
 const install = (Vue) => {
   Vue.component(Pagination.name, Pagination)
+  Vue.component(UploadImage.name, UploadImage)
 }
 
 export default {

+ 23 - 0
src/filters/index.js

@@ -95,3 +95,26 @@ export function amountfilters(value) {
     return '0.00'
   }
 }
+/**
+ * 订单状态
+ * @param {String} string
+ */
+export function orderStatusFilter(status) {
+  const map = {
+    '0': '待确认',
+    '4': '交易完成',
+    '5': '订单完成',
+    '6': '已关闭',
+    '7': '交易全退',
+    '11': '待收款、待发货',
+    '12': '待收款、部分发货',
+    '13': '待收款、全部发货',
+    '21': '部分收款、待发货',
+    '22': '部分收款、部分发货',
+    '23': '部分收款、全部发货',
+    '31': '全部收款、待发货',
+    '32': '全部收款、部分发货',
+    '33': '全部收款、全部发货'
+  }
+  return map[status]
+}

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

@@ -39,7 +39,7 @@ const financeRouter = {
       path: 'payment-edit',
       name: 'PaymentEdit',
       component: () => import('@/views/finance/payment-edit'),
-      meta: { title: '提交付款单', noCache: true, icon: 'el-icon-bank-card' },
+      meta: { title: '编辑', noCache: true, icon: 'el-icon-bank-card' },
       hidden: true
     },
     {
@@ -55,6 +55,13 @@ const financeRouter = {
       component: () => import('@/views/finance/payapply-list'),
       meta: { title: '申请付款', noCache: true, icon: 'el-icon-wallet' }
     },
+    {
+      path: 'payapply-edit',
+      name: 'PayapplyEdit',
+      component: () => import('@/views/finance/payapply-edit'),
+      meta: { title: '提交付款单', noCache: true, icon: 'el-icon-wallet' },
+      hidden: true
+    },
     {
       path: 'paycents-list',
       name: 'PaycentsList',
@@ -91,7 +98,7 @@ const financeRouter = {
       path: 'remit-record',
       name: 'RemitRecord',
       component: () => import('@/views/finance/payfinance-remit-record'),
-      meta: { title: '收退款记录', noCache: true, icon: 'el-icon-takeaway-box' },
+      meta: { title: '收款记录', noCache: true, icon: 'el-icon-takeaway-box' },
       hidden: true
     },
     {

+ 1 - 1
src/router/modules/floor.js

@@ -19,7 +19,7 @@ const floorRouter = {
       path: 'edit',
       name: 'FloorEdit',
       component: () => import('@/views/floor/edit'),
-      meta: { title: '楼层编辑', icon: 'ma-other-notes' },
+      meta: { title: '楼层编辑', noCache: true, icon: 'ma-other-notes' },
       hidden: true
     }
   ]

+ 24 - 3
src/router/modules/order.js

@@ -28,6 +28,27 @@ const orderRouter = {
       meta: { title: '退款详情', noCache: true, activeMenu: '/order/refund' },
       hidden: true
     },
+    {
+      path: 'deliver',
+      name: 'Deliver',
+      component: () => import('@/views/order/deliver'),
+      meta: { title: '订单发货', noCache: true, activeMenu: '/order/deliver' },
+      hidden: true
+    },
+    {
+      path: 'deliver-record',
+      name: 'deliverRecord',
+      component: () => import('@/views/order/deliver-record'),
+      meta: { title: '发货记录', noCache: true, activeMenu: '/order/deliver' },
+      hidden: true
+    },
+    {
+      path: 'addLogistics',
+      name: 'AddLogistics',
+      component: () => import('@/views/order/addLogistics'),
+      meta: { title: '添加物流', noCache: true, activeMenu: '/order/addLogistics' },
+      hidden: true
+    },
     {
       path: 'detail',
       name: 'Detail',
@@ -36,21 +57,21 @@ const orderRouter = {
       hidden: true
     },
     {
-      path: 'logistics/:id(\\d+)',
+      path: 'logistics',
       name: 'logistics',
       component: () => import('@/views/order/logistics'),
       meta: { title: '发货记录', noCache: true, activeMenu: '/order/list' },
       hidden: true
     },
     {
-      path: 'refund-record/:id(\\d+)',
+      path: 'refund-record',
       name: 'RefundRecord',
       component: () => import('@/views/order/refund-record'),
       meta: { title: '收退款记录', noCache: true, activeMenu: '/order/list' },
       hidden: true
     },
     {
-      path: 'refund-return/:id(\\d+)',
+      path: 'refund-return',
       name: 'RefundRreturn',
       component: () => import('@/views/order/refund-return'),
       meta: { title: '退款(退货)记录', noCache: true, activeMenu: '/order/list' },

+ 9 - 0
src/styles/index.scss

@@ -230,3 +230,12 @@ input[type="number"]{
     }
   }
 }
+.el-span-warning{
+  color: #E6A23C;
+}
+.el-span-success{
+  color: #67C23A;
+}
+.el-span-danger{
+  color: #F56C6C;
+}

+ 39 - 0
src/utils/index.js

@@ -345,3 +345,42 @@ export function removeClass(ele, cls) {
     ele.className = ele.className.replace(reg, ' ')
   }
 }
+/**
+ * 获取当前日期时间
+ * @param {HTMLElement} elm
+ * @param {string} cls
+ */
+export function currentTime() {
+  var date = new Date()
+  var year = date.getFullYear() // 月份从0~11,所以加一
+  const month = date.getMonth()
+  console.log('month', month)
+  var dateArr = [
+    date.getMonth() + 1,
+    date.getDate(),
+    date.getHours(),
+    date.getMinutes(),
+    date.getSeconds()
+  ]
+  // 如果格式是MM则需要此步骤,如果是M格式则此循环注释掉
+  for (var i = 0; i < dateArr.length; i++) {
+    if (dateArr[i] >= 1 && dateArr[i] <= 9) {
+      dateArr[i] = '0' + dateArr[i]
+    }
+  }
+  var strDate =
+      year +
+      '/' +
+      dateArr[0] +
+      '/' +
+      dateArr[1] +
+      ' ' +
+      dateArr[2] +
+      ':' +
+      dateArr[3] +
+      ':' +
+      dateArr[4]
+      // 此处可以拿外部的变量接收,也可直接返回  strDate:2022-05-01 13:25:30
+  // this.date = strDate;
+  console.log('strDate', strDate)
+}

+ 112 - 55
src/views/campaign/activity-edit.vue

@@ -2,7 +2,7 @@
   <div class="app-container" style="width: 800px;margin: 0 auto;">
     <el-form ref="bannerForm" :model="form" label-width="100px">
       <el-form-item label="活动类型:" prop="activeType" :rules="rules.activeType">
-        <el-select v-model="form.activeType" placeholder="请选择" @change="handeleSelChange">
+        <el-select v-model="form.activeType" placeholder="请选择" @change="handeleSelChange($event)">
           <el-option label="商品列表" :value="1" />
           <el-option label="宣传图(一张)" :value="2" />
           <el-option label="宣传图(多张)" :value="3" />
@@ -57,23 +57,78 @@
           </el-table>
         </el-form-item>
       </template>
-      <template v-if="form.activeType === 2 || form.activeType === 3">
+      <!-- 一张宣传图 -->
+      <template v-if="form.activeType === 2">
         <div v-for="(activ,index) in form.images" :key="index" class="form-cell">
           <el-form-item label="宣传图:" prop="image" :rules="rules.image">
             <div class="form-el-upload">
-              <el-upload
-                class="avatar-uploader"
-                :action="actionUrl"
-                :headers="getToken"
-                :show-file-list="false"
-                :on-success="handleSuccess"
+              <upload-image
+                :limit="1"
+                :dom-index="index"
+                :dialog-image-url="activ.image"
                 :before-upload="beforeUpload"
-              >
-                <div v-loading="loadImgLoading" class="avatar">
-                  <img v-if="activ.image" :src="activ.image" @error="reloadImage" @load="loadSucess">
-                  <i v-else class="el-icon-plus avatar-uploader-icon" />
-                </div>
-              </el-upload>
+                @success="uploadSuccess"
+                @remove="handleRemove"
+              />
+              <p style="margin: 0;line-height: 28px;font-size: 14px;color: red;">注:请尽量上传700*1000(px)尺寸的图片。</p>
+            </div>
+          </el-form-item>
+          <!-- 商品列表 -->
+          <el-form-item label="商品信息" :prop="`images.${index}.products`" :rules="rules.products">
+            <el-button type="primary" icon="el-icon-sort" size="mini" :disabled="disabled3(activ.products)" @click="handleOnInputSort(index)">一键排序</el-button>
+            <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleDialogVisible(index)">添加商品</el-button>
+            <el-checkbox-group v-show="false" v-model="activ.products" />
+            <el-table v-show="activ.products && activ.products.length>0" :data="activ.products" border>
+              <el-table-column property="mainImage" label="商品图片" align="center" width="80">
+                <template slot-scope="{ row }">
+                  <el-popover
+                    placement="top-start"
+                    title=""
+                    width="180"
+                    trigger="hover"
+                  >
+                    <img :src="row.mainImage" alt="" style="width:150px;height:150px;">
+                    <img slot="reference" :src="row.mainImage" alt="" style="width:30px;height:30px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column property="productName" label="商品名称" align="center" />
+              <el-table-column prop="validFlag" label="商品状态" align="center" width="150">
+                <template slot-scope="{row}">
+                  <el-tag :type="row.validFlag | statusFilter">{{ row.validFlag*1 === 1 ? '已上架' : '已下架' }}</el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column label="排序" align="center" width="100">
+                <template slot-scope="{row}">
+                  <el-input v-model="row.sort" maxlength="4" minlength="1" />
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleDeletePros(scope.$index,index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form-item>
+        </div>
+      </template>
+      <!-- 多张宣传图 -->
+      <template v-if="form.activeType === 3">
+        <div v-for="(activ,index) in form.images" :key="index" class="form-cell">
+          <el-form-item label="标题:" :prop="`images.${index}.topic`" :rules="rules.topic1">
+            <el-input v-model="activ.topic" placeholder="请输入宣传图标题" maxlength="30" style="width: 200px;" />
+          </el-form-item>
+          <el-form-item label="宣传图:" prop="image" :rules="rules.image">
+            <div class="form-el-upload">
+              <upload-image
+                :limit="1"
+                :dom-index="index"
+                :dialog-image-url="activ.image"
+                :before-upload="beforeUpload"
+                @success="uploadSuccess1"
+                @remove="handleRemove1"
+              />
+              <p style="margin: 0;line-height: 28px;font-size: 14px;color: red;">注:请尽量上传700*360(px)尺寸的图片。</p>
             </div>
           </el-form-item>
           <!-- 商品列表 -->
@@ -119,6 +174,7 @@
     </el-form>
     <div class="el-dialog__footer" style="text-align: left;">
       <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+      <el-button plain @click="backToList">返回</el-button>
     </div>
     <!-- 商品弹框 -->
     <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
@@ -130,7 +186,7 @@ import { saveActive, formActive } from '@/api/campaign'
 import goodDialog from './components/good-multi-dialog'
 const defaultImages = () => {
   return {
-    image: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+    image: '',
     products: []
   }
 }
@@ -156,7 +212,7 @@ export default {
         products: [],
         images: [// 活动 2,3
           {
-            image: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
+            image: '',
             products: []
           }
         ]
@@ -172,13 +228,15 @@ export default {
       rules: {
         activeType: [{ required: true, message: '请选择活动类型', trigger: 'blur' }],
         topic: [{ required: true, message: '请填写轮播主题', trigger: 'blur' }],
+        topic1: [{ required: true, message: '请填写宣传图标题', trigger: 'blur' }],
         banner: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
         products: [{ required: true, type: 'array', message: '请添加商品', trigger: ['change'] }],
         sort: [{ required: true, message: '排序值不能为空', trigger: 'blur' }],
         enabledStatus: [{ required: true, message: '请选择状态', trigger: 'blur' }]
       },
-      handelProduts: []
-
+      handelProduts: [],
+      oneImageList: [],
+      moreImageList: []
     }
   },
   computed: {
@@ -187,14 +245,6 @@ export default {
     },
     disabled1() {
       return this.form.images.length === 1
-    },
-    getToken() {
-      return {
-        'token': this.$store.getters.token
-      }
-    },
-    actionUrl() {
-      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
     }
   },
   created() {
@@ -276,8 +326,13 @@ export default {
       }, 1000)
     },
     // 修改活动类型时清空商品
-    handeleSelChange() {
-      this.handelProduts = []
+    handeleSelChange(value) {
+      if (value === 1) {
+        this.form.products = []
+      } else {
+        this.form.images = []
+        this.form.images.push(defaultImages())
+      }
     },
     // 取消选择商品
     handleGoodCancel() {
@@ -319,37 +374,39 @@ export default {
         return true
       }
     },
-    // 上传图标事件
-    handleSuccess(response, file) {
-      this.loadImgLoading = true
-      this.$nextTick(() => {
-        setTimeout(() => {
-          this.temp.classifyImage = response.data
-        }, 1000 * 2)
-      })
+    // 单张上传宣传图
+    uploadSuccess(data, file, fileList) {
+      this.form.images[data.data.index].image = data.data.data
+      console.log('images', this.form.images)
+    },
+    // 单张上传宣传图删除
+    handleRemove({ data, file, fileList }) {
+      this.form.images[data.index].image = fileList.length || ''
+      console.log('images', this.form.images)
+    },
+    // 多张上传宣传图
+    uploadSuccess1(data, file, fileList) {
+      this.form.images[data.data.index].image = data.data.data
+      console.log('images', this.form.images)
+    },
+    // 宣传图删除
+    handleRemove1({ data, file, fileList }) {
+      this.form.images[data.index].image = fileList.length || ''
+      console.log('images', this.form.images)
     },
-    // 对上传图片的大小、格式进行限制
     beforeUpload(file) {
-      const isJPG = file.type === 'image/jpeg'
-      const isJPG2 = file.type === 'image/jpg'
-      const isPNG = file.type === 'image/png'
-      const isLt5M = file.size / 1024 / 1024 < 5
-      if (!isJPG && !isJPG2 && !isPNG) {
-        this.$message.error('只支持jpg或png格式图片')
-      }
-      if (!isLt5M) {
-        this.$message.error('请上传5MB以内的图片!')
+      const flag = file.size / 1024 / 1024 < 5
+      if (!flag) {
+        this.$message.error('上传图片大小不能超过 5MB!')
       }
-      return (isJPG || isJPG2 || isPNG) && isLt5M
+      return flag
     },
-    reloadImage() {
-      this.loadImgLoading = true
-      setTimeout(() => {
-        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
-      }, 1000 * 2)
-    },
-    loadSucess() {
-      this.loadImgLoading = false
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({ path: '/campaign/activity-list' })
+        })
+      })
     }
   }
 }

+ 1 - 1
src/views/campaign/activity-list.vue

@@ -77,7 +77,7 @@
       :page-size="20"
       :page.sync="listQuery.index"
       :limit.sync="listQuery.pageSize"
-      @pagination="getclubList"
+      @pagination="getList"
     />
   </div>
 </template>

+ 33 - 14
src/views/campaign/banner-edit.vue

@@ -19,6 +19,7 @@
               <i v-else class="el-icon-plus avatar-uploader-icon" />
             </div>
           </el-upload>
+          <p style="margin: 0;line-height: 28px;font-size: 14px;color: red;">注:请尽量上传700*340(px)尺寸的图片。</p>
         </div>
       </el-form-item>
       <el-form-item label="排序:" prop="sort" :rules="rules.sort">
@@ -31,7 +32,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="跳转:" prop="jumpType" :rules="rules.jumpType">
-        <el-radio-group v-model="form.jumpType">
+        <el-radio-group v-model="form.jumpType" @change="changeGrop($event)">
           <el-radio :label="1">单个商品详情</el-radio>
           <el-radio :label="2">活动列表</el-radio>
         </el-radio-group>
@@ -83,8 +84,9 @@
         </el-form-item>
       </template>
     </el-form>
-    <div class="el-dialog__footer" style="text-align: left;">
+    <div class="el-dialog__footer" style="text-align: center;">
       <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+      <el-button plain @click="backToList">返回</el-button>
     </div>
     <!-- 商品弹框 -->
     <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
@@ -111,8 +113,8 @@ export default {
       return {
         organizeId: this.$store.getters.organizeId,
         bannerName: '', // 轮播主题
-        bannerImage: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-        sort: 0, // 轮播排序值
+        bannerImage: '',
+        sort: 1, // 轮播排序值
         enabledStatus: 1, // 轮播上线状态
         jumpType: null, // 跳转类型
         jumpActiveId: null, // 跳转活动Id
@@ -170,8 +172,18 @@ export default {
     },
     async formPageBanner(id) {
       // 获取轮播图详情
-      const res = await formPageBanner(id)
-      this.form = { ...this.form, ...res.data }
+      try {
+        const res = await formPageBanner(id)
+        this.form = { ...this.form, ...res.data }
+        if (res.data.jumpType === 2) {
+          this.form.products = []
+        }
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    changeGrop(value) {
+      console.log('value', value)
     },
     // 显示选择商品弹窗
     handleDialogVisible() {
@@ -255,6 +267,13 @@ export default {
     },
     loadSucess() {
       this.loadImgLoading = false
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({ path: '/campaign/list', query: { type: 1 }})
+        })
+      })
     }
   }
 }
@@ -275,26 +294,26 @@ export default {
   .avatar-uploader-icon {
     font-size: 28px;
     color: #8c939d;
-    width: 148px;
-    height: 148px;
-    line-height: 148px;
+    width: 350px;
+    height: 170px;
+    line-height: 170px;
     text-align: center;
   }
   .avatar {
-    width: 148px;
-    height: 148px;
+    width: 350px;
+    height: 170px;
     display: block;
   }
   .avatar img {
-    width: 148px;
-    height: 148px;
+    width: 350px;
+    height: 170px;
     display: block;
   }
   .el-form-item__label{
       text-align: right !important;
   }
   .form-el-upload{
-    width: 150px;
+    width: 350px;
   }
   .el-upload__tip{
     line-height: 20px;

+ 13 - 4
src/views/campaign/category-edit.vue

@@ -2,7 +2,7 @@
   <div class="app-container" style="width: 800px;margin: 0 auto;">
     <el-form ref="bannerForm" :model="form" label-width="100px">
       <el-form-item label="主题:" prop="topic" :rules="rules.topic">
-        <el-input v-model="form.topic" placeholder="请输入菜单名,5字以内" style="width: 250px;" />
+        <el-input v-model="form.topic" placeholder="请输入菜单名,5字以内" maxlength="5" style="width: 250px;" />
       </el-form-item>
       <el-form-item label="图标:" prop="image" :rules="rules.image">
         <div class="form-el-upload">
@@ -19,6 +19,7 @@
               <i v-else class="el-icon-plus avatar-uploader-icon" />
             </div>
           </el-upload>
+          <p style="margin: 0;line-height: 28px;font-size: 14px;color: red;">注:请尽量上传100*100(px)尺寸的图片。</p>
         </div>
       </el-form-item>
       <el-form-item label="排序:" prop="sort" :rules="rules.sort">
@@ -83,8 +84,9 @@
         </el-form-item>
       </template>
     </el-form>
-    <div class="el-dialog__footer" style="text-align: left;">
+    <div class="el-dialog__footer" style="text-align: center;">
       <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+      <el-button plain @click="backToList">返回</el-button>
     </div>
     <!-- 商品弹框 -->
     <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
@@ -111,8 +113,8 @@ export default {
       return {
         organizeId: this.$store.getters.organizeId,
         topic: '', // 菜单主题
-        image: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-        sort: 0, // 菜单排序值
+        image: '',
+        sort: 1, // 菜单排序值
         enabledStatus: 1, // 菜单上线状态
         jumpType: null, // 跳转类型
         jumpActiveId: null, // 跳转活动Id
@@ -255,6 +257,13 @@ export default {
     },
     loadSucess() {
       this.loadImgLoading = false
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({ path: '/campaign/list', query: { type: 2 }})
+        })
+      })
     }
   }
 }

+ 2 - 2
src/views/campaign/components/activity/index.vue

@@ -107,12 +107,12 @@ export default {
       listQuery: {
         index: 1,
         pageSize: 20,
-        organizeID: this.$store.getters.organizeId
+        organizeId: this.$store.getters.organizeId
       }
     }
   },
   computed: {
-    organizeID() {
+    organizeId() {
       return this.$store.getters.organizeId
     }
   },

+ 5 - 5
src/views/campaign/components/banner/index.vue

@@ -5,7 +5,7 @@
         <span>主题:</span>
         <el-input
           v-model="listQuery.bannerName"
-          placeholder="请输入主题"
+          placeholder="主题名称"
           clearable
           @keyup.enter.native="getList"
           @clear="getList"
@@ -20,7 +20,7 @@
         </el-select>
       </div>
       <div class="filter-control">
-        <el-button type="primary" icon="el-icon-search" @click="handleOnInputBlur(formItem,index)">查询</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
         <el-button type="primary" icon="el-icon-sort" @click="getList">一键排序</el-button>
         <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加轮播图</el-button>
       </div>
@@ -41,11 +41,11 @@
           <el-popover
             placement="top-start"
             title=""
-            width="530"
+            width="380"
             trigger="hover"
           >
-            <img :src="row.bannerImage" alt="" style="width:500px;height:200px;">
-            <img slot="reference" :src="row.bannerImage" alt="" style="width:120px;height:50px;">
+            <img :src="row.bannerImage" alt="" style="width:350px;height:170px;">
+            <img slot="reference" :src="row.bannerImage" alt="" style="width:170px;height:85px;">
           </el-popover>
         </template>
       </el-table-column>

+ 21 - 4
src/views/campaign/components/category/index.vue

@@ -6,7 +6,7 @@
         <el-button type="primary" icon="el-icon-plus" @click="handleToEdit('add')">添加菜单</el-button>
       </div>
     </div>
-    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #999;">注:1. 最多支持8个已启用的菜单      2. 排序值越小越靠前</p>
+    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #999;">注:1. 最多支持8个已上线的菜单      2. 排序值越小越靠前</p>
     <el-table
       v-loading="listLoading"
       :data="list"
@@ -67,11 +67,14 @@ export default {
         pageSize: 20,
         enabledStatus: '',
         organizeId: this.$store.getters.organizeId
-      }
+      },
+      cateList: []
     }
   },
   computed: {
-
+    disabled() {
+      return this.cateList.length === 8
+    }
   },
   created() {
     this.getList()
@@ -80,10 +83,16 @@ export default {
     // 获取轮播图列表
     async getList() {
       this.listLoading = true
+      this.cateList = []
       try {
         const res = await getMenuList(this.listQuery)
         this.list = res.data.results
         this.total = res.data.totalRecord
+        this.list.forEach(ele => {
+          if (ele.enabledStatus === 1) {
+            this.cateList.push(ele.id)
+          }
+        })
         this.listLoading = false
       } catch (error) {
         console.log('error', error)
@@ -140,7 +149,15 @@ export default {
     // 跳转添加/编辑
     handleToEdit(type, id) {
       if (type === 'add') {
-        this.$router.push({ path: '/campaign/category-edit', query: { type: type }})
+        console.log('disabled', this.disabled)
+        if (this.disabled) {
+          this.$alert('最多支持8个已上线的菜单,请下线已有的菜单再添加。', '提示', {
+            confirmButtonText: '确定'
+          })
+          return
+        } else {
+          this.$router.push({ path: '/campaign/category-edit', query: { type: type }})
+        }
       } else {
         this.$router.push({ path: '/campaign/category-edit', query: { type: type, id: id }})
       }

+ 3 - 0
src/views/campaign/components/good-dialog.vue

@@ -81,8 +81,11 @@ export default {
       listQuery: {
         productName: '', // 商品名称
         shopName: '', // 供应商名称
+        validFlag: 1,
         index: 1,
+        organizeId: this.$store.getters.organizeId,
         pageSize: 20
+
       },
       list: [],
       total: 0,

+ 2 - 0
src/views/campaign/components/good-multi-dialog.vue

@@ -81,7 +81,9 @@ export default {
       listQuery: {
         productName: '', // 商品名称
         shopName: '', // 供应商名称
+        validFlag: 1,
         index: 1,
+        organizeId: this.$store.getters.organizeId,
         pageSize: 20
       },
       list: [],

+ 6 - 6
src/views/campaign/components/special/index.vue

@@ -5,9 +5,9 @@
         <span>主题:</span>
         <el-input
           v-model="listQuery.productId"
-          placeholder="请输入活动主题"
+          placeholder="主题名称"
           clearable
-          @input="e => (listQuery.productId= checkedInput(e,1))"
+          @input="e => (listQuery.topic= checkedInput(e,1))"
           @keyup.enter.native="getList"
           @clear="getList"
         />
@@ -35,17 +35,17 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column label="分类名称" align="center" prop="topic" />
+      <el-table-column label="主题名称" align="center" prop="topic" />
       <el-table-column label="活动入口图片" align="center" prop="image" width="200">
         <template slot-scope="{row}">
           <el-popover
             placement="top-start"
             title=""
-            width="530"
+            width="370"
             trigger="hover"
           >
-            <img :src="row.image" alt="" style="width:500px;height:200px;">
-            <img slot="reference" :src="row.image" alt="" style="width:120px;height:50px;">
+            <img :src="row.image" alt="" style="width:340px;height:180px;">
+            <img slot="reference" :src="row.image" alt="" style="width:170px;height:90px;">
           </el-popover>
         </template>
       </el-table-column>

+ 21 - 16
src/views/campaign/special-edit.vue

@@ -2,9 +2,9 @@
   <div class="app-container" style="width: 800px;margin: 0 auto;">
     <el-form ref="bannerForm" :model="form" label-width="100px">
       <el-form-item label="主题:" prop="topic" :rules="rules.topic">
-        <el-input v-model="form.topic" placeholder="请输入活动主题" style="width: 250px;" />
+        <el-input v-model="form.topic" placeholder="请输入专题主题" style="width: 250px;" />
       </el-form-item>
-      <el-form-item label="活动入口图片:" prop="image" :rules="rules.image">
+      <el-form-item label="专题图片:" prop="image" :rules="rules.image">
         <div class="form-el-upload">
           <el-upload
             class="avatar-uploader"
@@ -19,11 +19,9 @@
               <i v-else class="el-icon-plus avatar-uploader-icon" />
             </div>
           </el-upload>
+          <p style="margin: 0;line-height: 24px;font-size: 14px;color: red;">注:请尽量上传170*90(px)尺寸的图片。</p>
         </div>
       </el-form-item>
-      <el-form-item label="排序:" prop="sort" :rules="rules.sort">
-        <el-input v-model="form.sort" style="width: 200px" />
-      </el-form-item>
       <el-form-item label="状态:" prop="enabledStatus" :rules="rules.enabledStatus">
         <el-select v-model="form.enabledStatus" placeholder="请选择">
           <el-option label="上线" :value="1" />
@@ -83,8 +81,9 @@
         </el-form-item>
       </template>
     </el-form>
-    <div class="el-dialog__footer" style="text-align: left;">
+    <div class="el-dialog__footer" style="text-align: center;">
       <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+      <el-button plain @click="backToList">返回</el-button>
     </div>
     <!-- 商品弹框 -->
     <good-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
@@ -111,8 +110,7 @@ export default {
       return {
         organizeId: this.$store.getters.organizeId,
         topic: '', // 专题主题
-        image: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-        sort: 0, // 专题排序值
+        image: '',
         enabledStatus: 1, // 专题上线状态
         jumpType: null, // 跳转类型
         jumpActiveId: null, // 跳转活动Id
@@ -255,6 +253,13 @@ export default {
     },
     loadSucess() {
       this.loadImgLoading = false
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({ path: '/campaign/list', query: { type: 3 }})
+        })
+      })
     }
   }
 }
@@ -275,26 +280,26 @@ export default {
   .avatar-uploader-icon {
     font-size: 28px;
     color: #8c939d;
-    width: 148px;
-    height: 148px;
-    line-height: 148px;
+    width: 170px !important;
+    height: 90px !important;
+    line-height: 90px;
     text-align: center;
   }
   .avatar {
-    width: 148px;
-    height: 148px;
+    width: 170px !important;
+    height: 90px !important;
     display: block;
   }
   .avatar img {
-    width: 148px;
-    height: 148px;
+    width: 170px !important;
+    height: 90px !important;
     display: block;
   }
   .el-form-item__label{
       text-align: right !important;
   }
   .form-el-upload{
-    width: 150px;
+    width: 170px !important;
   }
   .el-upload__tip{
     line-height: 20px;

+ 41 - 210
src/views/centralized/details.vue

@@ -10,252 +10,83 @@
             width="230"
             trigger="hover"
           >
-            <img :src="detailsData.prudouct.image" alt="" style="width:200px;height:200px;">
-            <img slot="reference" :src="detailsData.prudouct.image" alt="" style="width:100px;height:100px;">
+            <img :src="publishMan.productImage" alt="" style="width:200px;height:200px;">
+            <img slot="reference" :src="publishMan.productImage" alt="" style="width:100px;height:100px;">
           </el-popover>
         </div>
         <div class="card-name">
-          <p>{{ detailsData.prudouct.name }}</p>
+          <p>{{ publishMan.productName }}</p>
         </div>
-      </div></el-card>
+      </div>
+    </el-card>
     <h1 class="card-h1">发起者需求</h1>
     <el-card class="box-card">
       <div class="card-cell">
         <div class="card-cell-p">
-          <p><span>发起者:</span>{{ detailsData.initiate.userName }}</p>
+          <p><span>发起者:</span>{{ publishMan.clubName }}</p>
         </div>
       </div>
       <div class="card-cell">
         <div class="card-cell-p">
-          <p><span>期望单价:</span>¥{{ detailsData.initiate.price }}</p>
+          <p><span>期望单价:</span>¥{{ publishMan.price }}</p>
         </div>
         <div class="card-cell-p">
-          <p><span>采购数量:</span>{{ detailsData.initiate.number }}</p>
+          <p><span>采购数量:</span>{{ publishMan.number }}</p>
         </div>
       </div>
-      <div v-if="detailsData.initiate.status === 1 || detailsData.initiate.status === 2" class="card-status">
-        <el-tag effect="dark" :type="detailsData.initiate.status === 1 ? 'success' : 'danger'">{{ detailsData.initiate.status === 1 ? '已完成' : '已删除' }}</el-tag>
+      <div v-if="publishMan.delflag*1 !== 0" class="card-status">
+        <el-tag effect="dark" type="danger">已删除</el-tag>
       </div>
-    </el-card>
-    <h1 class="card-h1">参与者需求(2)</h1>
-    <el-card v-for="(cell,index) in detailsData.particiList" :key="index" class="box-card" style="margin-bottom: 16px;">
-      <div class="card-cell">
-        <div class="card-cell-p">
-          <p><span>发起者:</span>{{ cell.userName }}</p>
-        </div>
+      <div v-if="publishMan.isAchieve*1 === 1" class="card-status">
+        <el-tag effect="dark" type="success">已实现</el-tag>
       </div>
-      <div class="card-cell">
-        <div class="card-cell-p">
-          <p><span>期望单价:</span>¥{{ cell.price }}</p>
+    </el-card>
+    <template v-if="followMan.length > 0">
+      <h1 class="card-h1">参与者需求(2)</h1>
+      <el-card v-for="(foll,index) in followMan" :key="index" class="box-card" style="margin-bottom: 16px;">
+        <div class="card-cell">
+          <div class="card-cell-p">
+            <p><span>发起者:</span>{{ foll.clubName }}</p>
+          </div>
         </div>
-        <div class="card-cell-p">
-          <p><span>采购数量:</span>{{ cell.number }}</p>
+        <div class="card-cell">
+          <div class="card-cell-p">
+            <p><span>期望单价:</span>¥{{ foll.price }}</p>
+          </div>
+          <div class="card-cell-p">
+            <p><span>采购数量:</span>{{ foll.number }}</p>
+          </div>
         </div>
-      </div>
-      <div v-if="cell.status === 1 || cell.status === 2" class="card-status">
-        <el-tag effect="dark" :type="cell.status === 1 ? 'success' : 'danger'">{{ cell.status === 1 ? '已完成' : '已删除' }}</el-tag>
-      </div>
-    </el-card>
+      </el-card>
+    </template>
   </div>
 </template>
 <script>
-// 引入省市区组件,公共组件所在的路径
-import { addNewClub, saveAddClubUser } from '@/api/club'
+import { buyDetail } from '@/api/centralized'
 export default {
   data() {
     return {
-      userID: this.$route.query.userID,
-      clubID: this.$route.query.clubID,
-      dialogImageUrl: '',
-      dialogVisible: false,
-      isRequest: false,
-      businessImgLoading: false,
-      headImgLoading: false,
-      detailsData: {
-        prudouct: {
-          name: 'CH2天然净化防御精萃净化去味',
-          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-        },
-        initiate: {
-          userName: '采美信息技术有限公司',
-          price: 400000,
-          number: 100,
-          status: 1
-        },
-        particiList: [
-          {
-            userName: '采美信息技术有限公司',
-            price: 400000,
-            number: 100,
-            status: 0
-          },
-          {
-            userName: '采美信息技术有限公司',
-            price: 400000,
-            number: 100,
-            status: 2
-          },
-          {
-            userName: '采美信息技术有限公司',
-            price: 400000,
-            number: 100,
-            status: 1
-          },
-          {
-            userName: '采美信息技术有限公司',
-            price: 400000,
-            number: 100,
-            status: 0
-          }
-        ]
-      },
-      form: {
-        userName: '采美信息技术有限公司',
-        linkMan: '智捷赵',
-        bindMobile: '158888888888',
-        province: '广东省',
-        city: '深圳市',
-        town: '福田区',
-        address: '广东省深圳市福田区上步南路10001锦峰大厦',
-        clubStatus: 91,
-        contractMobile: '',
-        socialCreditCode: '4305271988665444444444444',
-        headpic: 'https://img0.baidu.com/it/u=178849715,820264547&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-        businessLicenseImage: 'https://img0.baidu.com/it/u=178849715,820264547&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-      },
-      addList: {
-        provinceID: '',
-        cityID: '',
-        townID: ''
-      },
+      followMan: [],
+      publishMan: {},
       loadingbut: false,
       loadingbuttext: '保存'
     }
   },
   computed: {
-    getToken() {
-      return {
-        'token': this.$store.getters.token
-      }
-    },
-    organizeId() {
-      return this.$store.getters.organizeId
-    },
-    actionUrl() {
-      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
-    }
+
   },
   created() {
-    // const params = { clubID: this.clubID, userID: this.userID }
-    // this.initClubData(params)
+    this.buyDetail(this.$route.query.id)
   },
   methods: {
-    initClubData(params) {
-      addNewClub(params).then(response => {
-        const resData = response.data
-        const dataObj = {
-          name: resData.name,
-          linkMan: resData.linkMan,
-          contractMobile: resData.contractMobile,
-          socialCreditCode: resData.socialCreditCode,
-          address: resData.address,
-          status: resData.status,
-          firstClubType: resData.firstClubType,
-          headpic: resData.headpic,
-          businessLicenseImage: resData.businessLicenseImage
-        }
-        this.form = Object.assign({}, dataObj)
-        this.addList.province = resData.province
-        this.addList.city = resData.city
-        this.addList.town = resData.town
-        this.addList.provinceID = resData.provinceID
-        this.addList.cityID = resData.cityID
-        this.addList.townID = resData.townID
-        this.isRequest = true
-      }).catch(() => {
-        // 封装静态数据
-      })
-    },
-    onSubmite() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          const Formobj = Object.assign(this.form, { id: this.organizeId, userID: this.userID, clubID: this.clubID })
-          const params = Object.assign(this.addList, Formobj)
-          this.loadingbut = true
-          this.loadingbuttext = '保存中...'
-          saveAddClubUser(params).then(response => {
-            this.loadingbut = false
-            this.loadingbuttext = '保存'
-            this.$message({ message: response.msg, type: 'success', center: true })
-            this.backToList()
-          })
-        }
-      })
-    },
-    backToList() {
-      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
-        this.$nextTick(() => {
-          this.$router.replace({
-            path: '/club/list'
-          })
-        })
-      })
-    },
-    // 从子组件获取省市区
-    handleCity(data) {
-      this.addList.provinceID = data.provinceid
-      this.addList.cityID = data.cityid
-      this.addList.townID = data.townid
-    },
-    // 上传图标事件
-    handleAvatarSuccess(response, file) {
-      this.businessImgLoading = true
-      this.$nextTick(() => {
-        setTimeout(() => {
-          this.form.businessLicenseImage = response.data
-        }, 1000 * 2)
-      })
-    },
-    reloadAvatarImage() {
-      this.businessImgLoading = true
-      setTimeout(() => {
-        this.form.businessLicenseImage = this.form.businessLicenseImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
-      }, 1000 * 2)
-    },
-    loadAvatarSucess() {
-      this.businessImgLoading = false
-    },
-    // 上传图标事件
-    handleDoorwaySuccess(response, file) {
-      this.headImgLoading = true
-      this.$nextTick(() => {
-        setTimeout(() => {
-          this.form.headpic = response.data
-        }, 1000 * 2)
-      })
-    },
-    reloadDoorwayImage() {
-      this.headImgLoading = true
-      setTimeout(() => {
-        this.form.headpic = this.form.headpic.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
-      }, 1000 * 2)
-    },
-    loadDoorwaySucess() {
-      this.headImgLoading = false
-    },
-    // 对上传图片的大小、格式进行限制
-    beforeUpload(file) {
-      const isJPG = file.type === 'image/jpeg'
-      const isJPG2 = file.type === 'image/jpg'
-      const isPNG = file.type === 'image/png'
-      const isLt5M = file.size / 1024 / 1024 < 5
-      if (!isJPG && !isJPG2 && !isPNG) {
-        this.$message.error('只支持jpg或png格式图片')
-      }
-      if (!isLt5M) {
-        this.$message.error('请上传5MB以内的图片!')
+    async buyDetail(id) {
+      try {
+        const res = await buyDetail({ id: id })
+        this.followMan = res.data.followMan
+        this.publishMan = res.data.publishMan
+      } catch (error) {
+        console.log('errr', error)
       }
-      return (isJPG || isJPG2 || isPNG) && isLt5M
     }
   }
 }

+ 97 - 226
src/views/centralized/list.vue

@@ -1,45 +1,39 @@
 <template>
   <div class="app-container">
-    <div class="app-header-search">
-      <el-form class="demo-form-inline">
-        <el-form-item label="商品名称:" style="width:280px;float: left;">
-          <el-input v-model="listQuery.userName" placeholder="请输入商品名称" maxlength="50" style="width:200px;" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="发起机构:" style="width:230px;float: left;">
-          <el-input v-model="listQuery.linkMan" placeholder="请输入发起机构" maxlength="10" style="width:150px" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="手机号:" style="width:200px;float: left;">
-          <el-input v-model="listQuery.bindMobile" placeholder="请输入手机号" maxlength="11" style="width:130px" @keyup.enter.native="handleFilter" />
-        </el-form-item>
-        <el-form-item label="状态:" style="width:190px;float: left;">
-          <el-select v-model="listQuery.clubStatus" placeholder="请选择" style="width:100px" value="" @change="handleFilter">
-            <el-option label="全部" value="" />
-            <el-option label="已完成" value="1" />
-            <el-option label="未完成" value="2" />
-            <el-option label="已删除" value="3" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="发布日期:" style="width:410px;float: left;">
-          <el-date-picker
-            v-model="listQuery.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择日期"
-            style="width: 150px;"
-          />
-          至
-          <el-date-picker
-            v-model="listQuery.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择日期"
-            style="width: 150px;"
-          />
-        </el-form-item>
-        <el-form-item style="width:100px;float: left;">
-          <el-button type="primary" icon="el-icon-search" @click="handleFilter">查询</el-button>
-        </el-form-item>
-      </el-form>
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input v-model="listQuery.productName" style="width:130px;" placeholder="商品名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>发起机构:</span>
+        <el-input v-model="listQuery.linkMan" style="width:130px;" placeholder="发起机构" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>需求状态:</span>
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="全部" />
+          <el-option label="未完成" :value="1" />
+          <el-option label="已完成" :value="2" />
+          <el-option label="已删除" :value="3" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>发布日期:</span>
+        <el-date-picker
+          v-model="registTime"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      </div>
     </div>
     <el-table
       v-loading="listLoading"
@@ -50,7 +44,7 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column label="采购商品" width="220" align="center" prop="name" />
+      <el-table-column label="采购商品" width="220" align="center" prop="productName" />
       <el-table-column label="图片" align="center" width="100">
         <template slot-scope="{ row }">
           <el-popover
@@ -59,161 +53,80 @@
             width="120"
             trigger="hover"
           >
-            <img :src="row.image" alt="" style="width:100px;height:100px;">
-            <img slot="reference" :src="row.image" alt="" style="width:50px;height:50px;">
+            <img :src="row.productImage" alt="" style="width:100px;height:100px;">
+            <img slot="reference" :src="row.productImage" alt="" style="width:50px;height:50px;">
           </el-popover>
         </template>
       </el-table-column>
       <el-table-column label="发起机构" align="center" prop="clubName" />
       <el-table-column label="联系人" width="100" align="center" prop="linkMan" />
-      <el-table-column label="手机号" width="140" align="center" prop="bindMobile" />
-      <el-table-column label="参与机构数" width="100" align="center" prop="numb" />
-      <el-table-column label="上线状态" width="150" align="center" prop="status">
+      <el-table-column label="手机号" width="140" align="center" prop="mobile" />
+      <el-table-column label="参与机构数" width="100" align="center" prop="clubCount" />
+      <el-table-column label="状态" width="150" align="center" prop="status">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-status': row.status == '0',
-              'el-span-sStatus': row.status == '1',
-              'el-span-eStatus': row.status == '2',
+              'el-span-warning': row.status == 1,
+              'el-span-success': row.status == 2,
+              'el-span-danger': row.status == 3,
             }"
           >
             {{ row.status | statusFilters }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="发布时间" prop="registerTime" width="100">
+      <el-table-column align="center" label="发布时间" prop="saveTime" width="100" />
+      <el-table-column label="操作" align="center" width="300">
         <template slot-scope="{row}">
-          <span>{{ row.registerTime }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="handleDetail(row)">查看资料</el-button>
+          <el-button type="primary" size="mini" @click="handleDetail(row)">查看详情</el-button>
           <el-button v-if="row.status === 1" type="warning" size="mini" @click="hanleVerify(row)">置为已完成</el-button>
         </template>
       </el-table-column>
     </el-table>
     <!-- 页码 -->
     <pagination
+      v-show="total>10"
       :total="total"
-      :page-sizes="[20]"
-      :page-size="20"
+      :page-sizes="[10]"
+      :page-size="10"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
-      @pagination="getclubList"
+      @pagination="getList"
     />
   </div>
 </template>
 
 <script>
-import { getClubList, createOperator, updateStatus } from '@/api/club'
-import Pagination from '@/components/Pagination'
-
+import { getList, buyDone } from '@/api/centralized'
+import pickerOptions from '@/utils/time-picker.js'
 export default {
-  components: { Pagination },
   filters: {
     statusFilters(value) {
       console.log('value', value)
       // 处理状态显示
       const map = {
-        '0': '未完成',
-        '1': '已完成',
-        '2': '已删除'
+        1: '未完成',
+        2: '已完成',
+        3: '已删除'
       }
       return map[value]
     }
   },
   data() {
     return {
-      pageNum: 0,
-      list: [
-        {
-          name: 'CH2天然净化防御精萃净化去味',
-          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-          bindMobile: '158888888888',
-          clubName: '深圳联合丽格宝安店',
-          linkMan: '哈利波特',
-          numb: 10,
-          address: '上步南路10001锦峰大厦',
-          status: 0,
-          registerTime: '2023-04-14 14:45:39',
-          id: 121
-        },
-        {
-          name: 'CH2天然净化防御精萃净化去味',
-          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-          bindMobile: '158888888888',
-          clubName: '深圳联合丽格宝安店',
-          linkMan: '哈利波特',
-          numb: 10,
-          address: '上步南路10001锦峰大厦',
-          status: 1,
-          registerTime: '2023-04-14 14:45:39',
-          id: 121
-        },
-        {
-          name: 'CH2天然净化防御精萃净化去味',
-          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-          bindMobile: '158888888888',
-          clubName: '深圳联合丽格宝安店',
-          linkMan: '哈利波特',
-          numb: 10,
-          address: '上步南路10001锦峰大厦',
-          status: 2,
-          registerTime: '2023-04-14 14:45:39',
-          id: 121
-        },
-        {
-          name: 'CH2天然净化防御精萃净化去味',
-          image: 'https://img0.baidu.com/it/u=3979949991,2513156939&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-          bindMobile: '158888888888',
-          clubName: '深圳联合丽格宝安店',
-          linkMan: '哈利波特',
-          numb: 10,
-          address: '上步南路10001锦峰大厦',
-          status: 1,
-          registerTime: '2023-04-14 14:45:39',
-          id: 121
-        }
-      ],
+      registTime: '',
+      pickerOptions,
+      list: [],
       listLoading: true,
       total: 0,
       listQuery: {
         pageNum: 1,
-        pageSize: 20,
-        userorganizeId: this.$store.getters.organizeId,
-        userName: '',
-        linkMan: '',
-        bindMobile: '',
-        clubStatus: '',
-        startTime: '',
-        endTime: ''
-      },
-      startTime: '',
-      endTime: '',
-      addPeople: {
+        pageSize: 10,
+        productName: '',
         status: '',
-        text: ''
-      },
-      updateTemp: {},
-      updateTatusType: '',
-      dialogVisible: false,
-      dialogVisibleText: '',
-      dialogStatus: '',
-      loadingbut: false,
-      rules: {
-        linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        status: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
-        text: [{ required: true, message: '请填写原因', trigger: 'blur' }],
-        mobile: [
-          { required: true, message: '手机号码不能为空', trigger: 'blur' },
-          {
-            required: true,
-            pattern: /^\d{11}|\d{13}$/,
-            message: '手机号格式不正确',
-            trigger: 'blur'
-          }
-        ]
+        clubName: '',
+        startSaveTime: '',
+        endSaveTime: ''
       }
     }
   },
@@ -226,86 +139,53 @@ export default {
     }
   },
   created() {
-    this.listLoading = false
-    // this.fetchData()
+    this.getList()
   },
   methods: {
-    fetchData() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.registTime && this.registTime.length > 0) {
+        this.listQuery.startSaveTime = this.registTime[0]
+        this.listQuery.endSaveTime = this.registTime[1]
+      } else {
+        this.listQuery.startSaveTime = ''
+        this.listQuery.endSaveTime = ''
+      }
+    },
+    async getList() {
       this.listLoading = true
-      getClubList(this.listQuery).then(response => {
-        const data = response.data
-        this.list = data.results
+      try {
+        this.initTime()
+        const res = await getList(this.listQuery)
+        this.list = res.data.results
+        this.total = res.data.totalRecord
         this.listLoading = false
-        this.total = data.totalRecord
-        this.pageNum = data.index
-      }).catch(() => {
-        // 封装静态数据
-      })
+      } catch (error) {
+        console.log('error', error)
+        this.listLoading = false
+      }
     },
+    // 置为已完成
     hanleVerify(row) {
-      // 审核
-      this.dialogFormVisible = true
-    },
-    handleEdit(row) { // 添加运营
-      console.log(row)
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.addPeople = Object.assign({}, { clubID: row.clubID, userID: row.userID })
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-      })
-    },
-    handleCreateOperator() { // 保存
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          const Formobj = { userorganizeId: this.$store.getters.organizeId, configFlag: 1 }
-          const params = Object.assign(Formobj, this.addPeople)
-          this.loadingbut = true
-          createOperator(params).then(response => {
-            this.$message({ message: response.msg, type: 'success', center: true })
-            this.dialogFormVisible = false
-            this.loadingbut = false
-          }).catch(() => {
-            this.loadingbut = false
-          })
-        }
-      })
-    },
-    handOnline(row) {
-      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
-      this.$confirm('确定上线该门店吗?上线后门店负责人可使用账号密码登录小程序。', '系统提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        const params = Object.assign({}, this.updateTemp)
-        this.updateClubStatus(params)
-      }).catch(() => {
-      })
-    },
-    handOffline(row) {
-      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
-      this.$confirm('确定下线该门店吗?下线后该门店将不能在小程序进行采购。', '系统提示', {
+      this.$confirm('确定将该需求置为已完成吗?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        const params = Object.assign({}, this.updateTemp)
-        this.updateClubStatus(params)
-      }).catch(() => {
+        this.buyDone(row.id)
       })
     },
-    updateClubStatus(params) {
-      updateStatus(params).then(response => {
-        if (response.code === '1') {
-          this.$message({ message: response.msg, type: 'success', center: true })
-          this.list = []
-          this.fetchData()
-        } else {
-          this.$message.error(response.msg)
-        }
-      })
+    // 调用
+    async buyDone(id) {
+      try {
+        await buyDone({ id: id })
+        this.$message.success('操作成功')
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
     },
+    // 集采详情
     handleDetail(row) {
       this.$router.push({ path: '/centralized/details', query: { id: row.id }})
     },
@@ -320,13 +200,4 @@ export default {
   .el-dialog{
     width: 600px;
   }
-  .el-span-status{
-    color: #606266;
-  }
-  .el-span-sStatus{
-    color: #67C23A;
-  }
-  .el-span-eStatus{
-    color: #F56C6C;
-  }
 </style>

+ 142 - 117
src/views/club/list.vue

@@ -1,49 +1,44 @@
 <template>
   <div class="app-container">
-    <div class="app-header-search">
-      <el-form class="demo-form-inline">
-        <el-form-item label="门店名称:" style="width:280px;float: left;">
-          <el-input v-model="listQuery.userName" placeholder="请输入机构名称" maxlength="50" style="width:200px;" @keyup.enter.native="getList" />
-        </el-form-item>
-        <el-form-item label="联系人:" style="width:230px;float: left;">
-          <el-input v-model="listQuery.linkMan" placeholder="请输入联系人姓名" maxlength="10" style="width:150px" @keyup.enter.native="getList" />
-        </el-form-item>
-        <el-form-item label="手机号:" style="width:200px;float: left;">
-          <el-input v-model="listQuery.bindMobile" placeholder="请输入手机号" maxlength="11" style="width:130px" @keyup.enter.native="getList" />
-        </el-form-item>
-        <el-form-item label="状态:" style="width:190px;float: left;">
-          <el-select v-model="listQuery.clubStatus" placeholder="请选择" style="width:100px" value="" @change="getList">
-            <el-option label="全部" value="" />
-            <el-option label="已上线" value="90" />
-            <el-option label="已下线" value="91" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="注册时间:" style="width:410px;float: left;">
-          <el-date-picker
-            v-model="listQuery.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择日期"
-            style="width: 150px;"
-          />
-          至
-          <el-date-picker
-            v-model="listQuery.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择日期"
-            style="width: 150px;"
-          />
-        </el-form-item>
-        <el-form-item style="width:100px;float: left;">
-          <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
-        </el-form-item>
-        <el-form-item style="width:100px;float: left;">
-          <router-link :to="'/club/form/'">
-            <el-button type="primary" icon="el-icon-plus">上线机构</el-button>
-          </router-link>
-        </el-form-item>
-      </el-form>
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>机构名称:</span>
+        <el-input v-model="listQuery.userName" style="width:130px;" placeholder="请输入机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>联系人:</span>
+        <el-input v-model="listQuery.linkMan" style="width:130px;" placeholder="请输入联系人姓名" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>手机号:</span>
+        <el-input v-model="listQuery.bindMobile" style="width:130px;" placeholder="请输入手机号" clearable @keyup.enter.native="getList" @clear="getList" />
+      </div>
+      <div class="filter-control">
+        <span>状态:</span>
+        <el-select v-model="listQuery.clubStatus" style="width:120px;" clearable @change="getList">
+          <el-option value="" label="全部" />
+          <el-option label="待审核" :value="1" />
+          <el-option label="已上线" :value="90" />
+          <el-option label="已上线" :value="91" />
+          <el-option label="审核未通过" :value="92" />
+        </el-select>
+      </div>
+      <div class="filter-control">
+        <span>注册时间:</span>
+        <el-date-picker
+          v-model="registTime"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      </div>
     </div>
     <el-table
       v-loading="listLoading"
@@ -54,24 +49,36 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column label="门店名称" width="180" align="center" prop="userName" />
-      <el-table-column label="联系人" width="100" align="center" prop="linkMan" />
-      <el-table-column label="手机号" width="140" align="center" prop="bindMobile" />
+      <el-table-column label="机构名称" align="center" prop="userName" />
+      <el-table-column label="联系人" align="center" prop="linkMan" width="150" />
+      <el-table-column label="手机号" align="center" prop="bindMobile" width="150" />
       <el-table-column align="center" label="机构地址" prop="address">
         <template slot-scope="{row}">
-          <span>{{ `${row.province}${row.city}${row.town}${row.address}` }}</span>
+          <span>
+            {{ row.province }}
+            {{ row.city }}
+            {{ row.town ? row.town : '' }}
+            {{ row.address ? row.address :'' }}
+          </span>
         </template>
       </el-table-column>
-      <el-table-column label="上线状态" width="150" align="center" prop="status">
+      <el-table-column label="状态" align="center" prop="status" width="150">
         <template slot-scope="{row}">
-          <el-tag v-if="row.clubStatus*1===91" type="danger" size="small">已下线</el-tag>
-          <el-tag v-else type="success" size="small">已上线</el-tag>
-          <el-button v-if="row.clubStatus === '91'" type="primary" size="mini" @click="handOnline(row)">上线</el-button>
-          <el-button v-else type="primary" size="mini" @click="handOffline(row)">下线</el-button>
+          <template v-if="row.clubStatus*1===1">
+            <el-tag type="warning" size="small">待审核</el-tag>
+          </template>
+          <template v-else-if="row.clubStatus*1===92">
+            <el-tag type="danger" size="small">审核未通过</el-tag>
+          </template>
+          <template v-else>
+            <el-tag v-if="row.clubStatus*1===91" type="danger" size="small">已下线</el-tag>
+            <el-tag v-else type="success" size="small">已上线</el-tag>
+            <el-button v-if="row.clubStatus*1 === 91" type="primary" size="mini" @click="handOnline(row)">上线</el-button>
+            <el-button v-else type="primary" size="mini" @click="handOffline(row)">下线</el-button>
+          </template>
         </template>
       </el-table-column>
-
-      <el-table-column align="center" label="注册时间" prop="registerTime" width="100">
+      <el-table-column align="center" label="注册时间" prop="registerTime">
         <template slot-scope="{row}">
           <span>{{ row.registerTime }}</span>
         </template>
@@ -79,27 +86,34 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
           <el-button type="primary" size="mini" @click="handleRecordDetail(row)">查看资料</el-button>
-          <el-button v-if="row.clubStatus === 90" type="warning" size="mini" @click="hanleVerify(row)">审核</el-button>
+          <el-button v-if="row.clubStatus*1 === 1" type="warning" size="mini" @click="hanleVerify(row)">审核</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+    <pagination v-show="total>10" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
     <el-dialog title="审核" :visible.sync="dialogFormVisible" width="440px">
-      <el-form ref="dataForm" :rules="rules" :model="addPeople" label-position="right" label-width="120px">
-        <el-form-item label="状态:">
-          <el-select v-model="addPeople.status" placeholder="请选择">
+      <el-form ref="dataForm" :rules="rules" :model="auditPeople" label-position="right" label-width="120px">
+        <el-form-item label="状态:" prop="auditStatus">
+          <el-select v-model="auditPeople.auditStatus" placeholder="请选择">
             <el-option label="请选择" value="" />
-            <el-option label="审核通过" :value="1" />
-            <el-option label="审核未通过" :value="2" />
+            <el-option label="审核通过" :value="90" />
+            <el-option label="审核不通过" :value="92" />
           </el-select>
         </el-form-item>
-        <el-form-item v-if="addPeople.status===2" label="原因:" prop="text">
-          <el-input v-model="addPeople.text" type="textarea" placeholder="请填写审核未通过原因,50字以内" maxlength="50" :autosize="{ minRows: 5, maxRows: 5}" />
+        <!-- <el-form-item v-if="auditPeople.auditStatus===90" label="机构类型:" prop="organizeType">
+          <el-select v-model="auditPeople.organizeType" placeholder="请选择">
+            <el-option label="请选择" value="" />
+            <el-option label="内部机构" :value="0" />
+            <el-option label="外部机构" :value="1" />
+          </el-select>
+        </el-form-item> -->
+        <el-form-item v-if="auditPeople.auditStatus===92" label="原因:" prop="auditNote">
+          <el-input v-model="auditPeople.auditNote" type="textarea" placeholder="请填写审核不通过原因,50字以内" maxlength="50" :autosize="{ minRows: 5, maxRows: 5}" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible = false">取消</el-button>
-        <el-button type="primary" :disabled="disabled" @click="handleCreateOperator">保存</el-button>
+        <el-button type="primary" @click="handleCreateOperator">确定</el-button>
       </div>
     </el-dialog>
     <template>
@@ -111,18 +125,20 @@
 </template>
 
 <script>
-import { getClubList, createOperator, updateStatus } from '@/api/club'
+import { getClubList, updateStatus, clubAudit } from '@/api/club'
+import pickerOptions from '@/utils/time-picker.js'
 export default {
   data() {
     return {
-      pageNum: 0,
+      registTime: '',
+      pickerOptions,
       list: [],
       listLoading: true,
       total: 0,
       listQuery: {
         index: 1,
-        pageSize: 20,
-        userorganizeId: this.$store.getters.organizeId,
+        pageSize: 10,
+        userOrganizeId: this.$store.getters.organizeId,
         userName: '',
         linkMan: '',
         bindMobile: '',
@@ -132,9 +148,12 @@ export default {
       },
       startTime: '',
       endTime: '',
-      addPeople: {
-        status: '',
-        text: ''
+      auditPeople: {
+        auditStatus: '',
+        auditNote: '',
+        userOrganizeId: this.$store.getters.organizeId,
+        clubId: '',
+        userId: ''
       },
       updateTemp: {},
       updateTatusType: '',
@@ -144,18 +163,9 @@ export default {
       dialogStatus: '',
       loadingbut: false,
       rules: {
-        linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        status: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
-        text: [{ required: true, message: '请填写原因', trigger: 'blur' }],
-        mobile: [
-          { required: true, message: '手机号码不能为空', trigger: 'blur' },
-          {
-            required: true,
-            pattern: /^\d{11}|\d{13}$/,
-            message: '手机号格式不正确',
-            trigger: 'blur'
-          }
-        ]
+        // organizeType: [{ required: true, message: '请选择机构类型', trigger: 'blur' }],
+        auditStatus: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
+        auditNote: [{ required: true, message: '请填写原因', trigger: 'blur' }]
       }
     }
   },
@@ -171,20 +181,33 @@ export default {
     this.getList()
   },
   methods: {
-    getList() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.registTime && this.registTime.length > 0) {
+        this.listQuery.startTime = this.registTime[0]
+        this.listQuery.endTime = this.registTime[1]
+      } else {
+        this.listQuery.startTime = ''
+        this.listQuery.endTime = ''
+      }
+    },
+    async getList() {
       this.listLoading = true
-      getClubList(this.listQuery).then(response => {
-        const data = response.data
-        this.list = data.results
+      try {
+        this.initTime()
+        const res = await getClubList(this.listQuery)
+        this.list = res.data.results
+        this.total = res.data.totalRecord
         this.listLoading = false
-        this.total = data.totalRecord
-        this.pageNum = data.index
-      }).catch(() => {
-        // 封装静态数据
-      })
+      } catch (error) {
+        console.log('error', error)
+        this.listLoading = false
+      }
     },
     hanleVerify(row) {
       // 审核
+      this.auditPeople.userId = row.userId
+      this.auditPeople.clubId = row.clubId
       this.dialogFormVisible = true
     },
     handleEdit(row) { // 添加运营
@@ -196,24 +219,28 @@ export default {
         this.$refs['dataForm'].clearValidate()
       })
     },
-    handleCreateOperator() { // 保存
+    handleCreateOperator() { // 确认审核
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          const Formobj = { userorganizeId: this.$store.getters.organizeId, configFlag: 1 }
-          const params = Object.assign(Formobj, this.addPeople)
-          this.loadingbut = true
-          createOperator(params).then(response => {
-            this.$message({ message: response.msg, type: 'success', center: true })
-            this.dialogFormVisible = false
-            this.loadingbut = false
-          }).catch(() => {
-            this.loadingbut = false
-          })
+          this.clubAudit(this.auditPeople)
+        } else {
+          return false
         }
       })
     },
+    // 审核
+    async clubAudit(params) {
+      try {
+        await clubAudit(params)
+        this.$message.success('操作成功')
+        this.getList()
+        this.dialogFormVisible = false
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
     handOnline(row) {
-      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
+      this.updateTemp = Object.assign({}, { clubId: row.clubId, userId: row.userId, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
       this.$confirm('确定上线该门店吗?上线后门店负责人可使用账号密码登录小程序。', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -225,7 +252,7 @@ export default {
       })
     },
     handOffline(row) {
-      this.updateTemp = Object.assign({}, { clubID: row.clubID, userID: row.userID, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
+      this.updateTemp = Object.assign({}, { clubId: row.clubId, userId: row.userId, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
       this.$confirm('确定下线该门店吗?下线后该门店将不能在小程序进行采购。', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -236,19 +263,17 @@ export default {
       }).catch(() => {
       })
     },
-    updateClubStatus(params) {
-      updateStatus(params).then(response => {
-        if (response.code === '1') {
-          this.$message({ message: response.msg, type: 'success', center: true })
-          this.list = []
-          this.fetchData()
-        } else {
-          this.$message.error(response.msg)
-        }
-      })
+    async updateClubStatus(params) {
+      try {
+        const res = await updateStatus(params)
+        this.$message.success(res.msg)
+        this.getList()
+      } catch (error) {
+        this.$message.error(error.msg)
+      }
     },
     handleRecordDetail(row) {
-      this.$router.push({ path: '/club/details', query: { clubId: row.clubID }})
+      this.$router.push({ path: '/club/details', query: { clubId: row.clubId }})
     }
   }
 }

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

@@ -179,7 +179,7 @@ export default {
       searchTimeVal: '',
       total: 0,
       listQuery: {
-        organizeId: 0,
+        organizeId: this.$store.getters.organizeId,
         pageNum: 1,
         pageSize: 20,
         receiptId: '', // 收款ID

+ 378 - 0
src/views/finance/payapply-edit.vue

@@ -0,0 +1,378 @@
+<template>
+  <div class="app-container">
+    <el-card class="box-card" style="margin: 0 auto;">
+      <el-form ref="payFrom" :model="payRepacts" :rules="rules" label-width="120px">
+        <h1 class="app-title">付款单</h1>
+        <div class="refund-item">
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="24">
+              <el-form-item label="付款单名称:" prop="name">
+                <el-input v-model="payRepacts.name" placeholder="请输入付款单名称" style="width: 250px" size="mini" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="24"><b>供应商名称:</b> {{ payRepacts.shopName }}</el-col>
+          </el-row>
+          <h1 style="font-size: 14px;color: #409EFF;">付款账号:</h1>
+          <h1 style="font-size: 14px;">采美账号:</h1>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="5">
+              <el-form-item label="户名:" prop="cmBankAccountName">
+                <el-input v-model="payRepacts.cmBankAccountName" placeholder="请输入银行户名" style="width: 150px" size="mini" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="账号:" prop="cmBankAccount">
+                <el-input v-model="payRepacts.cmBankAccount" placeholder="请输入银行账户" style="width: 250px" size="mini" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="开户行:" prop="cmBankName">
+                <el-input v-model="payRepacts.cmBankName" placeholder="输入开户行" style="width: 200px" size="mini" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="账户类型:" prop="cmType">
+                <el-select v-model="payRepacts.cmType" placeholder="请选择">
+                  <el-option label="公账" :value="0" />
+                  <el-option label="私账" :value="1" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <h1 style="font-size: 14px;">供应商账号:</h1>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="5">
+              <el-form-item label="户名:" prop="bankAccountName">
+                <el-input v-model="payRepacts.bankAccountName" placeholder="请输入银行户名" style="width: 150px" size="mini" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="账号:" prop="bankAccount">
+                <el-input v-model="payRepacts.bankAccount" placeholder="请输入银行账户" style="width: 250px" size="mini" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="开户行:" prop="bankName">
+                <el-input v-model="payRepacts.bankName" placeholder="输入开户行" style="width: 200px" size="mini" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="账户类型:" prop="type">
+                <el-select v-model="payRepacts.type" placeholder="请选择">
+                  <el-option label="公账" :value="0" />
+                  <el-option label="私账" :value="1" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div v-for="(shopOrder,index) in payRepacts.shopOrders" :key="index" class="refund-item">
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="6"><b>订单编号(ID):</b> {{ shopOrder.orderNo }}({{ shopOrder.orderId }})</el-col>
+            <el-col :span="4"><b>下单时间:</b> {{ shopOrder.orderTime }}</el-col>
+            <el-col :span="4"><b>订单金额:</b> <span class="el-span-danger">{{ shopOrder.payTotalFee }}</span></el-col>
+            <el-col :span="10">
+              <b>所有子订单:</b>
+              <span v-for="child in shopOrder.shopOrderNos" :key="child">
+                【{{ child }}】
+              </span>
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="6"><b>机构名称:</b> {{ shopOrder.buyer }}</el-col>
+            <el-col :span="4"><b>机构运费:</b>
+              <span v-if="shopOrder.freight === 0">包邮</span>
+              <span v-else-if="shopOrder.freight === -1">到付</span>
+              <span v-else-if="shopOrder.freight === -2">仪器到付-产品包邮</span>
+              <span v-else>{{ shopOrder.freight ? shopOrder.freight : '0.00' }}</span>
+            </el-col>
+            <el-col :span="4"><b>收款状态:</b>
+              <span
+                :class="{
+                  'el-span-warning': shopOrder.orderReceiptStatus == 1,
+                  'el-span-success': shopOrder.orderReceiptStatus == 2,
+                  'el-span-danger': shopOrder.orderReceiptStatus == 3
+                }"
+              >
+                {{ shopOrder.orderReceiptStatus | receiptStatusFilter }}
+              </span>
+            </el-col>
+            <el-col :span="10">
+              <b>收款金额:</b>
+              <span class="el-span-danger">{{ shopOrder.receiptTotalFee | amountfilters }}</span>
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="6"><b>子订单编号(ID):</b> {{ shopOrder.shopOrderNo }}({{ shopOrder.shopOrderId }})</el-col>
+            <el-col :span="4"><b>子订单佣金:</b>
+              <span class="el-span-danger"> {{ shopOrder.brokerage | amountfilters }}  </span>
+            </el-col>
+            <el-col :span="4"><b>商品费:</b> {{ shopOrder.productAmount | amountfilters }}</el-col>
+            <el-col :span="10"><b>付款状态:</b> {{ shopOrder.payStatus | payStatusFilter }}</el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="6"><b>供应商名称:</b> {{ shopOrder.shopName }}</el-col>
+            <el-col :span="18"><b>供应商运费:</b>
+              <el-input v-model="shopOrder.shopPostFee" style="width: 100px;" size="mini" />
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="24">
+              <b>付供应商:</b>
+              <b style="margin-left: 10px;">应付采美:</b>
+              <span class="el-span-danger"> {{ shopOrder.shouldPayCmAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">已付采美:</b>
+              <span class="el-span-danger"> {{ shopOrder.payCmAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">待付采美:</b>
+              <el-input v-model="shopOrder.waitPayCmAmount" style="width: 100px;" size="mini" />
+              <b style="margin-left: 10px;">应付供应商:</b>
+              <span class="el-span-danger"> {{ shopOrder.shouldPayShopAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">已付供应商:</b>
+              <span class="el-span-danger"> {{ shopOrder.payedShopAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">待付供应商:</b>
+              <el-input v-model="shopOrder.waitPayShop" style="width: 100px;" size="mini" />
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-table :data="shopOrder.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+              <el-table-column label="商品名" align="center" prop="name" />
+              <el-table-column label="规格" align="center" prop="unit" />
+              <el-table-column label="数量" align="center" prop="num" />
+              <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum">
+                <template slot-scope="{row}">
+                  <span>{{ row.returnedPurchaseProductNum ? row.returnedPurchaseProductNum : 0 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="单价" align="center" prop="price">
+                <template slot-scope="{row}">
+                  {{ row.price | amountfilters }}
+                </template>
+              </el-table-column>
+              <el-table-column label="总价" align="center" prop="totalFee">
+                <template slot-scope="{row}">
+                  {{ row.totalFee | amountfilters }}
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-row>
+        </div>
+        <div class="refund-item">
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="5"><b>付供应商总金额:</b>
+              <span class="el-span-danger"> {{ totalShopTotalAmount | amountfilters }} </span>
+            </el-col>
+            <el-col :span="6"><b>付采美总金额:</b>
+              <span class="el-span-danger"> {{ totalCmTotalAmount | amountfilters }}  </span>
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="5"><b>申请人:</b> {{ payRepacts.applicantName }}  </el-col>
+          </el-row>
+        </div>
+      </el-form>
+    </el-card>
+    <div class="filter-container" style="text-align: center;margin-top: 20px;">
+      <el-button type="primary" @click="hanldeSubmit('payFrom')">提交付款单</el-button>
+      <el-button plain @click="backToList">返回</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getApplyPays, getPayDetails, subPayApply } from '@/api/finance'
+export default {
+  name: 'PayapplyEdit',
+  filters: {
+    statusFilter(status) {
+      const map = {
+        0: '待审核',
+        1: '审核通过',
+        2: '审核不通过'
+      }
+      return map[status]
+    },
+    receiptStatusFilter(status) {
+      const map = {
+        1: '待收款',
+        2: '部分收款',
+        3: '已收款'
+      }
+      return map[status]
+    },
+    payStatusFilter(status) {
+      const map = {
+        1: '待付款',
+        2: '部分付款',
+        3: '已付款'
+      }
+      return map[status]
+    }
+  },
+  data() {
+    return {
+      payRepacts: {},
+      rules: {
+        name: [{ required: true, message: '请填写付款单名称', trigger: 'blur' }],
+        cmBankAccountName: [{ required: true, message: '付采美户名不能为空', trigger: 'blur' }],
+        cmBankAccount: [{ required: true, message: '付采美账号不能为空', trigger: 'blur' }],
+        cmBankName: [{ required: true, message: '付采美开户行不能为空', trigger: 'blur' }],
+        bankAccountName: [{ required: true, message: '付供应商开户行不能为空', trigger: 'blur' }],
+        bankAccount: [{ required: true, message: '付供应商开户行不能为空', trigger: 'blur' }],
+        bankName: [{ required: true, message: '付供应商开户行不能为空', trigger: 'blur' }],
+        cmType: [{ required: true, message: '请选择付采美账户类型', trigger: 'blur' }],
+        type: [{ required: true, message: '请选择付供应商账户类型', trigger: 'blur' }]
+      },
+      applyType: ''
+    }
+  },
+  computed: {
+    shopOrderIds() {
+      return JSON.parse(this.$route.query.shopOrderIds)
+    },
+    totalCmTotalAmount() {
+      let payCmTotalAmount = 0
+      const shopOrders = this.payRepacts.shopOrders
+      shopOrders.forEach(item => {
+        payCmTotalAmount += item.waitPayCmAmount
+      })
+      return payCmTotalAmount
+    },
+    totalShopTotalAmount() {
+      let waitPayShop = 0
+      const shopOrders = this.payRepacts.shopOrders
+      shopOrders.forEach(item => {
+        waitPayShop += item.waitPayShop
+      })
+      return waitPayShop
+    }
+  },
+  created() {
+    if (this.$route.query.type === 'edit') {
+      this.applyType = this.$route.query.type
+      this.getPayDetails(this.$route.query.payShopId)
+    } else {
+      this.getApplyPays()
+    }
+  },
+  methods: {
+    // 付款单详情
+    async getApplyPays() {
+      try {
+        const res = await getApplyPays(this.shopOrderIds)
+        this.payRepacts = res.data
+        this.payRepacts.applicantName = this.$store.getters.name
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 付款单详情
+    async getPayDetails(payShopId) {
+      try {
+        const res = await getPayDetails(payShopId)
+        this.payRepacts = res.data
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 提交付款申请
+    hanldeSubmit(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.$confirm('确定要提交申请吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('payRepacts', this.payRepacts)
+            this.payRepacts.totalAmount = this.totalShopTotalAmount
+            this.payRepacts.payCmTotalAmount = this.totalCmTotalAmount
+            this.subPayApply(this.payRepacts)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    async subPayApply(params) {
+      try {
+        const res = await subPayApply(params)
+        this.$message.success('提交成功')
+        setTimeout(() => {
+          this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+            this.$nextTick(() => {
+              this.$router.push({ path: '/finance/payment-details', query: { payShopId: res.data }})
+            })
+          })
+        }, 1000)
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    backToList() {
+      let path = ''
+      if (this.applyType === 'edit') {
+        path = '/finance/payment-list'
+      } else {
+        path = '/finance/payapply-list'
+      }
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({
+            path: path
+          })
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+  .app-title{
+    line-height: 36px;
+    font-size: 26px;
+    font-weight: bold;
+    color: #409EFF;
+    text-align: center;
+    margin: 0;
+  }
+  .box-card{
+    margin-top: 20px;
+    font-size: 14px;
+  }
+  .box-row{
+    padding: 10px 0;
+  }
+  .box-row .dropdown{
+    margin-top: -10px;
+  }
+  .refund-item{
+    padding: 10px 0;
+  }
+  .order-item{
+    background:#f7f7f7;
+    margin-bottom: 20px;
+    padding: 10px 15px;
+    border-radius: 5px;
+  }
+  .product-row{
+    padding: 10px 0;
+    background: #EBEEF5;
+    border-top: 1px dashed #DCDFE6;
+  }
+  .op-item{
+    padding: 5px 0;
+  }
+  .el-span-warning{
+  color: #E6A23C;
+}
+.el-span-success{
+  color: #67C23A;
+}
+.el-span-danger{
+  color: #F56C6C;
+}
+</style>
+

+ 155 - 198
src/views/finance/payapply-list.vue

@@ -3,31 +3,31 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>子订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderId" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>子订单编号:</span>
-        <el-input v-model="listQuery.orderID" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderNo" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单编号:</span>
-        <el-input v-model="listQuery.orderNumber" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderNo" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>供应商:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopName" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>机构名称:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.clubName" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>付款状态:</span>
-        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
           <el-option value="" label="所有" />
           <el-option label="未付款" value="0" />
           <el-option label="部分付款" value="1" />
@@ -48,7 +48,7 @@
       </div>
       <div class="filter-control">
         <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
-        <el-button type="success" icon="el-icon-document-add" @click="getList">付款申请</el-button>
+        <el-button type="success" :disabled="!orderRadio" icon="el-icon-document-add" @click="handleApplySub">付款申请</el-button>
       </div>
     </div>
     <el-table
@@ -65,15 +65,25 @@
       <el-table-column type="selection" width="40" />
       <el-table-column label="商品信息" type="expand" width="50">
         <template slot-scope="{row}">
-          <el-table :data="row.products" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
-            <el-table-column label="商品名" align="center" prop="productName" />
+          <el-table :data="row.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+            <el-table-column label="商品名" align="center" prop="name" />
             <el-table-column label="规格" align="center" prop="unit" />
             <el-table-column label="数量" align="center" prop="num" />
-            <el-table-column label="退货" align="center" prop="returnNum" />
-            <el-table-column label="单价" align="center" prop="price" />
-            <el-table-column label="总价" align="center" prop="totalPrice" />
-            <el-table-column label="成本(单)" align="center" prop="costPrice" />
-            <el-table-column label="成本(总)" align="center" prop="totalCostPrice" />
+            <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum">
+              <template slot-scope="scope">
+                <span>{{ scope.row.returnedPurchaseProductNum ? scope.row.returnedPurchaseProductNum : 0 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="单价" align="center" prop="price">
+              <template slot-scope="scope">
+                <span>{{ scope.row.price | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="总价" align="center" prop="totalFee">
+              <template slot-scope="scope">
+                <span>{{ scope.row.totalFee | amountfilters }}</span>
+              </template>
+            </el-table-column>
           </el-table>
         </template>
       </el-table-column>
@@ -87,61 +97,103 @@
           <span>{{ row.shopOrderNo }}({{ row.shopOrderId }})</span>
         </template>
       </el-table-column>
-      <el-table-column label="订单金额" align="center" prop="payableAmount" />
-      <el-table-column label="收款金额" align="center" prop="payableAmount" />
-      <el-table-column prop="status" label="收款状态" align="center">
+      <el-table-column label="订单金额" align="center" prop="payTotalFee">
+        <template slot-scope="{row}">
+          <span>{{ row.payTotalFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收款金额" align="center" prop="receiptTotalFee">
+        <template slot-scope="{row}">
+          <span>{{ row.receiptTotalFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收款状态" align="center" prop="orderReceiptStatus">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
+              'el-span-warning': row.orderReceiptStatus == 1 || row.orderReceiptStatus == 3,
+              'el-span-success': row.orderReceiptStatus == 2
             }"
           >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            {{ row.orderReceiptStatus | receiptStatusFilter }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column prop="status" label="付款状态" align="center">
+      <el-table-column label="付款状态" align="center" prop="payStatus">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 2
+              'el-span-warning': row.payStatus == 1,
+              'el-span-success': row.payStatus == 2,
+              'el-span-danger': row.payStatus == 3
             }"
           >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            {{ row.payStatus | payStatusFilter }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column label="商品费" align="center" prop="verifyTime" />
-      <el-table-column label="机构" align="center" prop="clubName" />
-      <el-table-column label="机构运费" align="center" prop="clubName" />
+      <el-table-column label="商品费" align="center" prop="productAmount">
+        <template slot-scope="{row}">
+          <span>{{ row.productAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="机构" align="center" prop="buyer" />
+      <el-table-column label="机构运费" align="center" prop="freight">
+        <template slot-scope="{row}">
+          <span v-if="row.freight === 0">包邮</span>
+          <span v-else-if="row.freight === -1">到付</span>
+          <span v-else-if="row.freight === -2">仪器到付-产品包邮</span>
+          <span v-else>{{ row.freight ? row.freight : '0.00' }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="供应商" align="center" prop="shopName" />
-      <el-table-column label="供应商运费" align="center" prop="verifyMan" />
-      <el-table-column label="付供应商" align="center" prop="payableAmount" />
+      <el-table-column label="供应商运费" align="center" prop="shopPostFee">
+        <template slot-scope="{row}">
+          <span>{{ row.shopPostFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付采美" align="center" prop="waitPayCmAmount">
+        <template slot-scope="{row}">
+          <span class="el-span-danger">{{ row.waitPayCmAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付供应商" align="center" prop="shouldPayShopAmount">
+        <template slot-scope="{row}">
+          <span class="el-span-danger">{{ row.shouldPayShopAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <el-button type="text" size="mini" @click="handleToRecord(row.id)">修改成本</el-button>
           <el-button type="text" size="mini" @click="handleToRecord(row.id)">退/付款记录</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
   </div>
 </template>
 
 <script>
-import { getClubList } from '@/api/club'
-import Pagination from '@/components/Pagination'
+import { getPayOrderList } from '@/api/finance'
 import pickerOptions from '@/utils/time-picker.js'
 
 export default {
-  components: { Pagination },
   filters: {
+    receiptStatusFilter(status) {
+      const map = {
+        1: '待收款',
+        2: '部分收款',
+        3: '已收款'
+      }
+      return map[status]
+    },
+    payStatusFilter(status) {
+      const map = {
+        1: '待付款',
+        2: '部分付款',
+        3: '已付款'
+      }
+      return map[status]
+    },
     statusFilter(status) {
       const map = {
         0: '待付款',
@@ -153,171 +205,85 @@ export default {
   },
   data() {
     return {
+      time: '',
       list: null,
       pickerOptions,
       listLoading: true,
-      searchTimeVal: '',
       total: 0,
       listQuery: {
-        page: 1,
-        limit: 10,
-        importance: undefined,
-        title: undefined,
-        type: undefined,
-        sort: '+id'
-      },
-      search: {
-
-      },
-      form: {
-        classifyName: '',
-        telephone: '',
-        contacts: '',
-        businessNum: '',
-        address: '',
-        radio: 1,
-        status: '请选择',
-        imageUrl: '',
-        doorwayImageUrl: ''
-      },
-      addPeople: {
-        classifyName: '',
-        telephone: ''
+        listType: 1, // 1申请付款 2子订单分账 3子订单结算
+        organizeId: this.$store.getters.organizeId,
+        pageNum: 1,
+        pageSize: 20,
+        shopName: '', // 供应商名称
+        clubName: '', // 机构名称
+        orderNo: '', // 订单编号
+        orderId: '', // 订单ID
+        payShopId: '', // 付款单
+        orderStartTime: '', // 下单开始时间
+        orderEndTime: '', // 下单结束时间
+        shopOrderId: '', // 子订单ID
+        shopOrderNo: '', // 子订单编号
+        status: '' // 付款状态
       },
-      updateTatusId: '',
-      updateTatusType: '',
-      dialogVisible: false,
-      dialogVisibleText: '',
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        update: '添加运营人员',
-        create: 'Create',
-        titleText: '系统提示'
-      },
-      rules: {
-        classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        telephone: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
-      }
+      orderRadio: null
     }
   },
   created() {
     this.getList()
   },
   methods: {
-    getList() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.time && this.time.length > 0) {
+        this.listQuery.orderStartTime = this.time[0]
+        this.listQuery.orderEndTime = this.time[1]
+      } else {
+        this.listQuery.orderStartTime = ''
+        this.listQuery.orderEndTime = ''
+      }
+    },
+    async getList() {
       this.listLoading = true
-      getClubList().then(response => {
-        this.list = response.data.items
+      try {
+        const res = await getPayOrderList(this.listQuery)
+        this.list = res.data.list
+        this.listLoading = false
+      } catch (error) {
+        console.log('error', error)
         this.listLoading = false
-      }).catch(() => {
-        // 封装静态数据
-        this.list = [
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0,
-            totalProduct: '3000.00',
-            payShopTotal: '3000.00',
-            products: [
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          },
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0,
-            totalProduct: '3000.00',
-            payShopTotal: '3000.00',
-            products: [
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
+      }
+    },
+    // 多选子订单
+    handleSelectionChange(row) {
+      this.orderRadio = row
+      console.log('orderRadio', this.orderRadio)
+    },
+    // 付款申请
+    handleApplySub() {
+      console.log('flag', this.checkForDuplicates(this.orderRadio))
+      if (this.checkForDuplicates(this.orderRadio)) {
+        this.$alert('应付多个订单时,它们必须属于同一个供应商!', '提示', {
+          confirmButtonText: '确定'
+        })
+      } else {
+        const newArr = this.orderRadio.map(item => item.shopOrderId)
+        this.$router.push({ path: '/finance/payapply-edit', query: { shopOrderIds: JSON.stringify(newArr) }})
+      }
+    },
+    // 数组是否有重复
+    checkForDuplicates(arr, id = 'shopId') {
+      const newShopArr = []
+      let flag = false
+      for (const item of arr) {
+        newShopArr.push(item[id])
+        for (const el of newShopArr) {
+          if (item[id] !== el) {
+            flag = true
           }
-        ]
-      })
-      this.listLoading = false
+        }
+      }
+      return flag
     },
     handleToRecord(id) {
       this.$router.push({ path: '/finance/payment-record', query: { id: id }})
@@ -335,13 +301,4 @@ export default {
   line-height: 34px !important;
   padding: 0 !important;
 }
-.el-span-warning{
-  color: #E6A23C;
-}
-.el-span-success{
-  color: #67C23A;
-}
-.el-span-danger{
-  color: #F56C6C;
-}
 </style>

+ 190 - 203
src/views/finance/paycents-list.vue

@@ -3,27 +3,27 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>子订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderId" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>子订单编号:</span>
-        <el-input v-model="listQuery.orderID" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderNo" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单编号:</span>
-        <el-input v-model="listQuery.orderNumber" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderNo" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>供应商:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopName" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>机构名称:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.clubName" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>下单时间:</span>
@@ -40,94 +40,152 @@
       </div>
       <div class="filter-control">
         <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
-        <el-button type="success" icon="el-icon-document-add" @click="getList">申请分账</el-button>
+        <el-button type="success" :disabled="!orderRadio" icon="el-icon-document-add" @click="handleApplySub">申请分账</el-button>
       </div>
     </div>
-    <p style="margin: 0;line-height: 24px;font-size: 14px;color: #F56C6C;">注:每次选择一个子订单申请分账,系统将自动分配佣金。付供应商的金额依然还在合利宝账户,需要再进行手动结算。</p>
     <el-table
+      ref="table"
       v-loading="listLoading"
       :data="list"
       element-loading-text="Loading"
       border
       fit
-      highlight-current-row
+      default-expand-all
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
-      @selection-change="handleSelectionChange"
+      @select="handleSelectionChange"
     >
-      <el-table-column type="selection" width="40" />
+      <el-table-column type="selection" width="50" />
       <el-table-column label="商品信息" type="expand" width="50">
         <template slot-scope="{row}">
-          <el-table :data="row.products" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
-            <el-table-column label="商品名" align="center" prop="productName" />
+          <el-table :data="row.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+            <el-table-column label="商品名" align="center" prop="name" />
             <el-table-column label="规格" align="center" prop="unit" />
             <el-table-column label="数量" align="center" prop="num" />
-            <el-table-column label="退货" align="center" prop="returnNum" />
-            <el-table-column label="单价" align="center" prop="price" />
-            <el-table-column label="总价" align="center" prop="totalPrice" />
+            <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum">
+              <template slot-scope="scope">
+                <span>{{ scope.row.returnedPurchaseProductNum ? scope.row.returnedPurchaseProductNum : 0 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="单价" align="center" prop="price">
+              <template slot-scope="scope">
+                <span>{{ scope.row.price | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="总价" align="center" prop="totalFee">
+              <template slot-scope="scope">
+                <span>{{ scope.row.totalFee | amountfilters }}</span>
+              </template>
+            </el-table-column>
           </el-table>
         </template>
       </el-table-column>
-      <el-table-column label="订单编号(ID)" align="center" prop="orderNo" width="240">
+      <el-table-column label="订单编号(ID)" align="center" prop="orderNo">
         <template slot-scope="{row}">
           <span>{{ row.orderNo }}({{ row.orderId }})</span>
         </template>
       </el-table-column>
-      <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNo" width="240">
+      <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNo">
         <template slot-scope="{row}">
           <span>{{ row.shopOrderNo }}({{ row.shopOrderId }})</span>
         </template>
       </el-table-column>
-      <el-table-column label="下单时间" align="center" prop="verifyTime" width="90" />
-      <el-table-column label="订单金额" align="center" prop="payableAmount" />
-      <el-table-column label="收款金额" align="center" prop="payableAmount" />
-      <el-table-column label="商品费" align="center" prop="verifyMan" />
-      <el-table-column label="机构" align="center" prop="clubName" />
-      <el-table-column label="机构运费" align="center" prop="clubName" />
-      <el-table-column label="供应商" align="center" prop="shopName" />
-      <el-table-column label="供应商运费" align="center" prop="verifyMan" />
-      <el-table-column label="付供应商" align="center" prop="payableAmount" />
-      <el-table-column prop="status" label="收款状态" align="center">
+      <el-table-column label="订单金额" align="center" prop="payTotalFee">
+        <template slot-scope="{row}">
+          <span>{{ row.payTotalFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收款金额" align="center" prop="receiptTotalFee">
+        <template slot-scope="{row}">
+          <span>{{ row.receiptTotalFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收款状态" align="center" prop="orderReceiptStatus">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
+              'el-span-warning': row.orderReceiptStatus == 1 || row.orderReceiptStatus == 3,
+              'el-span-success': row.orderReceiptStatus == 2
             }"
           >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            {{ row.orderReceiptStatus | receiptStatusFilter }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column prop="status" label="结算状态" align="center">
+      <el-table-column label="付款状态" align="center" prop="payStatus">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 2
+              'el-span-warning': row.payStatus == 1,
+              'el-span-success': row.payStatus == 2,
+              'el-span-danger': row.payStatus == 3
             }"
           >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            {{ row.payStatus | payStatusFilter }}
           </span>
         </template>
       </el-table-column>
-
+      <el-table-column label="商品费" align="center" prop="productAmount">
+        <template slot-scope="{row}">
+          <span>{{ row.productAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="机构" align="center" prop="buyer" />
+      <el-table-column label="机构运费" align="center" prop="freight">
+        <template slot-scope="{row}">
+          <span v-if="row.freight === 0">包邮</span>
+          <span v-else-if="row.freight === -1">到付</span>
+          <span v-else-if="row.freight === -2">仪器到付-产品包邮</span>
+          <span v-else>{{ row.freight ? row.freight : '0.00' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="供应商" align="center" prop="shopName" />
+      <el-table-column label="供应商运费" align="center" prop="shopPostFee">
+        <template slot-scope="{row}">
+          <span>{{ row.shopPostFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付采美" align="center" prop="waitPayCmAmount">
+        <template slot-scope="{row}">
+          <span class="el-span-danger">{{ row.waitPayCmAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付供应商" align="center" prop="shouldPayShopAmount">
+        <template slot-scope="{row}">
+          <span class="el-span-danger">{{ row.shouldPayShopAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center">
+        <template slot-scope="{row}">
+          <el-button type="text" size="mini" @click="handleToRecord(row.id)">退/付款记录</el-button>
+        </template>
+      </el-table-column>
     </el-table>
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
   </div>
 </template>
 
 <script>
-import { getClubList } from '@/api/club'
-import Pagination from '@/components/Pagination'
+import { getPayOrderList, subPaySplit } from '@/api/finance'
 import pickerOptions from '@/utils/time-picker.js'
 
 export default {
-  components: { Pagination },
   filters: {
+    receiptStatusFilter(status) {
+      const map = {
+        1: '待收款',
+        2: '部分收款',
+        3: '已收款'
+      }
+      return map[status]
+    },
+    payStatusFilter(status) {
+      const map = {
+        1: '待付款',
+        2: '部分付款',
+        3: '已付款'
+      }
+      return map[status]
+    },
     statusFilter(status) {
       const map = {
         0: '待付款',
@@ -139,187 +197,116 @@ export default {
   },
   data() {
     return {
+      time: '',
       list: null,
       pickerOptions,
       listLoading: true,
-      searchTimeVal: '',
       total: 0,
       listQuery: {
-        page: 1,
-        limit: 10,
-        importance: undefined,
-        title: undefined,
-        type: undefined,
-        sort: '+id'
-      },
-      search: {
-
-      },
-      form: {
-        classifyName: '',
-        telephone: '',
-        contacts: '',
-        businessNum: '',
-        address: '',
-        radio: 1,
-        status: '请选择',
-        imageUrl: '',
-        doorwayImageUrl: ''
+        listType: 2, // 1申请付款 2子订单分账 3子订单结算
+        organizeId: this.$store.getters.organizeId,
+        pageNum: 1,
+        pageSize: 20,
+        shopName: '', // 供应商名称
+        clubName: '', // 机构名称
+        orderNo: '', // 订单编号
+        orderId: '', // 订单ID
+        payShopId: '', // 付款单
+        orderStartTime: '', // 下单开始时间
+        orderEndTime: '', // 下单结束时间
+        shopOrderId: '', // 子订单ID
+        shopOrderNo: '', // 子订单编号
+        status: '' // 付款状态
       },
-      addPeople: {
-        classifyName: '',
-        telephone: ''
-      },
-      updateTatusId: '',
-      updateTatusType: '',
-      dialogVisible: false,
-      dialogVisibleText: '',
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        update: '添加运营人员',
-        create: 'Create',
-        titleText: '系统提示'
-      },
-      rules: {
-        classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        telephone: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
-      }
+      orderRadio: null,
+      splitParams: []
     }
   },
   created() {
     this.getList()
   },
   methods: {
-    getList() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.time && this.time.length > 0) {
+        this.listQuery.orderStartTime = this.time[0]
+        this.listQuery.orderEndTime = this.time[1]
+      } else {
+        this.listQuery.orderStartTime = ''
+        this.listQuery.orderEndTime = ''
+      }
+    },
+    async getList() {
       this.listLoading = true
-      getClubList().then(response => {
-        this.list = response.data.items
+      try {
+        const res = await getPayOrderList(this.listQuery)
+        this.list = res.data.list
         this.listLoading = false
-      }).catch(() => {
-        // 封装静态数据
-        this.list = [
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0,
-            totalProduct: '3000.00',
-            payShopTotal: '3000.00',
-            products: [
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          },
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0,
-            totalProduct: '3000.00',
-            payShopTotal: '3000.00',
-            products: [
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          }
-        ]
+      } catch (error) {
+        console.log('error', error)
+        this.listLoading = false
+      }
+    },
+    // 单选子订单
+    handleSelectionChange(selection, row) {
+      const listArray = []
+      this.$refs.table.clearSelection()
+      this.$refs.table.toggleRowSelection(row)
+      this.orderRadio = row
+      listArray.push(row.shopOrderId)
+      this.splitParams = listArray.map(item => { return item })
+    },
+    // 付款分账
+    handleApplySub() {
+      this.$confirm('确定申请分账吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.subPaySplit(this.splitParams)
       })
-      this.listLoading = false
     },
-    onSubmit() {
-      console.log('search')
+    // 调用分账
+    async subPaySplit(params) {
+      try {
+        const res = await subPaySplit(params)
+        this.$message.success(res.msg)
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 数组是否有重复
+    checkForDuplicates(arr, id = 'shopId') {
+      const newShopArr = []
+      let flag = false
+      for (const item of arr) {
+        newShopArr.push(item[id])
+        for (const el of newShopArr) {
+          if (item[id] !== el) {
+            flag = true
+          }
+        }
+      }
+      return flag
+    },
+    handleToRecord(id) {
+      this.$router.push({ path: '/finance/payment-record', query: { id: id }})
     }
   }
 }
 
 </script>
-<style scoped>
-.el-span-warning{
-  color: #E6A23C;
+<style lang="scss" scoped>
+::v-deep{
+  thead .el-checkbox{display: none !important;}
 }
-.el-span-success{
-  color: #67C23A;
+::v-deep .el-table__expanded-cell[class*=cell]{
+  padding:10px 10px !important;
 }
-.el-span-danger{
-  color: #F56C6C;
+::v-deep .el-table__row td {
+  height: 34px !important;
+  line-height: 34px !important;
+  padding: 0 !important;
 }
 </style>
+

+ 174 - 462
src/views/finance/payfinance-list.vue

@@ -3,77 +3,63 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>子订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderId" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>子订单编号:</span>
-        <el-input v-model="listQuery.orderID" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderNo" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单编号:</span>
-        <el-input v-model="listQuery.orderNumber" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderNo" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>供应商:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopName" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>机构名称:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.clubName" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>收款状态:</span>
-        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+        <el-select v-model="listQuery.receiptStatus" style="width:120px;" clearable @change="getList">
           <el-option value="" label="所有" />
-          <el-option label="待审核" value="0" />
-          <el-option label="审核通过" value="1" />
-          <el-option label="审核不通过" value="2" />
+          <el-option label="待收款" :value="1" />
+          <el-option label="部分收款" :value="2" />
+          <el-option label="已收款" :value="3" />
         </el-select>
       </div>
       <div class="filter-control">
         <span>付款状态:</span>
-        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+        <el-select v-model="listQuery.payStatus" style="width:120px;" clearable @change="getList">
           <el-option value="" label="所有" />
-          <el-option label="待审核" value="0" />
-          <el-option label="审核通过" value="1" />
-          <el-option label="审核不通过" value="2" />
+          <el-option label="待付款" :value="1" />
+          <el-option label="部分付款" :value="2" />
+          <el-option label="已付款" :value="3" />
         </el-select>
       </div>
       <div class="filter-control">
         <span>退款状态:</span>
-        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+        <el-select v-model="listQuery.refundType" style="width:120px;" clearable @change="getList">
           <el-option value="" label="所有" />
-          <el-option label="待审核" value="0" />
-          <el-option label="审核通过" value="1" />
-          <el-option label="审核不通过" value="2" />
+          <el-option label="部分退款" :value="1" />
+          <el-option label="全部退款" :value="2" />
         </el-select>
       </div>
       <div class="filter-control">
         <span>结算状态:</span>
-        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+        <el-select v-model="listQuery.settleStatus" style="width:120px;" clearable @change="getList">
           <el-option value="" label="所有" />
-          <el-option label="待审核" value="0" />
-          <el-option label="审核通过" value="1" />
-          <el-option label="审核不通过" value="2" />
+          <el-option label="未结算" :value="1" />
+          <el-option label="部分结算" :value="2" />
+          <el-option label="已结算" :value="3" />
         </el-select>
       </div>
-      <div class="filter-control">
-        <span>下单时间:</span>
-        <el-date-picker
-          v-model="time"
-          type="daterange"
-          unlink-panels
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :picker-options="pickerOptions"
-          @change="getList"
-        />
-      </div>
       <div class="filter-control">
         <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
       </div>
@@ -93,30 +79,69 @@
       </el-table-column>
       <el-table-column label="子订单信息" type="expand" width="60">
         <template slot-scope="{row}">
-          <el-table :data="row.shopOrderIdList" border fit highlight-current-row default-expand-all :header-cell-style="{background:'#e9f3f7',color:'#606266'}">
+          <el-table :data="row.newShopOrders" border fit highlight-current-row default-expand-all :header-cell-style="{background:'#e9f3f7',color:'#606266'}">
             <el-table-column label="商品信息" type="expand" width="80px">
               <template slot-scope="scope">
-                <el-table :data="scope.row.products" border fit highlight-current-row :header-cell-style="{background:'#f9f9f9',color:'#606266'}">
-                  <el-table-column label="商品名" align="center" prop="productName" />
+                <el-table :data="scope.row.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#f9f9f9',color:'#606266'}">
+                  <el-table-column label="商品名" align="center" prop="name" />
                   <el-table-column label="规格" align="center" prop="unit" />
                   <el-table-column label="数量" align="center" prop="num" />
-                  <el-table-column label="退货" align="center" prop="returnNum" />
+                  <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum" />
                   <el-table-column label="单价" align="center" prop="price" />
-                  <el-table-column label="总价" align="center" prop="totalPrice" />
+                  <el-table-column label="总价" align="center" prop="totalAmount" />
                 </el-table>
               </template>
             </el-table-column>
             <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNos" width="240">
               <template slot-scope="scope">
-                <span>{{ scope.row.shopOrderNos }}({{ scope.row.shopOrderIds }})</span>
+                <span v-for="child in scope.row.shopOrderNos" :key="child">
+                  {{ child }}
+                </span>
+              </template>
+            </el-table-column>
+            <el-table-column label="结算状态" align="center" prop="settleStatus">
+              <template slot-scope="scope">
+                <el-tag v-if="scope.row.settleStatus===1" type="danger" size="small">未结算</el-tag>
+                <el-tag v-if="scope.row.settleStatus===2" type="warning" size="small">部分结算</el-tag>
+                <el-tag v-if="scope.row.settleStatus===3" type="success" size="small">已结算</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column label="应结金额" align="center" prop="payableAmount">
+              <template slot-scope="scope">
+                <span>{{ scope.row.payableAmount | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="已结金额" align="center" prop="payableAmount">
+              <template slot-scope="scope">
+                <span>{{ scope.row.payableAmount | amountfilters }}</span>
               </template>
             </el-table-column>
             <el-table-column label="供应商" align="center" prop="shopName" />
-            <el-table-column label="商品费" align="center" prop="payShopTotals" />
-            <el-table-column label="已付供应商/合作方" align="center" prop="payShopTotals" />
-            <el-table-column label="供应商退款" align="center" prop="payShopTotals" />
-            <el-table-column label="应付供应商/合作方" align="center" prop="payShopTotals" />
-            <el-table-column label="供应商运费" align="center" prop="payShopTotals" />
+            <el-table-column label="商品费" align="center" prop="shopProductAmount">
+              <template slot-scope="scope">
+                <span>{{ scope.row.shopProductAmount | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="已付供应商/合作方" align="center" prop="payedShopAmount">
+              <template slot-scope="scope">
+                <span>{{ scope.row.payedShopAmount | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="供应商退款" align="center" prop="refundAmount">
+              <template slot-scope="scope">
+                <span>{{ scope.row.refundAmount | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="应付供应商/合作方" align="center" prop="shouldPayShopAmount">
+              <template slot-scope="scope">
+                <span>{{ scope.row.shouldPayShopAmount | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="供应商运费" align="center" prop="shopPostFee">
+              <template slot-scope="scope">
+                <span>{{ scope.row.shopPostFee | amountfilters }}</span>
+              </template>
+            </el-table-column>
           </el-table>
         </template>
       </el-table-column>
@@ -125,473 +150,160 @@
           <span>{{ row.orderNo }}({{ row.orderId }})</span>
         </template>
       </el-table-column>
-      <el-table-column label="下单时间" align="center" prop="verifyTime" />
-      <el-table-column label="订单金额" align="center" prop="payableAmount" />
-      <el-table-column label="应收金额" align="center" prop="payableAmount" />
-      <el-table-column label="已收金额" align="center" prop="payableAmount" />
-      <el-table-column label="应付金额" align="center" prop="payableAmount" />
-      <el-table-column label="已付金额" align="center" prop="payableAmount" />
-      <el-table-column label="应结金额" align="center" prop="payableAmount" />
-      <el-table-column label="已结金额" align="center" prop="payableAmount" />
-      <el-table-column label="退款金额" align="center" prop="payableAmount" />
+      <el-table-column label="下单时间" align="center" prop="orderTime" />
+      <el-table-column label="订单金额" align="center" prop="payTotalFee" />
+      <el-table-column label="应收金额" align="center" prop="shouldPayProduct">
+        <template slot-scope="{row}">
+          <span>{{ row.shouldPayProduct | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="已收金额" align="center" prop="alreadyReceipt">
+        <template slot-scope="{row}">
+          <span>{{ row.alreadyReceipt | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付金额" align="center" prop="payableAmount">
+        <template slot-scope="{row}">
+          <span>{{ row.payableAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="已付金额" align="center" prop="paidAmount">
+        <template slot-scope="{row}">
+          <span>{{ row.paidAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="退款金额" align="center" prop="payableAmount">
+        <template slot-scope="{row}">
+          <span>{{ row.payableAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="机构" align="center" prop="clubName" />
-      <el-table-column label="机构运费" align="center" prop="payableAmount" />
-      <el-table-column label="订单状态" prop="status" align="center">
-        <template slot-scope="{ row }">
-          <span
-            :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
-            }"
-          >
-            交易中
-          </span>
+      <el-table-column label="机构运费" align="center" prop="freight">
+        <template slot-scope="{row}">
+          <span v-if="row.freight*1===0">包邮</span>
+          <span v-if="row.freight*1===-1">到付</span>
+          <span v-if="row.freight*1===-2">仪器到付-产品包邮</span>
+          <span v-else>¥{{ row.freight }}</span>
         </template>
       </el-table-column>
-      <el-table-column prop="status" label="收款状态" align="center">
-        <template slot-scope="{ row }">
-          <span
-            :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
-            }"
-          >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
-          </span>
+      <el-table-column label="订单状态" prop="status" align="center">
+        <template slot-scope="{row}">
+          <template v-if="['11','12','13','21','22','23','31','32','33'].indexOf(row.status)>=0">
+            <el-tag type="success" size="small">交易中</el-tag>
+          </template>
+          <template v-else>
+            <el-tag :type="row.status*1===6?'info':''" size="small">{{ row.status | statusFilter }}</el-tag>
+          </template>
         </template>
       </el-table-column>
-      <el-table-column label="付款状态" prop="status" align="center">
-        <template slot-scope="{ row }">
-          <span
-            :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
-            }"
-          >
-            已付款
-          </span>
+      <el-table-column label="收款状态" align="center" prop="receiptStatus">
+        <template slot-scope="{row}">
+          <el-tag v-if="row.receiptStatus*1===1" type="danger" size="small">待收款</el-tag>
+          <el-tag v-if="row.receiptStatus*1===2" type="warning" size="small">部分收款</el-tag>
+          <el-tag v-if="row.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="退款状态" prop="status" align="center">
-        <template slot-scope="{ row }">
-          <span
-            :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
-            }"
-          >
-            无退款
-          </span>
+      <el-table-column label="付款状态" align="center" prop="receiptStatus">
+        <template slot-scope="{row}">
+          <el-tag v-if="row.payStatus*1===1" type="danger" size="small">待付款</el-tag>
+          <el-tag v-if="row.payStatus*1===2" type="warning" size="small">部分付款</el-tag>
+          <el-tag v-if="row.payStatus*1===3" type="success" size="small">已付款</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="结算状态" prop="status" align="center">
-        <template slot-scope="{ row }">
-          <span
-            :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
-            }"
-          >
-            已结算
-          </span>
+      <el-table-column label="退款状态" align="center" prop="receiptStatus">
+        <template slot-scope="{row}">
+          <el-tag v-if="row.refundType*1===1" type="warning" size="small">部分退款</el-tag>
+          <el-tag v-if="row.refundType*1===2" type="success" size="small">全部付款</el-tag>
+          <el-tag v-else type="info" size="small">无退款</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="160">
         <template slot-scope="{row}">
-          <el-button type="text" size="mini" @click="handleToRecord(1,row.id)">收付款记录</el-button>
-          <el-button type="text" size="mini" @click="handleToRecord(2,row.id)">用户退款/退货记录</el-button>
-          <el-button type="text" size="mini" @click="handleToRecord(3,row.id)">供应商退/付款记录</el-button>
+          <el-button type="text" size="mini" @click="handleToRecord(1,row.orderId)">收付款记录</el-button>
+          <el-button type="text" size="mini" @click="handleToRecord(2,row.orderId)">用户退款/退货记录</el-button>
+          <!-- <el-button type="text" size="mini" @click="handleToRecord(3,row.orderId)">供应商退/付款记录</el-button> -->
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
+    <pagination v-show="total>10" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
   </div>
 </template>
 
 <script>
-import { getClubList } from '@/api/club'
+import { organizePayInfos } from '@/api/finance'
 import pickerOptions from '@/utils/time-picker.js'
 
 export default {
   filters: {
     statusFilter(status) {
       const map = {
-        0: '待付款',
-        1: '已付款',
-        2: '审核不通过'
+        '0': '待确认',
+        '4': '交易完成',
+        '5': '订单完成',
+        '6': '已关闭',
+        '7': '交易全退',
+        '11': '待收款、待发货',
+        '12': '待收款、部分发货',
+        '13': '待收款、全部发货',
+        '21': '部分收款、待发货',
+        '22': '部分收款、部分发货',
+        '23': '部分收款、全部发货',
+        '31': '全部收款、待发货',
+        '32': '全部收款、部分发货',
+        '33': '全部收款、全部发货'
       }
       return map[status]
     }
   },
   data() {
     return {
-      list: [
-        {
-          id: 7580,
-          name: '微博',
-          type: '子订单付款',
-          shopName: '采美信息技术有限公司',
-          payableAmount: '2000.00',
-          shopOrderNo: 'P1682650952091471001',
-          shopOrderId: '19747',
-          orderNo: 'P16265095220221471',
-          orderId: '18179',
-          clubName: '广州白云区松洲蒂亚美容院',
-          applyMan: '路海珠',
-          applyTime: '2020-01-01:20:30:56',
-          verifyMan: '李昕',
-          verifyTime: '2020-01-01:20:30:56',
-          status: 0,
-          totalProduct: '3000.00',
-          payShopTotal: '3000.00',
-          shopOrderIdList: [
-            {
-              shopName: '采美信息技术有限公司',
-              shopOrderNos: 'P1682650952091471001',
-              shopOrderIds: '19747',
-              orderNos: 'P16265095220221471',
-              orderIds: '18179',
-              clubNames: '广州白云区松洲蒂亚美容院',
-              applyMans: '路海珠',
-              applyTimes: '2020-01-01:20:30:56',
-              verifyMans: '李昕',
-              verifyTimes: '2020-01-01:20:30:56',
-              statuss: 0,
-              totalProducts: '3000.00',
-              payShopTotals: '3000.00',
-              products: [
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                },
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                }
-              ]
-            },
-            {
-              shopName: '采美信息技术有限公司',
-              shopOrderNos: 'P1682650952091471001',
-              shopOrderIds: '19747',
-              orderNos: 'P16265095220221471',
-              orderIds: '18179',
-              clubNames: '广州白云区松洲蒂亚美容院',
-              applyMans: '路海珠',
-              applyTimes: '2020-01-01:20:30:56',
-              verifyMans: '李昕',
-              verifyTimes: '2020-01-01:20:30:56',
-              statuss: 0,
-              totalProducts: '3000.00',
-              payShopTotals: '3000.00',
-              products: [
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                },
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                }
-              ]
-            }
-          ]
-        },
-        {
-          id: 7580,
-          name: '微博',
-          type: '子订单付款',
-          shopName: '采美信息技术有限公司',
-          payableAmount: '2000.00',
-          shopOrderNo: 'P1682650952091471001',
-          shopOrderId: '19747',
-          orderNo: 'P16265095220221471',
-          orderId: '18179',
-          clubName: '广州白云区松洲蒂亚美容院',
-          applyMan: '路海珠',
-          applyTime: '2020-01-01:20:30:56',
-          verifyMan: '李昕',
-          verifyTime: '2020-01-01:20:30:56',
-          status: 0,
-          totalProduct: '3000.00',
-          payShopTotal: '3000.00',
-          shopOrderIdList: [
-            {
-              shopName: '采美信息技术有限公司',
-              shopOrderNos: 'P1682650952091471001',
-              shopOrderIds: '19747',
-              orderNos: 'P16265095220221471',
-              orderIds: '18179',
-              clubNames: '广州白云区松洲蒂亚美容院',
-              applyMans: '路海珠',
-              applyTimes: '2020-01-01:20:30:56',
-              verifyMans: '李昕',
-              verifyTimes: '2020-01-01:20:30:56',
-              statuss: 0,
-              totalProducts: '3000.00',
-              payShopTotals: '3000.00',
-              products: [
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                },
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                }
-              ]
-            },
-            {
-              shopName: '采美信息技术有限公司',
-              shopOrderNos: 'P1682650952091471001',
-              shopOrderIds: '19747',
-              orderNos: 'P16265095220221471',
-              orderIds: '18179',
-              clubNames: '广州白云区松洲蒂亚美容院',
-              applyMans: '路海珠',
-              applyTimes: '2020-01-01:20:30:56',
-              verifyMans: '李昕',
-              verifyTimes: '2020-01-01:20:30:56',
-              statuss: 0,
-              totalProducts: '3000.00',
-              payShopTotals: '3000.00',
-              products: [
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                },
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                }
-              ]
-            }
-          ]
-        },
-        {
-          id: 7580,
-          name: '微博',
-          type: '子订单付款',
-          shopName: '采美信息技术有限公司',
-          payableAmount: '2000.00',
-          shopOrderNo: 'P1682650952091471001',
-          shopOrderId: '19747',
-          orderNo: 'P16265095220221471',
-          orderId: '18179',
-          clubName: '广州白云区松洲蒂亚美容院',
-          applyMan: '路海珠',
-          applyTime: '2020-01-01:20:30:56',
-          verifyMan: '李昕',
-          verifyTime: '2020-01-01:20:30:56',
-          status: 0,
-          totalProduct: '3000.00',
-          payShopTotal: '3000.00',
-          shopOrderIdList: [
-            {
-              shopName: '采美信息技术有限公司',
-              shopOrderNos: 'P1682650952091471001',
-              shopOrderIds: '19747',
-              orderNos: 'P16265095220221471',
-              orderIds: '18179',
-              clubNames: '广州白云区松洲蒂亚美容院',
-              applyMans: '路海珠',
-              applyTimes: '2020-01-01:20:30:56',
-              verifyMans: '李昕',
-              verifyTimes: '2020-01-01:20:30:56',
-              statuss: 0,
-              totalProducts: '3000.00',
-              payShopTotals: '3000.00',
-              products: [
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                },
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                }
-              ]
-            },
-            {
-              shopName: '采美信息技术有限公司',
-              shopOrderNos: 'P1682650952091471001',
-              shopOrderIds: '19747',
-              orderNos: 'P16265095220221471',
-              orderIds: '18179',
-              clubNames: '广州白云区松洲蒂亚美容院',
-              applyMans: '路海珠',
-              applyTimes: '2020-01-01:20:30:56',
-              verifyMans: '李昕',
-              verifyTimes: '2020-01-01:20:30:56',
-              statuss: 0,
-              totalProducts: '3000.00',
-              payShopTotals: '3000.00',
-              products: [
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                },
-                {
-                  productName: '阶雪山之恋保滋润面霜吖',
-                  unit: '50ml',
-                  num: 3,
-                  returnNum: 0,
-                  price: '2000.00',
-                  totalPrice: '6000.00',
-                  costPrice: '1000.00',
-                  totalCostPrice: '3000.00'
-                }
-              ]
-            }
-          ]
-        }
-      ],
+      time: '',
       pickerOptions,
       listLoading: false,
-      searchTimeVal: '',
+      list: [],
       total: 0,
       listQuery: {
-        page: 1,
-        limit: 10,
-        importance: undefined,
-        title: undefined,
-        type: undefined,
-        sort: '+id'
-      },
-      search: {
-
-      },
-      form: {
-        classifyName: '',
-        telephone: '',
-        contacts: '',
-        businessNum: '',
-        address: '',
-        radio: 1,
-        status: '请选择',
-        imageUrl: '',
-        doorwayImageUrl: ''
-      },
-      addPeople: {
-        classifyName: '',
-        telephone: ''
-      },
-      updateTatusId: '',
-      updateTatusType: '',
-      dialogVisible: false,
-      dialogVisibleText: '',
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        update: '添加运营人员',
-        create: 'Create',
-        titleText: '系统提示'
-      },
-      rules: {
-        classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        telephone: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
+        organizeId: this.$store.getters.organizeId,
+        pageNum: 1,
+        pageSize: 10,
+        shopName: '', // 供应商名称
+        clubName: '', // 机构名称
+        orderNo: '', // 订单编号
+        orderId: '', // 订单ID
+        shopOrderId: '', // 子订单ID
+        shopOrderNo: '', // 子订单编号
+        payStatus: '', // 付款状态
+        receiptStatus: '', // 收款状态
+        refundType: '', // 退款状态
+        settleStatus: ''// 结算状态
       }
     }
   },
   created() {
-    // this.getList()
+    this.getList()
   },
   methods: {
-    getList() {
+    async getList() {
       this.listLoading = true
-      getClubList().then(response => {
-        this.list = response.data.items
+      try {
+        const res = await organizePayInfos(this.listQuery)
+        this.list = res.data.list
         this.listLoading = false
-      }).catch(() => {
-        // 封装静态数据
-        this.list = [
-
-        ]
-      })
-      this.listLoading = false
+      } catch (error) {
+        console.log('error', error)
+        this.listLoading = false
+      }
     },
-    handleToRecord(type, id) {
+    handleToRecord(type, orderId) {
       switch (type) {
         case 1:
-          this.$router.push({ path: '/finance/paysettle-record', query: { id: id }})
+          this.$router.push({ path: '/finance/remit-record', query: { orderId: orderId }})
           break
         case 2:
-          this.$router.push({ path: '/finance/refund-record', query: { id: id }})
+          this.$router.push({ path: '/finance/refund-record', query: { orderId: orderId }})
           break
         case 3:
-          this.$router.push({ path: '/finance/shop-record', query: { id: id }})
+          this.$router.push({ path: '/finance/shop-record', query: { orderId: orderId }})
           break
       }
     }

+ 18 - 188
src/views/finance/payfinance-refund-record.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="app-container">
-    <div id="printBox">
+    <el-card v-if="cmReturnedPurchaseList.length === 0" class="box-card" style="text-align:center;color: #999;line-height: 120px;">暂无退款退货记录~</el-card>
+    <div v-else id="printBox">
       <el-card ref="print" class="box-card" style="margin: 5px auto;">
         <div class="refund-item">
           <h1 class="refund-item-title">审核信息</h1>
@@ -145,7 +146,7 @@
 </template>
 
 <script>
-import { getDetail, getRemarks } from '@/api/order'
+import { getRefundRecord } from '@/api/order'
 export default {
   name: 'RefundRecord',
   filters: {
@@ -160,161 +161,10 @@ export default {
   },
   data() {
     return {
-      payRepacts: {
-        name: '卢海珠',
-        account: '6214 8328 2826 4957 ',
-        accountBank: '中国建设银行',
-        accountType: '公账'
-      },
-      repacts: {
-        id: 7580,
-        name: '卢海珠',
-        account: '6214 8328 2826 4957 ',
-        accountBank: '中国建设银行',
-        accountType: '公账',
-        type: '子订单付款',
-        shopName: '采美信息技术有限公司',
-        payableAmount: '20000.00',
-        shopOrderNo: 'P1682650952091471001',
-        shopOrderId: '19747',
-        orderNo: 'P16265095220221471',
-        orderId: '18179',
-        clubName: '广州白云区松洲蒂亚美容院',
-        applyMan: '路海珠',
-        applyTime: '2020-01-01:20:30:56',
-        verifyMan: '李昕',
-        verifyTime: '2020-01-01:20:30:56',
-        status: 0,
-        totalProduct: '3000.00',
-        payShopTotal: '3000.00',
-        childOrderId: ['P16265095220221471', 'P16265095220221471', 'P16265095220221471'],
-        shopOrderIdList: [
-          {
-            shopName: '采美信息技术有限公司',
-            shopOrderNos: 'P1682650952091471001',
-            shopOrderIds: '19747',
-            orderNos: 'P16265095220221471',
-            orderIds: '18179',
-            clubNames: '广州白云区松洲蒂亚美容院',
-            applyMans: '路海珠',
-            applyTimes: '2020-01-01:20:30:56',
-            verifyMans: '李昕',
-            verifyTimes: '2020-01-01:20:30:56',
-            statuss: 0,
-            totalProducts: '3000.00',
-            payShopTotals: '3000.00',
-            products: [
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          },
-          {
-            shopName: '采美信息技术有限公司',
-            shopOrderNos: 'P1682650952091471001',
-            shopOrderIds: '19747',
-            orderNos: 'P16265095220221471',
-            orderIds: '18179',
-            clubNames: '广州白云区松洲蒂亚美容院',
-            applyMans: '路海珠',
-            applyTimes: '2020-01-01:20:30:56',
-            verifyMans: '李昕',
-            verifyTimes: '2020-01-01:20:30:56',
-            statuss: 0,
-            totalProducts: '3000.00',
-            payShopTotals: '3000.00',
-            products: [
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          }
-        ]
-      },
-      products: [
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        },
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        },
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        },
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        }
-      ],
+      payRepacts: {},
+      repacts: {},
+      products: [],
+      cmReturnedPurchaseList: [],
       activeIndex: '2',
       order: null,
       receiptAmount: 0,
@@ -343,42 +193,22 @@ export default {
     }
   },
   computed: {
-    orderID: function() {
-      return this.$route.query.orderID * 1
+    orderId: function() {
+      return this.$route.query.orderId * 1
     }
   },
   created() {
-    // this.fetchData()
+    this.getRefundRecord()
   },
   methods: {
-    fetchData() {
-      this.listLoading = true
-      getDetail({ id: this.orderID }).then(response => {
-        this.order = response.data.order
-        this.bpClauses = response.data.bpClauses
-        this.receiptAmount = response.data.receiptAmount
-        this.returnValue = response.data.returnValue
-        this.returnedPurchaseFee = response.data.returnedPurchaseFee
-        this.listLoading = false
-      }).catch(() => {
-        this.listLoading = false
-      })
-    },
-    RemarksOrder: function(id) {
-      getRemarks({ orderID: id }).then(response => {
-        this.dialogRemarkList = response.data
-      })
-      this.dialogRemarksOrderId = id
-      this.dialogRemarksVisible = true
-    },
-    backToList() {
-      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
-        this.$nextTick(() => {
-          this.$router.replace({
-            path: '/finance/list'
-          })
-        })
-      })
+    async getRefundRecord() {
+      try {
+        const res = await getRefundRecord({ orderId: this.orderId })
+        this.cmReturnedPurchaseList = res.data.cmReturnedPurchaseList
+        console.log('res', res)
+      } catch (error) {
+        console.log('error', error)
+      }
     }
   }
 }

+ 282 - 176
src/views/finance/payment-details.vue

@@ -1,143 +1,286 @@
 <template>
   <div class="app-container">
     <div class="filter-container" style="text-align: right;">
-      <el-button type="primary">审核通过</el-button>
-      <el-button type="danger">审核不通过</el-button>
-      <el-button v-print="printObj" type="primary">打印</el-button>
+      <el-button v-if="detailsType === 'verify' && payRepacts.status === 0" type="primary" @click="handlePayCheck(1)">审核通过</el-button>
+      <el-button v-if="detailsType === 'verify' && payRepacts.status === 0" type="danger" @click="dialogVisible = true">审核不通过</el-button>
+      <el-button v-if="payRepacts.status === 1" v-print="printObj" type="primary">打印</el-button>
     </div>
     <div id="printBox">
       <el-card ref="print" class="box-card" style="margin: 0 auto;">
         <h1 class="app-title">付款单</h1>
         <div class="refund-item">
           <el-row :gutter="24" class="box-row">
-            <el-col :span="24"><b>付款单名称:</b> 采美信息技术有限公司 </el-col>
+            <el-col :span="24"><span style="color: red;">*</span><b>付款单名称:</b> {{ payRepacts.name }} </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="24"><b>供应商名称:</b> 浙江瑞崎科技有限公司</el-col>
+            <el-col :span="24"><b>供应商名称:</b> {{ payRepacts.shopName }}</el-col>
           </el-row>
-          <h1 style="font-size: 14px;">付款账号:</h1>
+          <h1 style="font-size: 14px;color: #409EFF;">付款账号:</h1>
+          <h1 style="font-size: 14px;"><span style="color: red;">*</span>采美账号:</h1>
           <el-row :gutter="24" class="box-row">
             <el-col :span="4"><b>户名:</b>
               <el-input
-                v-model="payRepacts.name"
+                v-model="payRepacts.cmBankAccountName"
                 :disabled="true"
                 clearable
+                size="mini"
                 style="width: 150px;"
               />
             </el-col>
             <el-col :span="6"><b>账号:</b>
               <el-input
-                v-model="payRepacts.account"
+                v-model="payRepacts.cmBankAccount"
                 clearable
+                size="mini"
                 :disabled="true"
                 style="width: 200px;"
               />
             </el-col>
             <el-col :span="6"><b>开户行:</b>
               <el-input
-                v-model="payRepacts.accountBank"
+                v-model="payRepacts.cmBankName"
                 :disabled="true"
+                size="mini"
                 style="width: 150px;"
               />
             </el-col>
-            <el-col :span="6"><b>账户类型:</b>
+            <el-col :span="4"><b>账户类型:</b>
+              <span>{{ payRepacts.type === 0 ?'公账':'私账' }}</span>
+            </el-col>
+          </el-row>
+          <h1 style="font-size: 14px;"><span style="color: red;">*</span>供应商账号:</h1>
+          <el-row :gutter="24" class="box-row">
+            <el-col :span="4"><b>户名:</b>
+              <el-input
+                v-model="payRepacts.bankAccountName"
+                :disabled="true"
+                clearable
+                size="mini"
+                style="width: 150px;"
+              />
+            </el-col>
+            <el-col :span="6"><b>账号:</b>
+              <el-input
+                v-model="payRepacts.bankAccount"
+                clearable
+                size="mini"
+                :disabled="true"
+                style="width: 200px;"
+              />
+            </el-col>
+            <el-col :span="6"><b>开户行:</b>
               <el-input
-                v-model="payRepacts.accountType"
+                v-model="payRepacts.bankName"
                 :disabled="true"
+                size="mini"
                 style="width: 150px;"
               />
             </el-col>
+            <el-col :span="4"><b>账户类型:</b>
+              <span>{{ payRepacts.type === 0 ?'公账':'私账' }}</span>
+            </el-col>
           </el-row>
         </div>
-        <div v-for="(repact,index) in repacts" :key="index" class="refund-item">
+        <div v-for="(shopOrder,index) in payRepacts.shopOrders" :key="index" class="refund-item">
           <el-row :gutter="24" class="box-row">
-            <el-col :span="6"><b>订单编号(ID):</b> {{ repact.orderNo }}({{ repact.orderId }})</el-col>
-            <el-col :span="4"><b>下单时间:</b> {{ repact.applyTime }}</el-col>
-            <el-col :span="4"><b>订单金额:</b> {{ repact.payableAmount }}</el-col>
+            <el-col :span="6"><b>订单编号(ID):</b> {{ shopOrder.orderNo }}({{ shopOrder.orderId }})</el-col>
+            <el-col :span="4"><b>下单时间:</b> {{ shopOrder.orderTime }}</el-col>
+            <el-col :span="4"><b>订单金额:</b> <span class="el-span-danger">{{ shopOrder.payTotalFee }}</span></el-col>
             <el-col :span="10">
               <b>所有子订单:</b>
-              <span v-for="child in repact.childOrderId" :key="child">
+              <span v-for="child in shopOrder.shopOrderNos" :key="child">
                 【{{ child }}】
               </span>
             </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="6"><b>机构名称:</b> {{ repact.clubName }}</el-col>
-            <el-col :span="4"><b>机构运费:</b> 包邮</el-col>
-            <el-col :span="4"><b>收款状态:</b> {{ repact.status | statusFilter }}</el-col>
-            <el-col :span="10"><b>收款金额:</b> {{ repact.payableAmount }}</el-col>
+            <el-col :span="6"><b>机构名称:</b> {{ shopOrder.buyer }}</el-col>
+            <el-col :span="4"><b>机构运费:</b>
+              <span v-if="shopOrder.freight === 0">包邮</span>
+              <span v-else-if="shopOrder.freight === -1">到付</span>
+              <span v-else-if="shopOrder.freight === -2">仪器到付-产品包邮</span>
+              <span v-else>{{ shopOrder.freight ? shopOrder.freight : '0.00' }}</span>
+            </el-col>
+            <el-col :span="4"><b>收款状态:</b>
+              <span
+                :class="{
+                  'el-span-warning': shopOrder.orderReceiptStatus == 1,
+                  'el-span-success': shopOrder.orderReceiptStatus == 2,
+                  'el-span-danger': shopOrder.orderReceiptStatus == 3
+                }"
+              >
+                {{ shopOrder.orderReceiptStatus | receiptStatusFilter }}
+              </span>
+            </el-col>
+            <el-col :span="10">
+              <b>收款金额:</b>
+              <span class="el-span-danger">{{ shopOrder.receiptTotalFee | amountfilters }}</span>
+            </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="6"><b>子订单编号(ID)</b> {{ repact.orderNo }}({{ repact.orderId }})</el-col>
-            <el-col :span="4"><b>子订单佣金:</b> 5000.00</el-col>
-            <el-col :span="4"><b>商品费:</b> {{ repact.payableAmount }}</el-col>
-            <el-col :span="10"><b>付款状态:</b> {{ repact.status | statusFilter }}</el-col>
+            <el-col :span="6"><b>子订单编号(ID):</b> {{ shopOrder.shopOrderNo }}({{ shopOrder.shopOrderId }})</el-col>
+            <el-col :span="4"><b>子订单佣金:</b>
+              <span> {{ shopOrder.brokerage | amountfilters }}  </span>
+            </el-col>
+            <el-col :span="4"><b>商品费:</b> {{ shopOrder.productAmount | amountfilters }}</el-col>
+            <el-col :span="10"><b>付款状态:</b> {{ shopOrder.payStatus | payStatusFilter }}</el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="6"><b>供应商名称:</b> {{ repact.shopName }}</el-col>
-            <el-col :span="4"><b>供应商运费:</b> 15.00</el-col>
+            <el-col :span="6"><b>供应商名称:</b> {{ shopOrder.shopName }}</el-col>
+            <el-col :span="4"><b>供应商运费:</b>
+              <span>{{ shopOrder.shopPostFee | amountfilters }}</span>
+            </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
             <el-col :span="24">
               <b>付供应商:</b>
-              <b style="margin-left: 10px;">应付采美:</b>10000.00
-              <b style="margin-left: 10px;">已付采美:</b>10000.00
-              <b style="margin-left: 10px;">待付采美:</b>0.00
-              <b style="margin-left: 10px;">应付供应商:</b>10000.00
-              <b style="margin-left: 10px;">已付供应商:</b>10000.00
-              <b style="margin-left: 10px;">待付供应商:</b>0.00
+              <b style="margin-left: 10px;">应付采美:</b>
+              <span class="el-span-danger"> {{ shopOrder.shouldPayCmAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">已付采美:</b>
+              <span class="el-span-danger"> {{ shopOrder.payCmAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">待付采美:</b>
+              <span class="el-span-danger"> {{ shopOrder.waitPayCmAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">应付供应商:</b>
+              <span class="el-span-danger"> {{ shopOrder.shouldPayShopAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">已付供应商:</b>
+              <span class="el-span-danger"> {{ shopOrder.payedShopAmount | amountfilters }}  </span>
+              <b style="margin-left: 10px;">待付供应商:</b>
+              <span class="el-span-danger"> {{ shopOrder.waitPayShop | amountfilters }}  </span>
             </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-table :data="repact.products" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
-              <el-table-column label="商品名" align="center" prop="productName" />
+            <el-table :data="shopOrder.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+              <el-table-column label="商品名" align="center" prop="name" />
               <el-table-column label="规格" align="center" prop="unit" />
               <el-table-column label="数量" align="center" prop="num" />
-              <el-table-column label="退货" align="center" prop="returnNum" />
-              <el-table-column label="单价" align="center" prop="price" />
-              <el-table-column label="总价" align="center" prop="totalPrice" />
+              <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum">
+                <template slot-scope="{row}">
+                  <span>{{ row.returnedPurchaseProductNum ? row.returnedPurchaseProductNum : 0 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="单价" align="center" prop="price">
+                <template slot-scope="{row}">
+                  <span>{{ row.price | amountfilters }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="总价" align="center" prop="totalFee">
+                <template slot-scope="{row}">
+                  <span>{{ row.totalFee | amountfilters }}</span>
+                </template>
+              </el-table-column>
             </el-table>
           </el-row>
         </div>
         <div class="refund-item">
           <el-row :gutter="24" class="box-row">
-            <el-col :span="5"><b>付供应商总金额:</b> 480.00 </el-col>
-            <el-col :span="6"><b>付采美总金额:</b> 480.00 </el-col>
+            <el-col :span="5"><b>付供应商总金额:</b>
+              <span class="el-span-danger"> {{ payRepacts.totalAmount | amountfilters }} </span>
+            </el-col>
+            <el-col :span="6"><b>付采美总金额:</b>
+              <span class="el-span-danger"> {{ payRepacts.payCmTotalAmount | amountfilters }}  </span>
+            </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="5"><b>转账支付:</b> 480.00 </el-col>
-            <el-col :span="6"><b>付款银行:</b> 中信银行0897  </el-col>
-            <el-col :span="6"><b>付款时间:</b> 2023-05-05 11:23:05 </el-col>
+            <template v-if="detailsType === 'verify' || detailsType === 'edit'">
+              <el-col :span="5"><b>付款银行:</b>
+                <el-select v-model="checkParams.payType" style="width:150px;" clearable size="mini">
+                  <el-option v-for="item in receiptTypeList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col :span="5"><b>付款银行:</b>{{ payTypeFilters(payRepacts.payType) }} </el-col>
+            </template>
+            <template v-if="detailsType === 'edit'">
+              <el-col :span="6"><b>付款时间:</b>
+                <el-date-picker
+                  v-model="payRepacts.payTime"
+                  type="datetime"
+                  placeholder="选择日期时间"
+                />
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col v-if="payRepacts.payTime" :span="6"><b>付款时间:</b> {{ payRepacts.payTime }} </el-col>
+            </template>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="5"><b>申请人:</b> 卢海珠  </el-col>
-            <el-col :span="8"><b>申请时间:</b> 2023-05-05 10:55:33   </el-col>
+            <el-col :span="5"><b>申请人:</b> {{ payRepacts.applicantName }}  </el-col>
+            <el-col :span="6"><b>申请时间:</b> {{ payRepacts.applyTime }}  </el-col>
           </el-row>
-          <el-row :gutter="24" class="box-row">
-            <el-col :span="5"><b>审核人:</b> 李昕  </el-col>
-            <el-col :span="8"><b>审核时间:</b> 2023-05-05 11:23:05 </el-col>
+          <el-row v-if="payRepacts.reviewerName" :gutter="24" class="box-row">
+            <el-col :span="5"><b>审核人:</b> {{ payRepacts.reviewerName }}  </el-col>
+            <el-col :span="6"><b>审核时间:</b> {{ payRepacts.reviewTime }} </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="24"><b>审核状态:</b> 审核通过 </el-col>
+            <el-col :span="24"><b>审核状态:</b>
+              <span
+                :class="{
+                  'el-span-warning': payRepacts.status == 0,
+                  'el-span-success': payRepacts.status == 1,
+                  'el-span-danger': payRepacts.status == 2
+                }"
+              >
+                {{ payRepacts.status | statusFilter }}
+              </span>
+            </el-col>
+            <el-col v-if="payRepacts.status === 2" :span="20"><b>原因:</b> <span class="el-span-danger">{{ payRepacts.reason }}</span> </el-col>
           </el-row>
         </div>
       </el-card>
+      <div v-if="detailsType === 'edit'" class="filter-container" style="text-align: center;margin-top: 20px;">
+        <el-button type="primary" @click="hanldeConfirm">保存编辑</el-button>
+        <el-button plain @click="backToList">返回</el-button>
+      </div>
     </div>
+    <!-- 不通过审核弹窗 -->
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      width="22%"
+    >
+      <el-input
+        v-model="checkParams.reason"
+        type="textarea"
+        :rows="4"
+        placeholder="请输入不通过原因"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" :disabled="disabled" @click="handlePayCheck(2)">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { getDetail, getRemarks } from '@/api/order'
+import { getPayDetails, getReceiptTypeList, subPayApply, subPayCheck } from '@/api/finance'
 export default {
   name: 'PaymentDetails',
   filters: {
     statusFilter(status) {
       const map = {
-        0: '待付款',
-        1: '已付款',
+        0: '待审核',
+        1: '审核通过',
         2: '审核不通过'
       }
       return map[status]
+    },
+    receiptStatusFilter(status) {
+      const map = {
+        1: '待收款',
+        2: '部分收款',
+        3: '已收款'
+      }
+      return map[status]
+    },
+    payStatusFilter(status) {
+      const map = {
+        1: '待付款',
+        2: '部分付款',
+        3: '已付款'
+      }
+      return map[status]
     }
   },
   data() {
@@ -183,140 +326,102 @@ export default {
         extraCss: '',
         loading: false
       },
-      payRepacts: {
-        name: '卢海珠',
-        account: '6214 8328 2826 4957 ',
-        accountBank: '中国建设银行',
-        accountType: '公账'
+      payRepacts: {},
+      receiptTypeList: [],
+      detailsType: '',
+      dialogVisible: false,
+      checkParams: {
+        id: 0,
+        passCode: 1,
+        payType: ''
+
       },
-      repacts: [
-        {
-          id: 7580,
-          name: '卢海珠',
-          account: '6214 8328 2826 4957 ',
-          accountBank: '中国建设银行',
-          accountType: '公账',
-          type: '子订单付款',
-          shopName: '采美信息技术有限公司',
-          payableAmount: '20000.00',
-          shopOrderNo: 'P1682650952091471001',
-          shopOrderId: '19747',
-          orderNo: 'P16265095220221471',
-          orderId: '18179',
-          clubName: '广州白云区松洲蒂亚美容院',
-          applyMan: '路海珠',
-          applyTime: '2020-01-01:20:30:56',
-          verifyMan: '李昕',
-          verifyTime: '2020-01-01:20:30:56',
-          status: 0,
-          totalProduct: '3000.00',
-          payShopTotal: '3000.00',
-          childOrderId: ['P16265095220221471', 'P16265095220221471', 'P16265095220221471'],
-          products: [
-            {
-              productName: '阶雪山之恋保滋润面霜吖',
-              unit: '50ml',
-              num: 3,
-              returnNum: 0,
-              price: '2000.00',
-              totalPrice: '6000.00',
-              costPrice: '1000.00',
-              totalCostPrice: '3000.00'
-            },
-            {
-              productName: '阶雪山之恋保滋润面霜吖',
-              unit: '50ml',
-              num: 3,
-              returnNum: 0,
-              price: '2000.00',
-              totalPrice: '6000.00',
-              costPrice: '1000.00',
-              totalCostPrice: '3000.00'
-            },
-            {
-              productName: '阶雪山之恋保滋润面霜吖',
-              unit: '50ml',
-              num: 3,
-              returnNum: 0,
-              price: '2000.00',
-              totalPrice: '6000.00',
-              costPrice: '1000.00',
-              totalCostPrice: '3000.00'
-            },
-            {
-              productName: '阶雪山之恋保滋润面霜吖',
-              unit: '50ml',
-              num: 3,
-              returnNum: 0,
-              price: '2000.00',
-              totalPrice: '6000.00',
-              costPrice: '1000.00',
-              totalCostPrice: '3000.00'
-            }
-          ]
-        }
-      ],
-      activeIndex: '2',
-      order: null,
-      receiptAmount: 0,
-      returnValue: 0,
-      returnedPurchaseFee: 0,
-      bpClauses: null,
-      dialogRemarkList: [],
-      dialogRemarksVisible: false,
-      dialogRemarksOrderId: 0,
-      statusObj: {
-        '0': '待确认',
-        '4': '交易完成',
-        '5': '订单完成',
-        '6': '已关闭',
-        '7': '交易全退',
-        '11': '待收款、待发货',
-        '12': '待收款、部分发货',
-        '13': '待收款、全部发货',
-        '21': '部分收款、待发货',
-        '22': '部分收款、部分发货',
-        '23': '部分收款、全部发货',
-        '31': '全部收款、待发货',
-        '32': '全部收款、部分发货',
-        '33': '全部收款、全部发货'
+      rules: {
+        reason: [{ required: true, message: '请填写不通过原因', trigger: 'blur' }]
       }
     }
   },
   computed: {
-    orderID: function() {
-      return this.$route.query.orderID * 1
+    payShopId: function() {
+      return this.$route.query.payShopId * 1
+    },
+    disabled() {
+      return !this.checkParams.reason
     }
   },
   created() {
-    // this.fetchData()
+    if (this.$route.query.type) {
+      this.detailsType = this.$route.query.type
+    }
+    this.getPayDetails()
+    this.getReceiptTypeList()
   },
   methods: {
-    fetchData() {
-      this.listLoading = true
-      getDetail({ id: this.orderID }).then(response => {
-        this.order = response.data.order
-        this.bpClauses = response.data.bpClauses
-        this.receiptAmount = response.data.receiptAmount
-        this.returnValue = response.data.returnValue
-        this.returnedPurchaseFee = response.data.returnedPurchaseFee
-        this.listLoading = false
-      }).catch(() => {
-        this.listLoading = false
-      })
+    // 付款单详情
+    async getPayDetails() {
+      try {
+        const res = await getPayDetails(this.payShopId)
+        console.log('res', res)
+        this.payRepacts = res.data
+      } catch (error) {
+        console.log('error', error)
+      }
     },
-    RemarksOrder: function(id) {
-      getRemarks({ orderID: id }).then(response => {
-        this.dialogRemarkList = response.data
+    // 获取收款账号列表
+    async getReceiptTypeList() {
+      const res = await getReceiptTypeList()
+      this.receiptTypeList = res.data
+      this.checkParams.payType = res.data[0].id
+    },
+    payTypeFilters(value) {
+      // 收款账号
+      let valueText = ''
+      this.receiptTypeList.forEach(type => {
+        if (value === type.id) { valueText = type.name } else { valueText = '---' }
       })
-      this.dialogRemarksOrderId = id
-      this.dialogRemarksVisible = true
+      console.log('valueText', valueText)
+      return valueText
+    },
+    hanldeConfirm() {
+      // 保存编辑
+      this.payRepacts.operateMode = 1
+      this.subPayApply(this.payRepacts)
+    },
+    async subPayApply(params) {
+      // 执行保存
+      try {
+        await subPayApply(params)
+        this.$message.success('提交成功')
+        this.backToList()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    handlePayCheck(type) {
+      // 审核
+      if (type === 1) {
+        this.checkParams.reason = ''
+      }
+      this.checkParams.id = this.payRepacts.payShopId
+      this.checkParams.passCode = type
+      this.subPayCheck(this.checkParams)
+    },
+    async subPayCheck(params) {
+      // 执行审核
+      try {
+        await subPayCheck(params)
+        this.$message.success('审核成功')
+        this.checkParams.reason = ''
+        this.backToList()
+      } catch (error) {
+        console.log('error', error)
+      }
     },
     backToList() {
       this.$store.dispatch('tagsView/delView', this.$route).then(() => {
         this.$nextTick(() => {
           this.$router.replace({
-            path: '/finance/list'
+            path: '/finance/payment-list'
           })
         })
       })
@@ -332,6 +437,7 @@ export default {
     font-weight: bold;
     color: #409EFF;
     text-align: center;
+    margin: 0;
   }
   .box-card{
     margin-top: 20px;
@@ -361,13 +467,13 @@ export default {
     padding: 5px 0;
   }
   .el-span-warning{
-  color: #E6A23C;
-}
-.el-span-success{
-  color: #67C23A;
-}
-.el-span-danger{
-  color: #F56C6C;
-}
+    color: #E6A23C;
+  }
+  .el-span-success{
+    color: #67C23A;
+  }
+  .el-span-danger{
+    color: #F56C6C;
+  }
 </style>
 

+ 162 - 162
src/views/finance/payment-list.vue

@@ -3,45 +3,45 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>子订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderId" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>子订单编号:</span>
-        <el-input v-model="listQuery.orderID" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderNo" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单编号:</span>
-        <el-input v-model="listQuery.orderNumber" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderNo" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>付款单ID:</span>
-        <el-input v-model="listQuery.orderNumber" style="width:120px;" placeholder="付款单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.payShopId" style="width:120px;" placeholder="付款单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>供应商:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopName" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>付款单名称:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="付款单名称" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.name" style="width:200px;" placeholder="付款单名称" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>付款审核状态:</span>
-        <el-select v-model="listQuery.sendOutStatus" style="width:120px;" clearable @change="getList">
+        <el-select v-model="listQuery.status" style="width:120px;" clearable @change="getList">
           <el-option value="" label="所有" />
-          <el-option label="待审核" value="0" />
-          <el-option label="审核通过" value="1" />
-          <el-option label="审核不通过" value="2" />
+          <el-option label="待审核" :value="0" />
+          <el-option label="审核通过" :value="1" />
+          <el-option label="审核不通过" :value="2" />
         </el-select>
       </div>
       <div class="filter-control">
         <span>申请时间:</span>
         <el-date-picker
-          v-model="time"
+          v-model="applyTime"
           type="daterange"
           unlink-panels
           range-separator="至"
@@ -54,7 +54,7 @@
       <div class="filter-control">
         <span>付款时间:</span>
         <el-date-picker
-          v-model="time"
+          v-model="payTime"
           type="daterange"
           unlink-panels
           range-separator="至"
@@ -78,27 +78,50 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column label="付款单ID" align="center" prop="id" width="80" />
+      <el-table-column label="付款单ID" align="center" prop="payShopId" width="80" />
       <el-table-column label="付款单名称" align="center" prop="name" width="100" />
-      <el-table-column label="付款类型" align="center" prop="type" width="100" />
       <el-table-column label="供应商" align="center" prop="shopName" />
-      <el-table-column label="付款金额" align="center" prop="payableAmount" width="120" />
-      <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNo">
+      <el-table-column label="付款金额" align="center" prop="totalAmount" width="120" />
+      <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNos" width="230">
         <template slot-scope="{row}">
-          <span>{{ row.shopOrderNo }}({{ row.shopOrderId }})</span>
+          <p v-for="item in row.shopOrderNos" :key="item" style="margin: 0;">
+            {{ item ? item : '---' }}
+          </p>
         </template>
       </el-table-column>
-      <el-table-column label="订单编号(ID)" align="center" prop="orderNo">
+      <el-table-column label="订单编号(ID)" align="center" prop="orderNos" width="230">
         <template slot-scope="{row}">
-          <span>{{ row.orderNo }}({{ row.orderId }})</span>
+          <p v-for="item in row.orderNos" :key="item" style="margin: 0;">
+            {{ item ? item : '---' }}
+          </p>
         </template>
       </el-table-column>
-      <el-table-column label="机构" align="center" prop="clubName" />
-      <el-table-column label="申请人" align="center" prop="applyMan" width="80" />
-      <el-table-column label="申请日期" align="center" prop="applyTime" width="100" />
-      <el-table-column label="审核人" align="center" prop="verifyMan" width="80" />
-      <el-table-column label="审核时间" align="center" prop="verifyTime" width="100" />
-      <el-table-column prop="status" label="付款审核状态" align="center" width="100">
+      <el-table-column label="机构" align="center" prop="clubName">
+        <template slot-scope="{row}">
+          {{ row.clubName ? row.clubName : '---' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="申请人" align="center" prop="applicantName" width="100">
+        <template slot-scope="{row}">
+          {{ row.applicantName ? row.applicantName : '---' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="申请日期" align="center" prop="applyTime" width="100">
+        <template slot-scope="{row}">
+          {{ row.applyTime ? row.applyTime : '---' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="审核人" align="center" prop="reviewerName" width="100">
+        <template slot-scope="{row}">
+          {{ row.reviewerName ? row.reviewerName : '---' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="审核时间" align="center" prop="reviewTime" width="100">
+        <template slot-scope="{row}">
+          {{ row.reviewTime ? row.reviewTime : '---' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="付款审核状态" prop="status" align="center" width="100">
         <template slot-scope="{ row }">
           <span
             :class="{
@@ -108,42 +131,40 @@
             }"
           >
             {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.reason }}</span>
           </span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <el-button type="text" size="mini" @click="handleOperate(1,row.id)">查看详情</el-button>
+          <el-button type="text" size="mini" @click="handleOperate(1,row.payShopId)">查看详情</el-button>
           <template v-if="row.status === 0">
-            <el-button type="text" size="mini" @click="handleToEdit(2,row.id)">申请付款</el-button>
-            <el-button type="text" size="mini" @click="handleOperate(3,row.id)">取消付款</el-button>
-            <el-button type="text" size="mini" @click="handleOperate(4,row.id)">付款审核</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(2,row.payShopId)">修改申请</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(3,row.payShopId)">取消付款</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(4,row.payShopId)">付款审核</el-button>
           </template>
           <template v-if="row.status === 1">
-            <el-button type="text" size="mini" @click="handleOperate(5,row.id)">编辑</el-button>
-            <el-button type="text" size="mini" @click="handleOperate(6,row.id)">撤销付款</el-button>
-            <el-button type="text" size="mini" @click="handleOperate(1,row.id)">打印</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(5,row.payShopId)">编辑</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(6,row.payShopId)">撤销付款</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(1,row.payShopId)">打印</el-button>
           </template>
           <template v-if="row.status === 2">
-            <el-button type="text" size="mini" @click="handleOperate(2,row.id)">申请付款</el-button>
-            <el-button type="text" size="mini" @click="handleOperate(3,row.id)">取消付款</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(2,row.payShopId)">重申付款</el-button>
+            <el-button type="text" size="mini" @click="handleOperate(3,row.payShopId)">取消付款</el-button>
           </template>
         </template>
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
+    <pagination v-show="total>10" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
   </div>
 </template>
 
 <script>
-import { getClubList } from '@/api/club'
-import Pagination from '@/components/Pagination'
+import { getOrganizePayList, cancelPayApply, cancelPayBack } from '@/api/finance'
 import pickerOptions from '@/utils/time-picker.js'
 
 export default {
-  components: { Pagination },
   filters: {
     statusFilter(status) {
       const map = {
@@ -156,52 +177,28 @@ export default {
   },
   data() {
     return {
-      time: '',
+      payTime: '',
+      applyTime: '',
       list: null,
       pickerOptions,
       listLoading: true,
-      searchTimeVal: '',
       total: 0,
       listQuery: {
-        page: 1,
-        limit: 10,
-        importance: undefined,
-        title: undefined,
-        type: undefined,
-        sort: '+id'
-      },
-      search: {
-
-      },
-      form: {
-        classifyName: '',
-        telephone: '',
-        contacts: '',
-        businessNum: '',
-        address: '',
-        radio: 1,
-        status: '请选择',
-        imageUrl: '',
-        doorwayImageUrl: ''
-      },
-      addPeople: {
-        classifyName: '',
-        telephone: ''
-      },
-      updateTatusId: '',
-      updateTatusType: '',
-      dialogVisible: false,
-      dialogVisibleText: '',
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        update: '添加运营人员',
-        create: 'Create',
-        titleText: '系统提示'
-      },
-      rules: {
-        classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        telephone: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
+        organizeId: this.$store.getters.organizeId,
+        pageNum: 1,
+        pageSize: 10,
+        name: '', // 付款单名称
+        shopName: '', // 供应商名称
+        orderNo: '', // 订单编号
+        orderId: '', // 订单ID
+        payShopId: '', // 付款单
+        applyStartTime: '', // 申请开始时间
+        applyEndTime: '', // 申请结束时间
+        payStartTime: '', // 付款开始时间
+        payEndTime: '', // 付款结束时间
+        shopOrderId: '', // 子订单ID
+        shopOrderNo: '', // 子订单编号
+        status: '' // 付款状态
       }
     }
   },
@@ -209,96 +206,99 @@ export default {
     this.getList()
   },
   methods: {
-    getList() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.applyTime && this.applyTime.length > 0) {
+        this.listQuery.applyStartTime = this.applyTime[0]
+        this.listQuery.applyEndTime = this.applyTime[1]
+      } else {
+        this.listQuery.applyStartTime = ''
+        this.listQuery.applyEndTime = ''
+      }
+      if (this.payTime && this.payTime.length > 0) {
+        this.listQuery.payStartTime = this.payTime[0]
+        this.listQuery.payEndTime = this.payTime[1]
+      } else {
+        this.listQuery.payStartTime = ''
+        this.listQuery.payEndTime = ''
+      }
+    },
+    async getList() {
       this.listLoading = true
-      getClubList().then(response => {
-        this.list = response.data.items
+      try {
+        this.initTime()
+        const res = await getOrganizePayList(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
         this.listLoading = false
-      }).catch(() => {
-        // 封装静态数据
-        this.list = [
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0
-          },
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 1
-          },
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 2,
-            statusText: '测试十四萨拉斯打蜡卡就'
-          },
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 1
-          }
-        ]
-      })
-      this.listLoading = false
+      } catch (error) {
+        console.log('error', error)
+        this.listLoading = false
+      }
     },
-    handleOperate(type, id) {
+    handleOperate(type, payShopId) {
       /**
        * 1 查看详情 2申请付款 3取消付款 4付款审核 5编辑 6撤销付款
        */
       switch (type) {
-        case 1:
-          this.$router.push({ path: '/finance/payment-details', query: { id: id }})
+        case 1:// 1查看详情
+          this.$router.push({ path: '/finance/payment-details', query: { payShopId: payShopId }})
+          break
+        case 2:// 2修改申请
+          this.$router.push({ path: '/finance/payapply-edit', query: { type: 'edit', payShopId: payShopId }})
+          break
+        case 3:// 3取消付款
+          this.handleCancelApply(payShopId)
+          break
+        case 4:// 4付款审核
+          this.$router.push({ path: '/finance/payment-details', query: { type: 'verify', payShopId: payShopId }})
+          break
+        case 5:// 5编辑
+          this.$router.push({ path: '/finance/payment-details', query: { type: 'edit', payShopId: payShopId }})
+          break
+        case 6:// 6撤销付款
+          this.handleCancelBack(payShopId)
           break
       }
+    },
+    // 取消付款操作
+    handleCancelApply(payShopId) {
+      this.$confirm('确定要取消此次付款申请吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.cancelPayApply(payShopId)
+      })
+    },
+    handleCancelBack(payShopId) {
+      this.$confirm('确定要撤销此次付款申请吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.cancelPayBack(payShopId)
+      })
+    },
+    // 取消付款调用
+    async cancelPayApply(payShopId) {
+      try {
+        const res = await cancelPayApply(payShopId)
+        this.$message.success(res.msg)
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 撤销付款调用
+    async cancelPayBack(payShopId) {
+      try {
+        const res = await cancelPayBack(payShopId)
+        this.$message.success(res.msg)
+        this.getList()
+      } catch (error) {
+        console.log('error', error)
+      }
     }
   }
 }

+ 166 - 198
src/views/finance/paysettle-list.vue

@@ -3,27 +3,27 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>子订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderId" style="width:130px;" placeholder="子订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>子订单编号:</span>
-        <el-input v-model="listQuery.orderID" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopOrderNo" style="width:200px;" placeholder="子订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单编号:</span>
-        <el-input v-model="listQuery.orderNumber" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderNo" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>供应商:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.shopName" style="width:200px;" placeholder="供应商" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>机构名称:</span>
-        <el-input v-model="listQuery.customer" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.clubName" style="width:200px;" placeholder="机构名称" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>下单时间:</span>
@@ -40,7 +40,7 @@
       </div>
       <div class="filter-control">
         <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
-        <el-button type="success" icon="el-icon-document-add" @click="getList">申请分账</el-button>
+        <el-button type="success" :disabled="!orderRadio" icon="el-icon-document-add" @click="handleApplySub">申请结算</el-button>
       </div>
     </div>
     <el-table
@@ -50,87 +50,142 @@
       border
       fit
       highlight-current-row
+      default-expand-all
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="40" />
       <el-table-column label="商品信息" type="expand" width="50">
         <template slot-scope="{row}">
-          <el-table :data="row.products" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
-            <el-table-column label="商品名" align="center" prop="productName" />
+          <el-table :data="row.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+            <el-table-column label="商品名" align="center" prop="name" />
             <el-table-column label="规格" align="center" prop="unit" />
             <el-table-column label="数量" align="center" prop="num" />
-            <el-table-column label="退货" align="center" prop="returnNum" />
-            <el-table-column label="单价" align="center" prop="price" />
-            <el-table-column label="总价" align="center" prop="totalPrice" />
+            <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum">
+              <template slot-scope="scope">
+                <span>{{ scope.row.returnedPurchaseProductNum ? scope.row.returnedPurchaseProductNum : 0 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="单价" align="center" prop="price">
+              <template slot-scope="scope">
+                <span>{{ scope.row.price | amountfilters }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="总价" align="center" prop="totalFee">
+              <template slot-scope="scope">
+                <span>{{ scope.row.totalFee | amountfilters }}</span>
+              </template>
+            </el-table-column>
           </el-table>
         </template>
       </el-table-column>
-      <el-table-column label="订单编号(ID)" align="center" prop="orderNo" width="240">
+      <el-table-column label="订单编号(ID)" align="center" prop="orderNo">
         <template slot-scope="{row}">
           <span>{{ row.orderNo }}({{ row.orderId }})</span>
         </template>
       </el-table-column>
-      <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNo" width="240">
+      <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNo">
         <template slot-scope="{row}">
           <span>{{ row.shopOrderNo }}({{ row.shopOrderId }})</span>
         </template>
       </el-table-column>
-      <el-table-column label="下单时间" align="center" prop="verifyTime" width="90" />
-      <el-table-column label="订单金额" align="center" prop="payableAmount" />
-      <el-table-column label="收款金额" align="center" prop="payableAmount" />
-      <el-table-column label="商品费" align="center" prop="verifyMan" />
-      <el-table-column label="机构" align="center" prop="clubName" />
-      <el-table-column label="机构运费" align="center" prop="clubName" />
-      <el-table-column label="供应商" align="center" prop="shopName" />
-      <el-table-column label="供应商运费" align="center" prop="verifyMan" />
-      <el-table-column label="付供应商" align="center" prop="payableAmount" />
-      <el-table-column prop="status" label="收款状态" align="center">
+      <el-table-column label="订单金额" align="center" prop="payTotalFee">
+        <template slot-scope="{row}">
+          <span>{{ row.payTotalFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收款金额" align="center" prop="receiptTotalFee">
+        <template slot-scope="{row}">
+          <span>{{ row.receiptTotalFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收款状态" align="center" prop="orderReceiptStatus">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 0
+              'el-span-warning': row.orderReceiptStatus == 1 || row.orderReceiptStatus == 3,
+              'el-span-success': row.orderReceiptStatus == 2
             }"
           >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            {{ row.orderReceiptStatus | receiptStatusFilter }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column prop="status" label="结算状态" align="center">
+      <el-table-column label="付款状态" align="center" prop="payStatus">
         <template slot-scope="{ row }">
           <span
             :class="{
-              'el-span-warning': row.status == 0,
-              'el-span-success': row.status == 1,
-              'el-span-danger': row.status == 2
+              'el-span-warning': row.payStatus == 1,
+              'el-span-success': row.payStatus == 2,
+              'el-span-danger': row.payStatus == 3
             }"
           >
-            {{ row.status | statusFilter }}
-            <span v-if="row.status === 2" class="el-span-danger">原因:{{ row.statusText }}</span>
+            {{ row.payStatus | payStatusFilter }}
           </span>
         </template>
       </el-table-column>
+      <el-table-column label="商品费" align="center" prop="productAmount">
+        <template slot-scope="{row}">
+          <span>{{ row.productAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="机构" align="center" prop="buyer" />
+      <el-table-column label="机构运费" align="center" prop="freight">
+        <template slot-scope="{row}">
+          <span v-if="row.freight === 0">包邮</span>
+          <span v-else-if="row.freight === -1">到付</span>
+          <span v-else-if="row.freight === -2">仪器到付-产品包邮</span>
+          <span v-else>{{ row.freight ? row.freight : '0.00' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="供应商" align="center" prop="shopName" />
+      <el-table-column label="供应商运费" align="center" prop="shopPostFee">
+        <template slot-scope="{row}">
+          <span>{{ row.shopPostFee | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付采美" align="center" prop="waitPayCmAmount">
+        <template slot-scope="{row}">
+          <span class="el-span-danger">{{ row.waitPayCmAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付供应商" align="center" prop="shouldPayShopAmount">
+        <template slot-scope="{row}">
+          <span class="el-span-danger">{{ row.shouldPayShopAmount | amountfilters }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <el-button type="text" size="mini" @click="handleToRecord(row.id)">结算记录</el-button>
+          <el-button type="text" size="mini" @click="handleToRecord(row.id)">退/付款记录</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
   </div>
 </template>
 
 <script>
-import { getClubList } from '@/api/club'
-import Pagination from '@/components/Pagination'
+import { getPayOrderList } from '@/api/finance'
 import pickerOptions from '@/utils/time-picker.js'
 
 export default {
-  components: { Pagination },
   filters: {
+    receiptStatusFilter(status) {
+      const map = {
+        1: '待收款',
+        2: '部分收款',
+        3: '已收款'
+      }
+      return map[status]
+    },
+    payStatusFilter(status) {
+      const map = {
+        1: '待付款',
+        2: '部分付款',
+        3: '已付款'
+      }
+      return map[status]
+    },
     statusFilter(status) {
       const map = {
         0: '待付款',
@@ -142,187 +197,100 @@ export default {
   },
   data() {
     return {
+      time: '',
       list: null,
       pickerOptions,
       listLoading: true,
-      searchTimeVal: '',
       total: 0,
       listQuery: {
-        page: 1,
-        limit: 10,
-        importance: undefined,
-        title: undefined,
-        type: undefined,
-        sort: '+id'
-      },
-      search: {
-
-      },
-      form: {
-        classifyName: '',
-        telephone: '',
-        contacts: '',
-        businessNum: '',
-        address: '',
-        radio: 1,
-        status: '请选择',
-        imageUrl: '',
-        doorwayImageUrl: ''
-      },
-      addPeople: {
-        classifyName: '',
-        telephone: ''
-      },
-      updateTatusId: '',
-      updateTatusType: '',
-      dialogVisible: false,
-      dialogVisibleText: '',
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        update: '添加运营人员',
-        create: 'Create',
-        titleText: '系统提示'
+        listType: 3, // 1申请付款 2子订单分账 3子订单结算
+        organizeId: this.$store.getters.organizeId,
+        pageNum: 1,
+        pageSize: 20,
+        shopName: '', // 供应商名称
+        clubName: '', // 机构名称
+        orderNo: '', // 订单编号
+        orderId: '', // 订单ID
+        payShopId: '', // 付款单
+        orderStartTime: '', // 下单开始时间
+        orderEndTime: '', // 下单结束时间
+        shopOrderId: '', // 子订单ID
+        shopOrderNo: '', // 子订单编号
+        status: '' // 付款状态
       },
-      rules: {
-        classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        telephone: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
-      }
+      orderRadio: null
     }
   },
   created() {
     this.getList()
   },
   methods: {
-    getList() {
+    initTime() {
+      // 初始化获取时间筛选值
+      if (this.time && this.time.length > 0) {
+        this.listQuery.orderStartTime = this.time[0]
+        this.listQuery.orderEndTime = this.time[1]
+      } else {
+        this.listQuery.orderStartTime = ''
+        this.listQuery.orderEndTime = ''
+      }
+    },
+    async getList() {
       this.listLoading = true
-      getClubList().then(response => {
-        this.list = response.data.items
+      try {
+        const res = await getPayOrderList(this.listQuery)
+        this.list = res.data.list
         this.listLoading = false
-      }).catch(() => {
-        // 封装静态数据
-        this.list = [
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0,
-            totalProduct: '3000.00',
-            payShopTotal: '3000.00',
-            products: [
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          },
-          {
-            id: 7580,
-            name: '微博',
-            type: '子订单付款',
-            shopName: '采美信息技术有限公司',
-            payableAmount: '2000000.00',
-            shopOrderNo: 'P1682650952091471001',
-            shopOrderId: '19747',
-            orderNo: 'P16265095220221471',
-            orderId: '18179',
-            clubName: '广州白云区松洲蒂亚美容院',
-            applyMan: '路海珠',
-            applyTime: '2020-01-01:20:30:56',
-            verifyMan: '李昕',
-            verifyTime: '2020-01-01:20:30:56',
-            status: 0,
-            totalProduct: '3000.00',
-            payShopTotal: '3000.00',
-            products: [
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
+      } catch (error) {
+        console.log('error', error)
+        this.listLoading = false
+      }
+    },
+    // 多选子订单
+    handleSelectionChange(row) {
+      this.orderRadio = row
+      console.log('orderRadio', this.orderRadio)
+    },
+    // 付款申请
+    handleApplySub() {
+      console.log('flag', this.checkForDuplicates(this.orderRadio))
+      if (this.checkForDuplicates(this.orderRadio)) {
+        this.$alert('应付多个订单时,它们必须属于同一个供应商!', '提示', {
+          confirmButtonText: '确定'
+        })
+      } else {
+        const newArr = this.orderRadio.map(item => item.shopOrderId)
+        this.$router.push({ path: '/finance/payapply-edit', query: { shopOrderIds: JSON.stringify(newArr) }})
+      }
+    },
+    // 数组是否有重复
+    checkForDuplicates(arr, id = 'shopId') {
+      const newShopArr = []
+      let flag = false
+      for (const item of arr) {
+        newShopArr.push(item[id])
+        for (const el of newShopArr) {
+          if (item[id] !== el) {
+            flag = true
           }
-        ]
-      })
-      this.listLoading = false
+        }
+      }
+      return flag
     },
     handleToRecord(id) {
-      this.$router.push({ path: '/finance/paysettle-record', query: { id: id }})
+      this.$router.push({ path: '/finance/payment-record', query: { id: id }})
     }
   }
 }
 
 </script>
 <style scoped>
-.el-span-warning{
-  color: #E6A23C;
-}
-.el-span-success{
-  color: #67C23A;
+/deep/ .el-table__expanded-cell[class*=cell]{
+  padding:10px 10px !important;
 }
-.el-span-danger{
-  color: #F56C6C;
+/deep/ .el-table__row td {
+  height: 34px !important;
+  line-height: 34px !important;
+  padding: 0 !important;
 }
 </style>

+ 2 - 0
src/views/floor/components/good-multi-dialog.vue

@@ -81,7 +81,9 @@ export default {
       listQuery: {
         productName: '', // 商品名称
         shopName: '', // 供应商名称
+        validFlag: 1,
         index: 1,
+        organizeId: this.$store.getters.organizeId,
         pageSize: 20
       },
       list: [],

+ 6 - 2
src/views/floor/edit.vue

@@ -179,8 +179,12 @@ export default {
       await savePageFloor(params)
       this.$message.success('保存成功')
       setTimeout(() => {
-        this.$router.push({ path: '/floor/list' })
-      }, 1000)
+        this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+          this.$nextTick(() => {
+            this.$router.push({ path: '/floor/list' })
+          }, 1000)
+        })
+      })
     },
     // 修改活动类型时清空商品
     handeleSelChange() {

+ 12 - 10
src/views/goods/components/price-edit.vue

@@ -20,12 +20,12 @@
       </el-form-item>
       <el-form-item label="商品状态:" prop="validFlag">
         <el-select v-model="formData.validFlag" placeholder="请选择">
-          <el-option label="上架" value="1" />
-          <el-option label="下架" value="0" />
+          <el-option label="上架" value="1" />
+          <el-option label="已下架" value="2" />
         </el-select>
       </el-form-item>
       <el-form-item label="商品规格:" prop="skus">
-        <el-table row-key="title" :data="formData.skus" border>
+        <el-table row-key="title" :data="formData.skus" border height="250">
           <el-table-column label="商品规格" prop="title" align="center">
             <template slot-scope="{row}">
               <span>{{ row.unit }}</span>
@@ -33,7 +33,7 @@
           </el-table-column>
           <el-table-column label="起订量" prop="name" align="center" width="100">
             <template slot-scope="{row}">
-              <el-input v-model="row.minBuyNumber" />
+              <el-input v-model="row.minBuyNumber" @input="e => (row.name= checkedInput(e))" />
             </template>
           </el-table-column>
           <el-table-column label="成本价" prop="name" align="center" width="200">
@@ -43,7 +43,7 @@
           </el-table-column>
           <el-table-column label="售价" prop="name" align="center" width="200">
             <template slot-scope="{row}">
-              <el-input v-model="row.price">
+              <el-input v-model="row.price" @input="e => (row.price= checkedInput(e))">
                 <template slot="prepend">¥</template>
               </el-input>
             </template>
@@ -123,23 +123,25 @@ export default {
     async saveGoods() {
       try {
         await saveGoods(this.postData)
-        this.$message({ message: '操作成功', type: 'success', center: true })
+        this.$message.success('操作成功')
         this.$parent.getList()
         this.dialogFormVisible = false
       } catch (error) {
         console.log('error', error)
       }
+    },
+    checkedInput(event) {
+      const pattern = /[^0-9.]/g
+      return event.replace(pattern, '')
     }
   }
 }
 </script>
-<style>
-  .group label{
+<style scoped>
+.group label{
     white-space: nowrap;
     font-weight: normal;
   }
-</style>
-<style scoped>
 .text{
   line-height: 20px;
   padding: 4px 0 0;

+ 4 - 5
src/views/goods/list.vue

@@ -79,7 +79,7 @@
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+    <pagination v-show="total>10" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
 
     <PriceEdit ref="priceChild" :dialog-title="dialogTitle" :is-visible.sync="dialogFormVisible" :product="dialogData" />
 
@@ -94,9 +94,8 @@
 <script>
 import { getList, switchGoods } from '@/api/goods'
 import PriceEdit from './components/price-edit'
-import Pagination from '@/components/Pagination'
 export default {
-  components: { PriceEdit, Pagination },
+  components: { PriceEdit },
   filters: {
     statusFilter(status) {
       const statusMap = {
@@ -174,8 +173,8 @@ export default {
     async handSwithGoods(row) {
       // 上下架接口
       try {
-        const res = await switchGoods(row.id)
-        this.$message({ message: res.msg, type: 'success', center: true })
+        const res = await switchGoods(row.productId * 1)
+        this.$message.success(res.msg)
         this.getList()
       } catch (error) {
         console.log('error', error)

+ 361 - 0
src/views/order/addLogistics.vue

@@ -0,0 +1,361 @@
+<template>
+  <div class="app-container">
+    <el-card class="box-card" style="margin: 0 auto;">
+      <div class="refund-item">
+        <el-row :gutter="24" class="box-row">
+          <el-table :data="params.orderProducts" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+            el-table-column label="商品名" align="center" prop="name" />
+            <el-table-column label="商品图片" align="center" prop="productImage">
+              <template slot-scope="{row}">
+                <el-popover
+                  placement="top-start"
+                  title=""
+                  width="120"
+                  trigger="hover"
+                >
+                  <img :src="row.productImage" alt="" style="width:100px;height:100px;">
+                  <img slot="reference" :src="row.productImage" alt="" style="width:50px;height:50px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column label="规格" align="center" prop="unit" />
+            <el-table-column label="供应商" align="center" prop="shopName" />
+            <el-table-column label="购买数量" align="center" prop="num" />
+            <el-table-column label="已发数量" align="center" prop="sendOutNum">
+              <template slot-scope="{row}">
+                <span>{{ row.sendOutNum?row.sendOutNum:0 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="本次发货" align="center" prop="deliveryNum" />
+          </el-table>
+        </el-row>
+      </div>
+    </el-card>
+    <el-card class="box-card" style="margin: 10px auto;">
+      <div class="refund-item">
+        <el-form ref="logisticFrom" :model="params" :rules="rules" label-width="120px">
+          <el-row v-for="(logistic,index) in params.transportations" :key="index" :gutter="24" class="box-row">
+            <el-col :span="8">
+              <el-form-item label="快递公司:" :prop="`transportations.${index}.logisticsCompanyName`" :rules="rules.logisticsCompanyName">
+                <el-select v-model="logistic.logisticsCompanyName" style="width:250px;" clearable size="mini" @change="hanldeCompny($event,index)">
+                  <el-option value="" label="请选择物流公司" />
+                  <el-option v-for="item in kuaiduLisrt" :key="item.id" :label="item.label" :value="item" />
+                </el-select>
+                <el-button v-if="index === 0" type="primary" icon="el-icon-plus" size="mini" style="margin-left: 10px;" @click="hanldeAddlogis(logistic,index)" />
+                <el-button v-if="(index+1) > 1" type="danger" icon="el-icon-minus" size="mini" style="margin-left: 10px;" @click="handeleDelete(index)" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <div v-for="(sticsNu,numIndex) in logistic.logisticsNu" :key="numIndex">
+                <el-form-item label="物流编号:" :prop="`transportations.${index}.logisticsNu.${numIndex}.num`" :rules="rules.num">
+                  <el-input :key="numIndex" v-model="sticsNu.num" placeholder="请输入物流单号" style="width: 250px" size="mini" />
+                  <el-button v-if="numIndex === 0" type="primary" icon="el-icon-plus" size="mini" style="margin-left: 10px;" @click="hanldeAddNumber(logistic,numIndex)" />
+                  <el-button v-if="(numIndex+1) > 1" type="danger" icon="el-icon-minus" size="mini" style="margin-left: 10px;" @click="handeleDeleteNumber(logistic,numIndex)" />
+                </el-form-item>
+              </div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="box-row">
+            <el-form-item label="图片备注:" prop="logImage">
+              <div class="form-el-upload">
+                <el-upload
+                  class="avatar-uploader"
+                  :action="actionUrl"
+                  :headers="getToken"
+                  list-type="picture-card"
+                  :on-remove="handleRemove"
+                  :on-success="handleSuccess"
+                >
+                  <i class="el-icon-plus" />
+                </el-upload>
+                <p style="margin: 0;line-height: 20px;font-size: 14px;color: red;">注意:请上传jpg / png格式的图片,最大不超过5M,最多可上传10张</p>
+              </div>
+            </el-form-item>
+            <el-form-item label="备注:" prop="name">
+              <el-input v-model="params.remark" type="textarea" show-word-limit placeholder="请输入备注文字,200字以内" maxlength="200" :autosize="{ minRows: 5, maxRows: 6}" style="width: 600px;" />
+            </el-form-item>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <div class="filter-container" style="text-align: right;margin-top: 20px;">
+      <el-button plain @click="backToList">取消</el-button>
+      <el-button type="primary" :disabled="disabled" @click="hanldeConfirm('logisticFrom')">确认发货</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { confirmDeliver, deliverShipCompany } from '@/api/order'
+const defaultForm = () => {
+  return {
+    logisticsCompanyCode: '',
+    logisticsCompanyName: '',
+    logisticsNu: [
+      { num: '' }
+    ]
+  }
+}
+export default {
+  name: 'PaymentDetails',
+  filters: {
+  },
+  data() {
+    return {
+      params: {
+        images: [], // 发货图片备注
+        orderProducts: [],
+        remark: '',
+        transportations: [
+          {
+            logisticsCompanyCode: '',
+            logisticsCompanyName: '',
+            logisticsNu: [
+              { num: '' }
+            ]
+          }
+        ]
+      },
+      islogisticsCompany: false,
+      islogisticsNumber: false,
+      productList: [],
+      kuaiduLisrt: [],
+      fileImageList: [], // 上传图片列表
+      rules: {
+        logisticsCompanyName: [{ required: true, message: '请选择物流公司', trigger: 'blur' }],
+        num: [{ required: true, message: '请输入物流单号', trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {
+    getToken() {
+      return {
+        'token': this.$store.getters.token
+      }
+    },
+    actionUrl() {
+      return process.env.VUE_APP_BASE_API + '/formData/MultiPictareaddData'
+    },
+    orderId: function() {
+      return this.$route.query.orderId * 1
+    },
+    disabled() {
+      return this.params.transportations[0] === ''
+    }
+  },
+  created() {
+    if (this.$route.query.products) {
+      this.params.orderProducts = JSON.parse(this.$route.query.products)
+    }
+    this.deliverShipCompany()
+    console.log('productList', this.params.orderProducts)
+  },
+  methods: {
+    // 付款单详情
+    async deliverShipCompany() {
+      try {
+        const res = await deliverShipCompany()
+        console.log('res', res)
+        this.kuaiduLisrt = res.data
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    //  选择物流公司
+    hanldeCompny(value, index) {
+      console.log('value', value)
+      this.params.transportations[index].logisticsCompanyName = value.label
+      this.params.transportations[index].logisticsCompanyCode = value.value
+      this.islogisticsCompany = false
+    },
+    // 添加一条物流公司
+    hanldeAddlogis() {
+      this.params.transportations.push(defaultForm())
+    },
+    // 删除 一条物流公司
+    handeleDelete(index) {
+      this.params.transportations.splice(index, 1)
+    },
+    // 添加物流单号
+    hanldeAddNumber(logistic, num, numIndex) {
+      logistic.logisticsNu.push({ num: '' })
+    },
+    // 删除一条物流编号
+    handeleDeleteNumber(logistic, numIndex) {
+      logistic.logisticsNu.splice(numIndex, 1)
+    },
+    checkedParams() { // 校验参数信息
+      const _this = this
+      this.params.transportations.forEach(function(pros) {
+        pros.logisticsNu.forEach(function(item) {
+          const transpor = {
+            logisticsCompanyCode: pros.logisticsCompanyCode,
+            logisticsCompanyName: pros.logisticsCompanyName,
+            num: item.num
+          }
+          if (transpor.logisticsCompanyCode === '' && transpor.logisticsCompanyName === '') {
+            _this.islogisticsCompany = true
+          } else {
+            _this.islogisticsCompany = false
+          }
+          if (transpor.num === '') {
+            console.log('1111111111')
+            _this.islogisticsNumber = true
+          } else {
+            _this.islogisticsNumber = false
+          }
+        })
+      })
+    },
+    hanldeConfirm(formName) {
+      // 保存编辑
+      // this.checkedParams()
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          this.fileImageList.forEach((image) => {
+            this.params.images.push(image.response.data)
+          })
+          this.confirmDeliver(this.params)
+        } else {
+          return false
+        }
+      })
+    },
+    async confirmDeliver(params) {
+      try {
+        await confirmDeliver(params)
+        this.$message.success('操作成功')
+        this.backToList()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 上传图片事件
+    handleSuccess(res, file, fileList) {
+      this.fileImageList = fileList
+      console.log('images', this.fileImageList)
+    },
+    // 删除图片事件
+    handleRemove(file, fileList) {
+      this.fileImageList = fileList
+      console.log('images', this.fileImageList)
+    },
+    reloadImage() {
+      this.loadImgLoading = true
+      setTimeout(() => {
+        this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
+      }, 1000 * 2)
+    },
+    loadSucess() {
+      this.loadImgLoading = false
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({
+            path: '/order/list'
+          })
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+  .app-title{
+    line-height: 36px;
+    font-size: 26px;
+    font-weight: bold;
+    color: #409EFF;
+    text-align: center;
+    margin: 0;
+  }
+  .box-card{
+    margin-top: 20px;
+    font-size: 14px;
+  }
+  .box-row{
+    padding: 10px 0;
+  }
+  .box-row .dropdown{
+    margin-top: -10px;
+  }
+  .refund-item{
+    padding: 10px 0;
+  }
+  .order-item{
+    background:#f7f7f7;
+    margin-bottom: 20px;
+    padding: 10px 15px;
+    border-radius: 5px;
+  }
+  .product-row{
+    padding: 10px 0;
+    background: #EBEEF5;
+    border-top: 1px dashed #DCDFE6;
+  }
+  .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 148px;
+    height: 148px;
+    line-height: 148px;
+    text-align: center;
+  }
+  .avatar {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .avatar img {
+    width: 148px;
+    height: 148px;
+    display: block;
+  }
+  .el-form-item__label{
+      text-align: right !important;
+  }
+  .form-el-upload{
+    width: 100% !important;
+  }
+  .el-upload__tip{
+    line-height: 20px;
+    color: red;
+    text-align: left;
+    position: absolute;
+    right: -50%;
+    bottom: 0;
+  }
+  .span_tip{
+    font-size: 12px;
+    color: red;
+    margin-left: 5px;
+  }
+  .filter-item-temp{
+    width: 100px;
+  }
+  .op-item{
+    padding: 5px 0;
+  }
+  .el-span-warning{
+    color: #E6A23C;
+  }
+  .el-span-success{
+    color: #67C23A;
+  }
+  .el-span-danger{
+    color: #F56C6C;
+  }
+</style>
+

+ 149 - 0
src/views/order/deliver-record.vue

@@ -0,0 +1,149 @@
+<template>
+  <div class="app-container">
+    <div class="app-header-top" style="width: 100%;float: right;margin-bottom: 10px;">
+      <div class="app-title">发货记录</div>
+      <el-button type="primary" icon="el-icon-back" style="float: right;" @click="backToList">返回</el-button>
+    </div>
+    <el-card v-for="(record,index) in recordList" :key="index" class="box-card" style="margin: 0 auto;">
+      <div class="refund-item">
+        <el-row :gutter="24" class="box-row">
+          <el-table :data="record.logisticsRecordList" border fit highlight-current-row :show-header="false">
+            <el-table-column label="商品图片" align="center" prop="image" width="140">
+              <template slot-scope="{row}">
+                <el-popover
+                  placement="top-start"
+                  title=""
+                  width="120"
+                  trigger="hover"
+                >
+                  <img :src="row.image" alt="" style="width:100px;height:100px;">
+                  <img slot="reference" :src="row.image" alt="" style="width:50px;height:50px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column label="商品名" align="center" prop="productName" />
+            <el-table-column label="规格" align="center" prop="unit" />
+            <el-table-column label="购买数量" align="center" prop="buyNum" />
+            <el-table-column label="发货数量" align="center" prop="num" />
+          </el-table>
+        </el-row>
+        <h1 class="refund-item-title">物流详情</h1>
+        <el-row :gutter="24" class="box-row">
+          <el-collapse accordion>
+            <el-collapse-item
+              v-for="(express,exIndex) in record.logisticsInformationList"
+              :key="exIndex"
+              :title="`快递公司:${express.logisticsCompanyName} 物流单号: ${express.nu}`
+              "
+              name="1"
+            >
+              <p v-for="(text,textIndex) in hanldeExpress(express.info)" :key="textIndex">
+                {{ text.time }}{{ text.context }}
+              </p>
+            </el-collapse-item>
+          </el-collapse>
+        </el-row>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { deliverDetails } from '@/api/order'
+export default {
+  name: 'DeliverRecord',
+  filters: {
+
+  },
+  data() {
+    return {
+      recordList: []
+    }
+  },
+  computed: {
+    orderId: function() {
+      return this.$route.query.orderId * 1
+    }
+  },
+  created() {
+    this.deliverDetails(this.orderId)
+  },
+  methods: {
+    // 付款单详情
+    async deliverDetails(orderId) {
+      try {
+        const res = await deliverDetails(orderId)
+        console.log('res', res)
+        this.recordList = res.data
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    hanldeExpress(express) {
+      // 处理物流信息
+      return JSON.parse(express)
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({ path: '/order/detail', query: { id: this.orderId }})
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+  .app-title{
+    line-height: 36px;
+    font-size: 26px;
+    font-weight: bold;
+    color: #409EFF;
+    text-align: center;
+    margin: 0;
+    float: left;
+  }
+  .box-card{
+    margin-top: 20px;
+    font-size: 14px;
+  }
+  .box-row{
+    padding: 10px 0;
+  }
+  .box-row .dropdown{
+    margin-top: -10px;
+  }
+  .refund-item{
+    padding: 10px 0;
+  }
+  .refund-item-title{
+    line-height: 24px;
+    font-size: 14px;
+    color: #409EFF;
+  }
+  .order-item{
+    background:#f7f7f7;
+    margin-bottom: 20px;
+    padding: 10px 15px;
+    border-radius: 5px;
+  }
+  .product-row{
+    padding: 10px 0;
+    background: #EBEEF5;
+    border-top: 1px dashed #DCDFE6;
+  }
+  .op-item{
+    padding: 5px 0;
+  }
+  .el-span-warning{
+    color: #E6A23C;
+  }
+  .el-span-success{
+    color: #67C23A;
+  }
+  .el-span-danger{
+    color: #F56C6C;
+  }
+</style>
+

+ 168 - 0
src/views/order/deliver.vue

@@ -0,0 +1,168 @@
+<template>
+  <div class="app-container">
+    <el-card class="box-card" style="margin: 0 auto;">
+      <div class="refund-item">
+        <el-row :gutter="24" class="box-row">
+          <el-col :span="4"><b>收货人:</b> {{ orderInfo.receiver }} </el-col>
+          <el-col :span="4"><b>手机号:</b> {{ orderInfo.mobile }} </el-col>
+          <el-col :span="16"><b>收货地址:</b> {{ orderInfo.address }} </el-col>
+        </el-row>
+        <el-row :gutter="24" class="box-row">
+          <el-col :span="24"><b>买家留言:</b>
+            <span v-for="(msg,index) in orderInfo.notes" :key="index">
+              【{{ `${index+1}.${msg}` }}】
+            </span>
+          </el-col>
+        </el-row>
+      </div>
+      <div class="refund-item">
+        <el-row :gutter="24" class="box-row">
+          <el-table :data="orderInfo.orderProduct" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}" @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="50" />
+            <el-table-column label="商品名" align="center" prop="name" />
+            <el-table-column label="商品图片" align="center" prop="productImage">
+              <template slot-scope="{row}">
+                <el-popover
+                  placement="top-start"
+                  title=""
+                  width="120"
+                  trigger="hover"
+                >
+                  <img :src="row.productImage" alt="" style="width:100px;height:100px;">
+                  <img slot="reference" :src="row.productImage" alt="" style="width:50px;height:50px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column label="规格" align="center" prop="unit" />
+            <el-table-column label="供应商" align="center" prop="shopName" />
+            <el-table-column label="购买数量" align="center" prop="num" />
+            <el-table-column label="未发数量" align="center" prop="notOutStore" />
+            <el-table-column label="发货数量" align="center" prop="deliveryNum">
+              <template slot-scope="{row}">
+                <el-input v-model="row.deliveryNum" :maxlength="4" size="mini" />
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-row>
+      </div>
+    </el-card>
+    <div class="filter-container" style="text-align: center;margin-top: 20px;">
+      <el-button type="primary" :disabled="disabled" @click="hanldeConfirm">发货</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { orderTodeliver } from '@/api/order'
+export default {
+  name: 'PaymentDetails',
+  filters: {
+
+  },
+  data() {
+    return {
+      orderInfo: {},
+      productRadio: null
+    }
+  },
+  computed: {
+    orderId: function() {
+      return this.$route.query.orderId * 1
+    },
+    disabled() {
+      return this.productRadio === null
+    }
+  },
+  created() {
+    this.orderTodeliver(this.orderId)
+  },
+  methods: {
+    // 付款单详情
+    async orderTodeliver(orderId) {
+      try {
+        const res = await orderTodeliver(orderId)
+        console.log('res', res)
+        this.orderInfo = res.data
+        this.orderInfo.orderProduct.map((elem) => {
+          elem.deliveryNum = elem.num
+          return elem
+        })
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 多选商品
+    handleSelectionChange(row) {
+      this.productRadio = row
+      console.log('productRadio', row)
+    },
+    hanldeConfirm() {
+      // 发货去添加物流
+      this.$confirm('确认去发货吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$router.push({ path: '/order/addLogistics', query: { orderId: this.orderId, products: JSON.stringify(this.productRadio) }})
+      })
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({
+            path: '/finance/payment-list'
+          })
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+  .app-title{
+    line-height: 36px;
+    font-size: 26px;
+    font-weight: bold;
+    color: #409EFF;
+    text-align: center;
+    margin: 0;
+  }
+  .box-card{
+    margin-top: 20px;
+    font-size: 14px;
+  }
+  .box-row{
+    padding: 10px 0;
+  }
+  .box-row .dropdown{
+    margin-top: -10px;
+  }
+  .refund-item{
+    padding: 10px 0;
+  }
+  .order-item{
+    background:#f7f7f7;
+    margin-bottom: 20px;
+    padding: 10px 15px;
+    border-radius: 5px;
+  }
+  .product-row{
+    padding: 10px 0;
+    background: #EBEEF5;
+    border-top: 1px dashed #DCDFE6;
+  }
+  .op-item{
+    padding: 5px 0;
+  }
+  .el-span-warning{
+    color: #E6A23C;
+  }
+  .el-span-success{
+    color: #67C23A;
+  }
+  .el-span-danger{
+    color: #F56C6C;
+  }
+</style>
+

+ 99 - 31
src/views/order/detail.vue

@@ -1,20 +1,14 @@
 <template>
   <div class="app-container">
-
-    <!--<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
-      <el-menu-item index="1" @click="backToList">订单列表</el-menu-item>
-      <el-menu-item index="2">订单详情</el-menu-item>
-    </el-menu>-->
     <div class="app-header-top" style="width: 100%;float: right;margin-bottom: 10px;">
       <div class="app-title">订单详情</div>
       <el-button type="primary" icon="el-icon-back" style="float: right;" @click="backToList">返回</el-button>
     </div>
-
     <el-card v-if="order" class="box-card">
       <div class="refund-item">
         <el-row :gutter="24" class="box-row">
           <el-col :span="6"><b>下单时间:</b> {{ order.orderTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</el-col>
-          <el-col :span="6"><b>订单编号(ID):</b> {{ order.orderNo + '(' + order.orderID + ')' }}</el-col>
+          <el-col :span="6"><b>订单编号(ID):</b> {{ order.orderNo + '(' + order.orderId + ')' }}</el-col>
           <el-col :span="6"><b>订单状态:</b>
             <template v-if="['11','12','13','21','22','23','31','32','33'].indexOf(order.status)>=0">
               <el-tag type="success" size="small">{{ '交易中('+statusObj[order.status]+')' }}</el-tag>
@@ -29,10 +23,24 @@
                 功能<i class="el-icon-arrow-down el-icon--right" />
               </el-button>
               <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item><div @click="RemarksOrder(order.orderID)">备注</div></el-dropdown-item>
-                <el-dropdown-item v-if="['0','11','21','6','4'].indexOf(order.status)<0"><router-link :to="'/order/logistics/' + order.orderID ">发货记录</router-link></el-dropdown-item>
-                <el-dropdown-item v-if="['0','11','6'].indexOf(order.status)<0"><router-link :to="'/order/refund-record/' + order.orderID ">收退款记录</router-link></el-dropdown-item>
-                <el-dropdown-item v-if="['0','11','6'].indexOf(order.status)<0"><router-link :to="'/order/refund-return/' + order.orderID ">退款(退货)记录</router-link></el-dropdown-item>
+                <el-dropdown-item>
+                  <div @click="RemarksOrder(order.orderId)">订单备注</div>
+                </el-dropdown-item>
+                <el-dropdown-item v-if="order.checkFlag === 1">
+                  <div @click="handeleDialogFormVisible"> 更改收款状态</div>
+                </el-dropdown-item>
+                <el-dropdown-item v-if="['13','33'].indexOf(order.status)<0">
+                  <div @click="handeleDropdown(1,order.orderId)">发货</div>
+                </el-dropdown-item>
+                <el-dropdown-item v-if="['4','5','12', '22', '23', '32', '33'].indexOf(order.status)<0">
+                  <div @click="handeleDropdown(2,order.orderId)">发货记录</div>
+                </el-dropdown-item>
+                <el-dropdown-item>
+                  <div @click="handeleDropdown(3,order.orderId)">收退款记录</div>
+                </el-dropdown-item>
+                <el-dropdown-item>
+                  <div @click="handeleDropdown(4,order.orderId)">退款(退货)记录</div>
+                </el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>
           </el-col>
@@ -49,9 +57,9 @@
             <el-tag v-if="order.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
           </el-col>
           <el-col :span="6"><b>付款状态:</b>
-            <el-tag v-if="order.refundType*1===1" type="warning" size="small">部分付款</el-tag>
-            <el-tag v-else-if="order.refundType*1===2" type="danger" size="small">已付款</el-tag>
-            <el-tag v-else type="info" size="small">无付款</el-tag>
+            <el-tag v-if="order.payStatus*1===1" type="danger" size="small">待付款</el-tag>
+            <el-tag v-if="order.payStatus*1===2" type="warning" size="small">部分付款</el-tag>
+            <el-tag v-if="order.payStatus*1===3" type="success" size="small">已付款</el-tag>
           </el-col>
           <el-col :span="6"><b>退款状态:</b>
             <el-tag v-if="order.refundType*1===1" type="warning" size="small">部分退款</el-tag>
@@ -78,7 +86,6 @@
             <template v-if="order.receiptStatus*1===1">¥0.00</template>
             <template v-else>¥{{ receiptAmount | toThousandFloatFilter }}</template>
           </el-col>
-
         </el-row>
         <el-row :gutter="24" class="box-row">
           <el-col :span="6"><b>退款金额(已完成):</b> ¥{{ returnValue | toThousandFloatFilter }}
@@ -92,10 +99,10 @@
         </el-row>
       </div>
       <div class="refund-item">
-        <div v-for="shopOrder in order.newShopOrders" :key="shopOrder.shopOrderID" class="order-item">
+        <div v-for="shopOrder in order.newShopOrders" :key="shopOrder.shopOrderId" class="order-item">
           <el-row :gutter="22" class="box-row">
             <el-col :span="6"><b>下单时间:</b> {{ shopOrder.orderTime }}</el-col>
-            <el-col :span="6"><b>子订单号(ID):</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderID + ')' }}</el-col>
+            <el-col :span="6"><b>子订单号(ID):</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderId + ')' }}</el-col>
             <el-col :span="6"><b>子订单金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
             <el-col :span="6"><b>发货状态:</b>
               <el-tag v-if="shopOrder.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
@@ -105,7 +112,7 @@
           </el-row>
           <el-row :gutter="22" class="box-row">
             <el-col :span="6"><b>商品总额:</b> {{ shopOrder.orderTime }}</el-col>
-            <el-col :span="6"><b>应付金额:</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderID + ')' }}</el-col>
+            <el-col :span="6"><b>应付金额:</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderId + ')' }}</el-col>
             <el-col :span="6"><b>已付金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
             <el-col :span="6"><b>待付金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
           </el-row>
@@ -153,17 +160,37 @@
         </div>
       </div>
     </el-card>
-    <Remarks dialog-title="订单备注信息" :is-visible.sync="dialogRemarksVisible" :order-id="dialogRemarksOrderId" :remark-list="dialogRemarkList" />
-    <template>
-      <el-backtop style="right: 40px; bottom: 40px;">
-        <i class="el-icon-upload2" />
-      </el-backtop>
-    </template>
+    <el-dialog title="更改收款状态" :visible.sync="dialogFormVisible" width="600px">
+      <el-form ref="dataForm" :rules="rules" :model="chengeOrder" label-position="right" label-width="150px">
+        <el-row :gutter="24" class="box-row" style="margin-bottom: 40px;">
+          <el-col :span="8"><b>应收金额:</b> ¥{{ order.payableAmount | amountfilters }}</el-col>
+          <el-col :span="8"><b>已收金额:</b>¥{{ receiptAmount | amountfilters }}</el-col>
+          <el-col :span="8"><b>未收金额:</b> ¥{{ (order.payableAmount - receiptAmount) | amountfilters }}</el-col>
+        </el-row>
+        <el-form-item label="订单本次收款金额:" prop="auditStatus">
+          <el-input v-model="chengeOrder.amount" style="width: 200px">
+            <template slot="prepend">¥</template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="修改订单收款状态:" prop="sataus">
+          <el-select v-model="chengeOrder.status" placeholder="请选择">
+            <el-option label="请选择" value="" />
+            <el-option label="部分收款" :value="2" />
+            <el-option label="已收款" :value="3" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取消</el-button>
+        <el-button type="primary" @click="handleChangOrder">确定</el-button>
+      </div>
+    </el-dialog>
+    <Remarks dialog-title="订单备注信息" :is-visible.sync="dialogRemarksVisible" :order-id="dialogRemarksorderId" :remark-list="dialogRemarkList" />
   </div>
 </template>
 
 <script>
-import { getDetail, getRemarks } from '@/api/order'
+import { getDetail, getRemarks, orderCheckReceipt } from '@/api/order'
 import Remarks from './components/remarks'
 export default {
   components: { Remarks },
@@ -177,7 +204,8 @@ export default {
       bpClauses: null,
       dialogRemarkList: [],
       dialogRemarksVisible: false,
-      dialogRemarksOrderId: 0,
+      dialogRemarksorderId: 0,
+      dialogFormVisible: false,
       statusObj: {
         '0': '待确认',
         '4': '交易完成',
@@ -193,12 +221,22 @@ export default {
         '31': '全部收款、待发货',
         '32': '全部收款、部分发货',
         '33': '全部收款、全部发货'
+      },
+      chengeOrder: {
+        orderId: this.$route.query.id * 1,
+        amount: '',
+        status: ''// 2部分收款 3已收款
+      },
+      rules: {
+        sataus: [{ required: true, message: '请选择机构类型', trigger: 'blur' }],
+        account: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
+        auditNote: [{ required: true, message: '请填写原因', trigger: 'blur' }]
       }
     }
   },
   computed: {
-    orderID: function() {
-      return this.$route.query.orderID * 1
+    orderId: function() {
+      return this.$route.query.id * 1
     }
   },
   created() {
@@ -207,7 +245,7 @@ export default {
   methods: {
     fetchData() {
       this.listLoading = true
-      getDetail({ id: this.orderID }).then(response => {
+      getDetail({ id: this.orderId }).then(response => {
         this.order = response.data.order
         this.bpClauses = response.data.bpClauses
         this.receiptAmount = response.data.receiptAmount
@@ -219,12 +257,42 @@ export default {
       })
     },
     RemarksOrder: function(id) {
-      getRemarks({ orderID: id }).then(response => {
+      getRemarks({ orderId: id }).then(response => {
         this.dialogRemarkList = response.data
       })
-      this.dialogRemarksOrderId = id
+      this.dialogRemarksorderId = id
       this.dialogRemarksVisible = true
     },
+    handeleDialogFormVisible() {
+      this.dialogFormVisible = true
+    },
+    handeleDropdown(type, orderId) {
+      switch (type) {
+        case 1:// 发货
+          this.$router.push({ path: '/order/deliver', query: { orderId: orderId }})
+          break
+        case 2:// 发货记录
+          this.$router.push({ path: '/order/deliver-record', query: { orderId: orderId }})
+          break
+        case 3:// 收退款记录
+          this.$router.push({ path: '/order/refund-record', query: { orderId: orderId }})
+          break
+        case 4:// 退款(退货)记录
+          this.$router.push({ path: '/finance/refund-record', query: { orderId: orderId }})
+          break
+      }
+    },
+    async handleChangOrder() {
+      // 更改订单收款状态
+      try {
+        await orderCheckReceipt(this.chengeOrder)
+        this.$message.success('操作成功')
+        this.dialogFormVisible = false
+        this.fetchData()
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
     backToList() {
       this.$store.dispatch('tagsView/delView', this.$route).then(() => {
         this.$nextTick(() => {

+ 14 - 17
src/views/order/list.vue

@@ -3,7 +3,7 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>订单ID:</span>
-        <el-input v-model="listQuery.orderID" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
+        <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
       </div>
       <div class="filter-control">
         <span>订单号:</span>
@@ -111,11 +111,11 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column label="订单ID" align="center" prop="orderID" width="65" />
+      <el-table-column label="订单ID" align="center" prop="orderId" width="65" />
       <el-table-column label="订单编号" align="center" prop="orderNo" />
       <el-table-column label="机构" align="center" prop="buyer" />
       <el-table-column label="收货人" align="center" prop="receiver" />
-      <el-table-column label="订单状态" align="center" prop="status" width="150px">
+      <el-table-column label="订单状态" align="center" prop="status" width="150">
         <template slot-scope="{row}">
           <template v-if="['11','12','13','21','22','23','31','32','33'].indexOf(row.status)>=0">
             <el-tag type="success" size="small">交易中</el-tag><span style="display: inline-block;margin:5px;">{{ statusObj[row.status] }}</span>
@@ -134,9 +134,9 @@
       </el-table-column>
       <el-table-column label="付款状态" align="center" prop="receiptStatus">
         <template slot-scope="{row}">
-          <el-tag v-if="row.receiptStatus*1===1" type="danger" size="small">待付款</el-tag>
-          <el-tag v-if="row.receiptStatus*1===2" type="warning" size="small">部分付款</el-tag>
-          <el-tag v-if="row.receiptStatus*1===3" type="success" size="small">已付款</el-tag>
+          <el-tag v-if="row.payStatus*1===1" type="danger" size="small">待付款</el-tag>
+          <el-tag v-if="row.payStatus*1===2" type="warning" size="small">部分付款</el-tag>
+          <el-tag v-if="row.payStatus*1===3" type="success" size="small">已付款</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="发货状态" align="center" prop="sendOutStatus">
@@ -159,19 +159,19 @@
           <el-tag v-else type="info" size="small">无</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="订单金额" align="center" prop="payTotalFee" min-width="90">
+      <el-table-column label="订单金额" align="center" prop="payTotalFee" width="90">
         <template slot-scope="{row}">
           ¥{{ row.payTotalFee | toThousandFloatFilter }}
         </template>
       </el-table-column>
-      <el-table-column align="center" label="下单时间" prop="orderTime" min-width="90">
+      <el-table-column align="center" label="下单时间" prop="orderTime" width="100">
         <template v-if="row.orderTime" slot-scope="{row}">
           <span>{{ row.orderTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="handleDetailes(row.orderID)">查看详情</el-button>
+          <el-button type="primary" size="mini" @click="handleDetailes(row.orderId)">查看详情</el-button>
           <!-- <el-dropdown>
             <el-button type="success" size="mini" style="width: 70px;margin:5px 0 0 0;">
               功能<i class="el-icon-arrow-down el-icon--right" />
@@ -186,9 +186,7 @@
         </template>
       </el-table-column>
     </el-table>
-
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
-
+    <pagination v-show="total>10" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
     <Remarks dialog-title="订单备注信息" :is-visible.sync="dialogRemarksVisible" :order-id="dialogRemarksOrderId" :remark-list="dialogRemarkList" />
     <template>
       <el-backtop style="right: 40px; bottom: 40px;">
@@ -200,11 +198,10 @@
 
 <script>
 import { getList, getRemarks } from '@/api/order'
-import Pagination from '@/components/Pagination'
 import pickerOptions from '@/utils/time-picker.js'
 import Remarks from './components/remarks'
 export default {
-  components: { Pagination, Remarks },
+  components: { Remarks },
   data() {
     return {
       time: '',
@@ -219,7 +216,7 @@ export default {
         index: 1,
         pageSize: 20,
         organizeId: this.$store.getters.organizeId,
-        orderID: '',
+        orderId: '',
         orderNo: '',
         buyer: '',
         receiver: '',
@@ -279,8 +276,8 @@ export default {
       })
     },
     // 查看订单详情
-    handleDetailes(orderID) {
-      this.$router.push({ path: '/order/detail', query: { orderID: orderID }})
+    handleDetailes(orderId) {
+      this.$router.push({ path: '/order/detail', query: { id: orderId }})
     },
     RemarksOrder: function(id) {
       getRemarks({ orderID: id }).then(response => {

+ 146 - 290
src/views/order/refund-detail.vue

@@ -7,116 +7,143 @@
     <div id="printBox" style="margin: 0 auto;">
       <h1 class="app-title">退款单</h1>
       <el-card ref="print" class="box-card" style="margin: 5px auto;">
-        <div class="refund-item">
-          <el-row :gutter="24" class="box-row">
-            <el-col :span="7"><b>退款编号:</b> T1678087730239854</el-col>
-            <el-col :span="6"><b>申请时间:</b> 2023-03-06 15:28:50</el-col>
-            <el-col :span="4"><b>申请金额:</b> 30000.00元</el-col>
-            <el-col :span="3"><b>退款状态:</b> 审核通过</el-col>
-          </el-row>
-          <el-row :gutter="24" class="box-row">
-            <el-col :span="24"><b>退款方式:</b> 线上退回:597.00元</el-col>
-          </el-row>
-        </div>
+        <el-table :data="cmReturnedPurchaseList" border fit highlight-current-row :header-cell-style="{background:'#eef1f6',color:'#606266'}">
+          <el-table-column label="退款编号:" align="center" prop="returnedNo" />
+          <el-table-column label="申请时间:" align="center" prop="confirmReturnTime" />
+          <el-table-column label="申请金额:" align="center" prop="refundFee" />
+          <el-table-column label="退款状态:" align="center" prop="status">
+            <template slot-scope="{row}">
+              <el-tag v-if="row.status*1===1" type="warning" size="small">待审核</el-tag>
+              <el-tag v-if="row.status*1===2" type="success" size="small">审核通过</el-tag>
+              <el-tag v-if="row.status*1===3" type="danger" size="small">审核不通过</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column label="退款方式:" align="center" prop="returnedWay">
+            <template slot-scope="{row}">
+              <span v-if="row.returnedWay*1===4">未支付无退款</span>
+              <span v-else-if="row.returnedWay*1===1">
+                <p v-if="row.refundBalanceFee*1 !== 0">余额账户:¥{{ row.refundBalanceFee | toThousandFloatFilter }}</p>
+                <p v-if="row.refundOnlineFee*1 !== 0">线上退回:¥{{ row.refundOnlineFee | toThousandFloatFilter }}</p>
+                <p v-if="row.refundOfflineFee*1 !== 0">线下转账:¥{{ row.refundOfflineFee | toThousandFloatFilter }}</p>
+              </span>
+              <span v-else>----</span>
+            </template>
+          </el-table-column>
+        </el-table>
       </el-card>
       <el-card ref="print" class="box-card" style="margin: 5px auto;">
         <div class="refund-item">
           <el-row :gutter="24" class="box-row">
-            <el-col :span="7"><b>订单编号(ID):</b> {{ repacts.orderNo }}({{ repacts.orderId }})</el-col>
-            <el-col :span="6"><b>下单时间:</b> {{ repacts.applyTime }}</el-col>
-            <el-col :span="4"><b>订单状态:</b> 交易中</el-col>
+            <el-col :span="7">
+              <b>订单编号(ID):</b>
+              {{ orderData.orderNo }}
+              ({{ orderData.orderId }})
+            </el-col>
+            <el-col :span="6">
+              <b>下单时间:</b>
+              {{ orderData.orderTime }}
+            </el-col>
+            <el-col :span="4">
+              <b>订单状态:</b>
+              <template v-if="['11','12','13','21','22','23','31','32','33'].indexOf(orderData.status)>=0">
+                <el-tag type="success" size="small">交易中({{ orderData.status | orderStatusFilter }})</el-tag>
+              </template>
+              <template v-else>
+                <el-tag :type="orderData.status*1===6?'info':''" size="small">{{ orderData.status | orderStatusFilter }}</el-tag>
+              </template>
+            </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="7"><b>订单金额:</b> {{ repacts.payableAmount }}</el-col>
-            <el-col :span="6"><b>应收金额:</b> {{ repacts.payableAmount }}</el-col>
-            <el-col :span="4"><b>机构运费:</b> 包邮</el-col>
+            <el-col :span="7"><b>订单金额:</b> {{ orderData.payTotalFee }}</el-col>
+            <el-col :span="6"><b>应收金额:</b> {{ orderData.payableAmount }}</el-col>
+            <el-col :span="4"><b>机构运费:</b>
+              <span v-if="orderData.freight*1===0">包邮</span>
+              <span v-else-if="orderData.freight*1===-1">到付</span>
+              <span v-else-if="orderData.freight*1===-2">仪器到付-产品包邮</span>
+              <span v-else>¥{{ orderData.freight }}</span>
+            </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="7"><b>收款状态:</b> {{ repacts.status | statusFilter }}</el-col>
-            <el-col :span="6"><b>发货状态:</b> {{ repacts.status | statusFilter }}</el-col>
-            <el-col :span="4"><b>付款状态:</b> {{ repacts.status | statusFilter }}</el-col>
-            <el-col :span="4"><b>退款状态:</b> {{ repacts.status | statusFilter }}</el-col>
+            <el-col :span="7">
+              <b>收款状态:</b>
+              <el-tag v-if="orderData.receiptStatus*1===1" type="danger" size="small">待收款</el-tag>
+              <el-tag v-if="orderData.receiptStatus*1===2" type="warning" size="small">部分收款</el-tag>
+              <el-tag v-if="orderData.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
+            </el-col>
+            <el-col :span="6">
+              <b>发货状态:</b>
+              <el-tag v-if="orderData.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
+              <el-tag v-if="orderData.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
+              <el-tag v-if="orderData.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
+            </el-col>
+            <el-col :span="4">
+              <b>付款状态:</b>
+              <el-tag v-if="orderData.payStatus*1===1" type="danger" size="small">待付款</el-tag>
+              <el-tag v-if="orderData.payStatus*1===2" type="warning" size="small">部分付款</el-tag>
+              <el-tag v-if="orderData.payStatus*1===3" type="success" size="small">已付款</el-tag>
+            </el-col>
+            <el-col :span="4">
+              <b>退款状态:</b>
+              <el-tag v-if="orderData.refundType*1===1" type="warning" size="small">部分退款</el-tag>
+              <el-tag v-if="orderData.refundType*1===2" type="success" size="small">全部付款</el-tag>
+              <el-tag v-else type="info" size="small">无退款</el-tag>
+            </el-col>
           </el-row>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="7"><b>机构名称:</b> {{ repacts.clubName }}</el-col>
-            <el-col :span="6"><b>收货人:</b> 黄志国(15817887257)</el-col>
-            <el-col :span="11"><b>地址:</b> 广东省深圳市龙华区大浪街道上早新村</el-col>
+            <el-col :span="7"><b>机构名称:</b> {{ orderData.clubName }}</el-col>
+            <el-col :span="6"><b>收货人:</b> {{ orderData.receiver }}({{ orderData.mobile }})</el-col>
+            <el-col :span="11"><b>地址:</b> {{ orderData.address }}</el-col>
           </el-row>
-          <el-table :data="repacts.shopOrderIdList" border fit highlight-current-row default-expand-all :header-cell-style="{background:'#e9f3f7',color:'#606266'}">
+          <el-table :data="orderData.newShopOrders" border fit highlight-current-row default-expand-all :header-cell-style="{background:'#e9f3f7',color:'#606266'}">
             <el-table-column label="商品信息" type="expand" width="110">
-              <template slot-scope="scope">
-                <el-table :data="scope.row.products" border fit highlight-current-row :header-cell-style="{background:'#f9f9f9',color:'#606266'}">
-                  <el-table-column label="商品图片" align="center" prop="image" width="100">
-                    <template slot-scope="{row}">
+              <template slot-scope="{row}">
+                <el-table :data="row.newOrderProducts" border fit highlight-current-row :header-cell-style="{background:'#f9f9f9',color:'#606266'}">
+                  <el-table-column label="商品图片" align="center" prop="productImage" width="100">
+                    <template slot-scope="scope">
                       <el-popover
                         placement="top-start"
                         title=""
                         width="120"
                         trigger="hover"
                       >
-                        <img :src="row.image" alt="" style="width:100px;height:100px;">
-                        <img slot="reference" :src="row.image" alt="" style="width:50px;height:50px;">
+                        <img :src="scope.row.productImage" alt="" style="width:100px;height:100px;">
+                        <img slot="reference" :src="scope.row.productImage" alt="" style="width:50px;height:50px;">
                       </el-popover>
                     </template>
                   </el-table-column>
-                  <el-table-column label="商品名" align="center" prop="productName" />
+                  <el-table-column label="商品名" align="center" prop="name" />
                   <el-table-column label="规格" align="center" prop="unit" />
                   <el-table-column label="购买数量" align="center" prop="num" width="100" />
-                  <el-table-column label="退货" align="center" prop="returnNum" width="100" />
+                  <el-table-column label="退货" align="center" prop="returnedPurchaseProductNum" width="100" />
                   <el-table-column label="单价" align="center" prop="price" />
-                  <el-table-column label="总额" align="center" prop="totalPrice" />
-                  <el-table-column label="已发货" align="center" prop="num" width="100" />
-                  <el-table-column label="已退货" align="center" prop="num" width="100" />
-                  <el-table-column label="本次退货" align="center" prop="num" width="100" />
-                  <el-table-column label="待发货" align="center" prop="num" width="100" />
-                  <el-table-column label="已取消" align="center" prop="num" width="100" />
-                  <el-table-column label="本次取消" align="center" prop="num" width="100" />
+                  <el-table-column label="总额" align="center" prop="totalFee" />
+                  <el-table-column label="已发货" align="center" prop="returnedPurchaseProductNum" width="100" />
+                  <el-table-column label="已退货" align="center" prop="returnedPurchaseProductNum" width="100" />
+                  <el-table-column label="本次退货" align="center" prop="returnedPurchaseProductNum" width="100" />
+                  <el-table-column label="待发货" align="center" prop="returnedPurchaseProductNum" width="100" />
+                  <el-table-column label="已取消" align="center" prop="returnedPurchaseProductNum" width="100" />
+                  <el-table-column label="本次取消" align="center" prop="returnedPurchaseProductNum" width="100" />
                 </el-table>
               </template>
             </el-table-column>
-            <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNos">
-              <template slot-scope="scope">
-                <span>{{ scope.row.shopOrderNos }}({{ scope.row.shopOrderIds }})</span>
+            <el-table-column label="子订单编号(ID)" align="center" prop="shopOrderNo">
+              <template slot-scope="{row}">
+                <span>{{ row.shopOrderNo }}({{ row.shopOrderId }})</span>
               </template>
             </el-table-column>
             <el-table-column label="子订单金额" align="center" prop="payShopTotals" />
-            <el-table-column label="收款状态" prop="status" align="center">
-              <template slot-scope="{ row }">
-                <span
-                  :class="{
-                    'el-span-warning': row.status == 0,
-                    'el-span-success': row.status == 1,
-                    'el-span-danger': row.status == 2
-                  }"
-                >
-                  待收款
-                </span>
-              </template>
-            </el-table-column>
-            <el-table-column label="发货状态" prop="status" align="center">
-              <template slot-scope="{ row }">
-                <span
-                  :class="{
-                    'el-span-warning': row.status == 0,
-                    'el-span-success': row.status == 1,
-                    'el-span-danger': row.status == 2
-                  }"
-                >
-                  待发货
-                </span>
+            <el-table-column label="发货状态" align="center" prop="receiptStatus">
+              <template slot-scope="{row}">
+                <el-tag v-if="row.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
+                <el-tag v-if="row.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
+                <el-tag v-if="row.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
               </template>
             </el-table-column>
-            <el-table-column label="付款状态" prop="status" align="center">
-              <template slot-scope="{ row }">
-                <span
-                  :class="{
-                    'el-span-warning': row.status == 0,
-                    'el-span-success': row.status == 1,
-                    'el-span-danger': row.status == 2
-                  }"
-                >
-                  待付款
-                </span>
+            <el-table-column label="退款状态" align="center" prop="receiptStatus">
+              <template slot-scope="{row}">
+                <el-tag v-if="row.refundType*1===1" type="warning" size="small">部分退款</el-tag>
+                <el-tag v-if="row.refundType*1===2" type="success" size="small">全部付款</el-tag>
+                <el-tag v-else type="info" size="small">无退款</el-tag>
               </template>
             </el-table-column>
             <el-table-column label="供应商" align="center" prop="shopName" />
@@ -127,9 +154,18 @@
         <div class="refund-item">
           <h1 class="refund-item-title">审核信息</h1>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="5"><b>审核人:</b> 卢海珠</el-col>
-            <el-col :span="6"><b>审核时间:</b> 2023-03-06 15:28:50</el-col>
-            <el-col :span="11"><b>审核备注:</b> 没有货了</el-col>
+            <el-col :span="5">
+              <b>审核人:</b>
+              {{ cmReturnedPurchase.reviewUserName ? cmReturnedPurchase.reviewUserName :'无' }}
+            </el-col>
+            <el-col :span="6">
+              <b>审核时间:</b>
+              {{ cmReturnedPurchase.confirmReturnTime ? cmReturnedPurchase.confirmReturnTime :'--' }}
+            </el-col>
+            <el-col :span="11">
+              <b>审核备注:</b>
+              {{ cmReturnedPurchase.reviewRemarks ? cmReturnedPurchase.reviewRemarks :'无' }}
+            </el-col>
           </el-row>
         </div>
       </el-card>
@@ -137,16 +173,25 @@
         <div class="refund-item">
           <h1 class="refund-item-title">申请信息</h1>
           <el-row :gutter="24" class="box-row">
-            <el-col :span="5"><b>申请人:</b> 卢海珠</el-col>
-            <el-col :span="6"><b>申请时间:</b> 2023-03-06 15:28:50</el-col>
-            <el-col :span="11"><b>退款备注:</b> 有部分没有货,客户需要重新下单</el-col>
+            <el-col :span="5">
+              <b>申请人:</b>
+              {{ cmReturnedPurchase.applicationUserName ? cmReturnedPurchase.applicationUserName :'无' }}
+            </el-col>
+            <el-col :span="6">
+              <b>申请时间:</b>
+              {{ cmReturnedPurchase.returnTime ? cmReturnedPurchase.returnTime :'--' }}
+            </el-col>
+            <el-col :span="11">
+              <b>退款备注:</b>
+              {{ cmReturnedPurchase.remarks ? cmReturnedPurchase.remarks :'无' }}
+            </el-col>
           </el-row>
         </div>
       </el-card>
       <el-card ref="print" class="box-card" style="margin: 5px 0 0 0;">
         <div class="refund-item">
           <el-row :gutter="24" class="box-row">
-            <el-col :span="14"><b>申请退款金额:</b> 30000.00元</el-col>
+            <el-col :span="14"><b>申请退款金额:</b>¥{{ cmReturnedPurchase.refundFee }}元</el-col>
             <el-col :span="5"><b>财务签名:</b> </el-col>
             <el-col :span="5"><b>总经理签名:</b> </el-col>
           </el-row>
@@ -157,7 +202,7 @@
 </template>
 
 <script>
-import { getDetail, getRemarks } from '@/api/order'
+import { getRefundDetail } from '@/api/order'
 export default {
   name: 'RefundRecord',
   filters: {
@@ -213,222 +258,33 @@ export default {
         extraCss: '',
         loading: false
       },
-      payRepacts: {
-        name: '卢海珠',
-        account: '6214 8328 2826 4957 ',
-        accountBank: '中国建设银行',
-        accountType: '公账'
-      },
-      repacts: {
-        id: 7580,
-        name: '卢海珠',
-        account: '6214 8328 2826 4957 ',
-        accountBank: '中国建设银行',
-        accountType: '公账',
-        type: '子订单付款',
-        shopName: '采美信息技术有限公司',
-        payableAmount: '20000.00',
-        shopOrderNo: 'P1682650952091471001',
-        shopOrderId: '19747',
-        orderNo: 'P16265095220221471',
-        orderId: '18179',
-        clubName: '广州白云区松洲蒂亚美容院',
-        applyMan: '路海珠',
-        applyTime: '2020-01-01:20:30:56',
-        verifyMan: '李昕',
-        verifyTime: '2020-01-01:20:30:56',
-        status: 0,
-        totalProduct: '3000.00',
-        payShopTotal: '3000.00',
-        childOrderId: ['P16265095220221471', 'P16265095220221471', 'P16265095220221471'],
-        shopOrderIdList: [
-          {
-            shopName: '采美信息技术有限公司',
-            shopOrderNos: 'P1682650952091471001',
-            shopOrderIds: '19747',
-            orderNos: 'P16265095220221471',
-            orderIds: '18179',
-            clubNames: '广州白云区松洲蒂亚美容院',
-            applyMans: '路海珠',
-            applyTimes: '2020-01-01:20:30:56',
-            verifyMans: '李昕',
-            verifyTimes: '2020-01-01:20:30:56',
-            statuss: 0,
-            totalProducts: '3000.00',
-            payShopTotals: '3000.00',
-            products: [
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          },
-          {
-            shopName: '采美信息技术有限公司',
-            shopOrderNos: 'P1682650952091471001',
-            shopOrderIds: '19747',
-            orderNos: 'P16265095220221471',
-            orderIds: '18179',
-            clubNames: '广州白云区松洲蒂亚美容院',
-            applyMans: '路海珠',
-            applyTimes: '2020-01-01:20:30:56',
-            verifyMans: '李昕',
-            verifyTimes: '2020-01-01:20:30:56',
-            statuss: 0,
-            totalProducts: '3000.00',
-            payShopTotals: '3000.00',
-            products: [
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              },
-              {
-                image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwmuAfQQrAAE3BA2cBSY028.jpg',
-                productName: '阶雪山之恋保滋润面霜吖',
-                unit: '50ml',
-                num: 3,
-                returnNum: 0,
-                price: '2000.00',
-                totalPrice: '6000.00',
-                costPrice: '1000.00',
-                totalCostPrice: '3000.00'
-              }
-            ]
-          }
-        ]
-      },
-      products: [
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        },
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        },
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        },
-        {
-          productName: '阶雪山之恋保滋润面霜吖',
-          unit: '50ml',
-          num: 3,
-          returnNum: 0,
-          price: '2000.00',
-          totalPrice: '6000.00',
-          costPrice: '1000.00',
-          totalCostPrice: '3000.00',
-          verifyTimes: '2020-01-01:20:30:56'
-        }
-      ],
-      activeIndex: '2',
-      order: null,
-      receiptAmount: 0,
-      returnValue: 0,
-      returnedPurchaseFee: 0,
-      bpClauses: null,
-      dialogRemarkList: [],
-      dialogRemarksVisible: false,
-      dialogRemarksOrderId: 0,
-      statusObj: {
-        '0': '待确认',
-        '4': '交易完成',
-        '5': '订单完成',
-        '6': '已关闭',
-        '7': '交易全退',
-        '11': '待收款、待发货',
-        '12': '待收款、部分发货',
-        '13': '待收款、全部发货',
-        '21': '部分收款、待发货',
-        '22': '部分收款、部分发货',
-        '23': '部分收款、全部发货',
-        '31': '全部收款、待发货',
-        '32': '全部收款、部分发货',
-        '33': '全部收款、全部发货'
-      }
+      orderData: {}, // 订单信息
+      cmReturnedPurchaseList: [], // 退款信息
+      cmReturnedPurchase: {}// 审核信息
     }
   },
   computed: {
-    orderID: function() {
-      return this.$route.query.orderID * 1
-    }
+
   },
   created() {
-    // this.fetchData()
+    this.getRefundDetail(this.$route.query.id)
   },
   methods: {
-    fetchData() {
-      this.listLoading = true
-      getDetail({ id: this.orderID }).then(response => {
-        this.order = response.data.order
-        this.bpClauses = response.data.bpClauses
-        this.receiptAmount = response.data.receiptAmount
-        this.returnValue = response.data.returnValue
-        this.returnedPurchaseFee = response.data.returnedPurchaseFee
-        this.listLoading = false
-      }).catch(() => {
-        this.listLoading = false
-      })
-    },
-    RemarksOrder: function(id) {
-      getRemarks({ orderID: id }).then(response => {
-        this.dialogRemarkList = response.data
-      })
-      this.dialogRemarksOrderId = id
-      this.dialogRemarksVisible = true
+    async getRefundDetail() {
+      try {
+        const res = await getRefundDetail(this.$route.query.id)
+        this.orderData = res.data.order
+        this.cmReturnedPurchaseList = res.data.cmReturnedPurchaseList
+        this.cmReturnedPurchase = res.data.cmReturnedPurchase
+      } catch (error) {
+        console.log('error', error)
+      }
     },
     backToList() {
       this.$store.dispatch('tagsView/delView', this.$route).then(() => {
         this.$nextTick(() => {
           this.$router.replace({
-            path: '/finance/list'
+            path: '/order/refund'
           })
         })
       })

+ 12 - 15
src/views/order/refund-record.vue

@@ -49,10 +49,6 @@
       <el-row :gutter="24" class="box-row">
         <el-col :span="6"><b>订单金额:</b> ¥{{ order.payTotalFee | toThousandFloatFilter }}</el-col>
         <el-col :span="6"><b>应收总额:</b> ¥{{ order.payableAmount | toThousandFloatFilter }}</el-col>
-        <el-col :span="6"><b>经理折扣:</b>
-          <template v-if="order.discountFee<0">¥0.00</template>
-          <template v-else> ¥{{ order.discountFee | toThousandFloatFilter }}</template>
-        </el-col>
         <el-col :span="6"><b>运费:</b>
           <template v-if="order.freight*1===0">包邮</template>
           <template v-else-if="order.freight*1===-1">到付</template>
@@ -170,26 +166,27 @@ export default {
     }
   },
   computed: {
-    orderID: function() {
-      return window.location.href.split('/').reverse()[0] * 1
+    orderId: function() {
+      return this.$route.query.orderId * 1
     }
   },
   created() {
     this.fetchData()
   },
   methods: {
-    fetchData() {
+    async fetchData() {
       this.listLoading = true
-      getRefundRecord({ orderID: this.orderID }).then(response => {
-        this.order = response.data.order
-        this.refundFee = response.data.refundFee
-        this.returnedPurchaseFee = response.data.returnedPurchaseFee
-        this.receipt = response.data.receipt
-        this.cmReturnedPurchaseList = response.data.cmReturnedPurchaseList
+      try {
+        const res = await getRefundRecord({ orderId: this.orderId })
+        this.order = res.data.order
+        this.refundFee = res.data.refundFee
+        this.returnedPurchaseFee = res.data.returnedPurchaseFee
+        this.receipt = res.data.receipt
+        this.cmReturnedPurchaseList = res.data.cmReturnedPurchaseList
         this.listLoading = false
-      }).catch(() => {
+      } catch (error) {
         this.listLoading = false
-      })
+      }
     },
     backToList() {
       let parentPath = '/order/list'

+ 12 - 13
src/views/order/refund-return.vue

@@ -10,10 +10,10 @@
       <el-button type="primary" icon="el-icon-back" style="float: right;" @click="backToList">返回</el-button>
     </div>
 
-    <el-card v-if="refundList.length === 0" class="box-card" style="text-align:center;">暂无退款退货详情记录.....</el-card>
+    <el-card v-if="refundList.length === 0" class="box-card" style="text-align:center;color: #999;">暂无退款退货详情记录~</el-card>
 
-    <template v-for="refund in refundList">
-      <el-card :key="'review-return'+refund.orderID" class="box-card">
+    <template v-else>
+      <el-card v-for="(refund,index) in refundList" :key="index" class="box-card">
         <div class="refund-item">
           <h3>审核信息</h3>
           <el-row :gutter="24" class="box-row">
@@ -207,7 +207,6 @@ export default {
   data() {
     return {
       activeIndex: '2',
-      bpClauses: [],
       order: null,
       refundList: [],
       statusObj: {
@@ -229,24 +228,24 @@ export default {
     }
   },
   computed: {
-    orderID: function() {
-      return window.location.href.split('/').reverse()[0] * 1
+    orderId: function() {
+      return this.$route.query.orderId * 1
     }
   },
   created() {
     this.fetchData()
   },
   methods: {
-    fetchData() {
+    async fetchData() {
       this.listLoading = true
-      getRefundReturn({ orderID: this.orderID }).then(response => {
-        this.order = response.data.order
-        this.bpClauses = response.data.bpClauses
-        this.refundList = response.data.cmReturnedPurchaseList
+      try {
+        const res = await getRefundReturn({ orderId: this.orderId })
+        this.order = res.data.order
+        this.refundList = res.data.cmReturnedPurchaseList
         this.listLoading = false
-      }).catch(() => {
+      } catch (error) {
         this.listLoading = false
-      })
+      }
     },
     backToList() {
       let parentPath = '/order/list'

+ 10 - 10
src/views/order/refund.vue

@@ -53,18 +53,11 @@
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
       <el-table-column label="退款编号" align="center" prop="returnedNo" />
-      <el-table-column label="退款审核状态" align="center" prop="status" width="90">
-        <template slot-scope="{row}">
-          <el-tag v-if="row.status*1===1" type="warning" size="small">待审核</el-tag>
-          <el-tag v-if="row.status*1===2" type="success" size="small">审核通过</el-tag>
-          <el-tag v-if="row.status*1===3" type="danger" size="small">审核不通过</el-tag>
-        </template>
+      <el-table-column label="订单编号(ID)" align="center" prop="orderNo" width="200">
+        <template slot-scope="{row}">{{ row.orderNo + '(' + row.orderId + ')' }}</template>
       </el-table-column>
       <el-table-column label="机构" align="center" prop="userName" />
-      <el-table-column label="订单编号(ID)" align="center" prop="orderNo">
-        <template slot-scope="{row}">{{ row.orderNo + '(' + row.orderID + ')' }}</template>
-      </el-table-column>
-      <el-table-column label="退款金额" align="center" prop="refundFee">
+      <el-table-column label="退款金额" align="center" prop="refundFee" width="110">
         <template slot-scope="{row}">¥{{ row.refundFee | toThousandFloatFilter }}</template>
       </el-table-column>
       <el-table-column label="退款方式" align="center" prop="returnedWay" min-width="130">
@@ -90,6 +83,13 @@
           <span>{{ row.confirmReturnTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="退款审核状态" align="center" prop="status" width="90">
+        <template slot-scope="{row}">
+          <el-tag v-if="row.status*1===1" type="warning" size="small">待审核</el-tag>
+          <el-tag v-if="row.status*1===2" type="success" size="small">审核通过</el-tag>
+          <el-tag v-if="row.status*1===3" type="danger" size="small">审核不通过</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
           <el-button type="primary" size="mini" @click="handleDetailes(row)">查看详情</el-button>