Bläddra i källkod

卫星仓、提现记录、分账记录

chenrui 4 år sedan
förälder
incheckning
37cd8724a4

+ 86 - 0
src/api/satelliteWH.js

@@ -0,0 +1,86 @@
+import { axios } from '@/utils/request'
+
+//  卫星仓库存  列表  有分页
+export const satelliteWHStockList = (params) => {
+  const url = `/satelliteWHStock/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  卫星仓库存  补货清单  列表
+export const satelliteWHSupplyList = (params) => {
+  const url = `/satelliteWHSupply/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  卫星仓库存  补货清单  新增
+export const satelliteWHSupplyInsert = (params) => {
+  return axios({
+    url: `/satelliteWHSupply/insert/${params.sn}`,
+    data: params.satelliteWarehouseSupply,
+    method: 'post'
+  })
+}
+//  卫星仓库存  补货清单  更新产品数量
+export const satelliteWHSupplyUpdate = (params) => {
+  return axios({
+    url: '/satelliteWHSupply/updateQty',
+    data: params,
+    method: 'post'
+  })
+}
+//  卫星仓库存  补货清单  移除产品
+export const satelliteWHSupplyDel = (params) => {
+  const url = `/satelliteWHSupply/deleteBySn/${params.sn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+//  卫星仓库存  补货清单  校验库存
+export const satelliteWHSupplyValidateStock = (params) => {
+  const url = `/satelliteWHSupply/validateStock/${params.sn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+//  卫星仓库存  补货清单  创建销售单
+export const satelliteWHSupplyAddSales = (params) => {
+  const url = `/satelliteWHSupply/createSalesBill/${params.sn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+//  提现  列表  有分页
+export const satelliteWHWithdrawalList = (params) => {
+  const url = `/satelliteWHWithdrawal/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  分账  列表  有分页
+export const satelliteWHSeparateList = (params) => {
+  const url = `/satelliteWHSeparate/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 60 - 60
src/config/router.config.js

@@ -751,16 +751,16 @@ export const asyncRouterMap = [
               permission: 'M_inventoryWarningList'
             }
           },
-          // {
-          //   path: '/inventoryManagement/satelliteWarehouseInventory',
-          //   name: 'satelliteWarehouseInventoryList',
-          //   component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/satelliteWarehouseInventory/list.vue'),
-          //   meta: {
-          //     title: '卫星仓库存',
-          //     icon: 'flag'
-          //     // permission: 'M_goodsShelves_0'
-          //   }
-          // },
+          {
+            path: '/inventoryManagement/satelliteWarehouseInventory',
+            name: 'satelliteWarehouseInventoryList',
+            component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/satelliteWarehouseInventory/list.vue'),
+            meta: {
+              title: '卫星仓库存',
+              icon: 'flag'
+              // permission: 'M_goodsShelves_0'
+            }
+          },
           {
             path: '/inventoryManagement/warehouse',
             redirect: '/inventoryManagement/warehouse/list',
@@ -1535,57 +1535,57 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/financialManagement/withdrawalManagement',
+            redirect: '/financialManagement/withdrawalManagement/list',
+            name: 'withdrawalManagement',
+            component: RouteView,
+            meta: {
+              title: '提现管理',
+              icon: 'dollar'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'withdrawalManagementList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/withdrawalManagement/list.vue'),
+                meta: {
+                  title: '提现管理列表',
+                  icon: 'dollar',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
+          },
+          {
+            path: '/financialManagement/ledgerRecord',
+            redirect: '/financialManagement/ledgerRecord/list',
+            name: 'ledgerRecord',
+            component: RouteView,
+            meta: {
+              title: '分账记录',
+              icon: 'profile'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'ledgerRecordList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/ledgerRecord/list.vue'),
+                meta: {
+                  title: '分账记录列表',
+                  icon: 'profile',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
           }
-          // {
-          //   path: '/financialManagement/withdrawalManagement',
-          //   redirect: '/financialManagement/withdrawalManagement/list',
-          //   name: 'withdrawalManagement',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '提现管理',
-          //     icon: 'dollar'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'withdrawalManagementList',
-          //       component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/withdrawalManagement/list.vue'),
-          //       meta: {
-          //         title: '提现管理列表',
-          //         icon: 'dollar',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     }
-          //   ]
-          // },
-          // {
-          //   path: '/financialManagement/ledgerRecord',
-          //   redirect: '/financialManagement/ledgerRecord/list',
-          //   name: 'ledgerRecord',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '分账记录',
-          //     icon: 'profile'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'ledgerRecordList',
-          //       component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/ledgerRecord/list.vue'),
-          //       meta: {
-          //         title: '分账记录列表',
-          //         icon: 'profile',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     }
-          //   ]
-          // }
         ]
       },
       // 中心店/配送店管理

+ 10 - 0
src/libs/getDate.js

@@ -26,6 +26,16 @@ export default {
     obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
     return obj
   },
+  //  近7天  年月日时分秒
+  getRecentTime () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment().subtract('days', 6).format('YYYY-MM-DD HH:mm:ss')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD HH:mm:ss')
+    return obj
+  },
   // 获取昨日的开始结束时间
   getYesterday () {
     const obj = {

+ 62 - 0
src/views/common/custSatelliteList.vue

@@ -0,0 +1,62 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :value="dealerName"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { custList } from '@/api/customer'
+export default {
+  props: {
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      dealerName: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      console.log('fetching user', dealerName)
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      custList({ name: dealerName, satelliteFlag: 1, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data.list || []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined, label: '' })
+    },
+    resetForm () {
+      this.dealerName = []
+    }
+  }
+}
+</script>

+ 62 - 0
src/views/common/rangeDateTime.vue

@@ -0,0 +1,62 @@
+<template>
+  <a-range-picker
+    style="width:100%"
+    :value="date"
+    show-time
+    :disabledDate="disabledDate"
+    :format="dateFormat"
+    @change="dateChange"
+    @calendarChange="dateCalendarChange"
+    :placeholder="['开始时间', '结束时间']" />
+</template>
+<script>
+import moment from 'moment'
+export default {
+  props: {
+    value: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      date: this.value,
+      dateFormat: 'YYYY-MM-DD HH:mm:ss',
+      selectPriceDate: ''
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (current) {
+      //  最早可倒推选择两年数据,最晚为今天
+      const minYearVs = moment().subtract(2, 'years') //  两年前   负值
+      const maxYearVs = moment().endOf('day') //  今天,包含今天
+      //  限制最多只能查一年区间的数据
+      if (this.selectPriceDate) {
+        const oMinYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD HH:mm:ss').subtract(1, 'years') //  当前选中开始日期前推一年
+        const oMaxYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD HH:mm:ss').add(1, 'years') //  当前选中开始日期后推一年
+        // 判断两个时间段是否相差m天  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+        const beginDate = minYearVs.diff(oMinYearVs, 'days') > 0 ? minYearVs : oMinYearVs // 若当前选中开始日期前推一年超出最多倒推两年数据时,则以两年为标准
+        const endDate = maxYearVs.diff(oMaxYearVs, 'days') > 0 ? oMaxYearVs : maxYearVs // 若当前选中开始日期后推一年超出今天时,则以今天为标准
+        return current && current < beginDate || current && current > endDate
+      } else {
+        return current && current > maxYearVs || current && current < minYearVs
+      }
+    },
+    // 日期  change
+    dateChange (date, dateStrings) {
+      this.selectPriceDate = ''
+      this.date = date
+      this.$emit('change', dateStrings)
+    },
+    dateCalendarChange (date, dateStrings) {
+      this.selectPriceDate = date[0]
+    },
+    resetDate (val) {
+      this.date = val || []
+    }
+  }
+}
+</script>

+ 51 - 87
src/views/financialManagement/ledgerRecord/list.vue

@@ -6,23 +6,23 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="分账时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
+              <rangeDateTime ref="rangeDate" :value="createDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称">
-              <a-input id="ledgerRecordList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入客户名称"/>
+              <custSatelliteList ref="custSatelliteList" @change="custSatelliteChange"></custSatelliteList>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="配件名称">
-              <a-input id="ledgerRecordList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入配件名称"/>
+              <a-input id="ledgerRecordList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入配件名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="配件编码">
-                <a-input id="ledgerRecordList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入配件编码"/>
+                <a-input id="ledgerRecordList-code" v-model.trim="queryParam.dealerProduct.code" allowClear placeholder="请输入配件编码"/>
               </a-form-item>
             </a-col>
           </template>
@@ -41,7 +41,7 @@
     </div>
     <!-- alert -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">分账金额: <strong>¥6</strong> 元</div>
+      <div slot="message">总计:<strong>{{ total }}</strong>条 ,分账金额:<strong>{{ totalAmount || '--' }}</strong> 元</div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -51,83 +51,70 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1540 }"
+      :scroll="{ x: 1690 }"
       bordered>
-      <!-- 结算单号 -->
-      <template slot="purchaseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseNo }}</span>
-      </template>
-      <!-- 结算方式 -->
-      <template slot="sss" slot-scope="text, record">
-        <span>{{ record.state == 1 ? '现金' : '微信' }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="dashed" @click="handleDetail(record)" id="ledgerRecordList-detail-btn">详情</a-button>
-      </template>
     </s-table>
   </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import rangeDate from '@/views/common/rangeDate.vue'
-// import { getRoleList, getServiceList } from '@/api/manage'
+import rangeDateTime from '@/views/common/rangeDateTime.vue'
+import custSatelliteList from '@/views/common/custSatelliteList.vue'
+import { satelliteWHSeparateList } from '@/api/satelliteWH'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDateTime, custSatelliteList },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      createDate: [
+        moment(getDate.getRecentTime().starttime, 'YYYY-MM-DD HH:mm:ss'),
+        moment(getDate.getRecentTime().endtime, 'YYYY-MM-DD HH:mm:ss')
+      ],
       // 查询参数
       queryParam: {
-        beginDate: '',
-        endDate: ''
+        customer: {
+          customerSn: undefined
+        },
+        dealerProduct: {
+          name: '',
+          code: ''
+        },
+        beginDate: getDate.getRecentTime().starttime,
+        endDate: getDate.getRecentTime().endtime
       },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '分账时间', dataIndex: 'name', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'pssayType', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联工单', dataIndex: 'paddyType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '配件名称', scopedSlots: { customRender: 'purchaseNo' }, align: 'center' },
-        { title: '配件编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'creatDate', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '分账类型', dataIndex: 'payType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分账金额(¥)', scopedSlots: { customRender: 'sss' }, width: 120, align: 'center' },
-        { title: '分账状态', dataIndex: 'paysType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'remarks', align: 'center', ellipsis: true }
+        { title: '分账时间', dataIndex: 'separateTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'customer.customerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '关联工单号', dataIndex: 'separateBizNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '配件名称', dataIndex: 'dealerProduct.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '配件编码', dataIndex: 'dealerProduct.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'productQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '分账金额(¥)', dataIndex: 'separateAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '分账状态', dataIndex: 'stateDictValue', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remark', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        return satelliteWHSeparateList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.total = data.list.length
+          return data
         })
-      }
+      },
+      total: 0, //  总条数
+      totalAmount: ''
     }
   },
   methods: {
@@ -136,41 +123,18 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/financialManagement/ledgerRecord/detail/${row.id}` })
-    },
-    //  审核
-    handleExamine (row, type) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
-        centered: true,
-        onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
-        }
-      })
+    custSatelliteChange (val) {
+      this.queryParam.customer.customerSn = val.key
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.$refs.rangeDate.resetDate(this.createDate)
+      this.queryParam.beginDate = getDate.getRecentTime().starttime
+      this.queryParam.endDate = getDate.getRecentTime().endtime
+      this.queryParam.customer.customerSn = undefined
+      this.queryParam.dealerProduct.name = ''
+      this.queryParam.dealerProduct.code = ''
+      this.$refs.custSatelliteList.resetForm()
       this.$refs.table.refresh(true)
     }
   }

+ 144 - 0
src/views/financialManagement/withdrawalManagement/cashOutModal.vue

@@ -0,0 +1,144 @@
+<template>
+  <a-modal
+    centered
+    class="cashOutModal-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="申请提现"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
+      <a-form-model
+        id="cashOutModal-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="申请提现金额" prop="brandName">
+          <a-input
+            id="cashOutModal-brandName"
+            :maxLength="30"
+            v-model.trim="form.brandName"
+            @change="filterEmpty"
+            placeholder="请输入以内的金额"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="实际扣除金额" prop="brandName">
+          <strong>24</strong>元(申请提现金额+提现手续费)
+        </a-form-model-item>
+        <a-form-model-item label="提现账户" prop="brandName">
+          <div>中国农业银行(杨光)</div>
+          <div>61256478784555454545</div>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">提交</a-button>
+        <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+export default {
+  name: 'ProductBrandEditModal',
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        brandName: '' // 产品品牌名称
+      },
+      rules: {
+        brandName: [
+          { required: true, message: '请输入产品品牌名称', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  methods: {
+    filterEmpty () {
+      let str = this.form.brandName
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.brandName = str
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          formData.id = _this.itemId ? _this.itemId : undefined
+          const fa = formData.brandName.substr(0, 1)
+          if (!isNaN(fa)) {
+            this.$message.error('品牌名称只能以汉字或字母开头')
+            return false
+          }
+          dealerProductBrandSave(formData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.form.brandName = this.nowData && this.nowData.brandName ? this.nowData.brandName : ''
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .cashOutModal-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 37 - 53
src/views/financialManagement/withdrawalManagement/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="提现时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
+              <rangeDateTime ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -18,13 +18,10 @@
         </a-row>
       </a-form>
     </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">可提现余额: <strong>¥6</strong> 元</div>
-    </a-alert>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="withdrawalManagementList-tx" type="primary" class="button-warning" @click="">申请提现</a-button>
+      <a-button id="withdrawalManagementList-tx" type="primary" class="button-warning" @click="handleCashOut">申请提现</a-button>
+      <div style="display: inline-block;margin-left: 80px;">可提现余额: <strong>¥6</strong> 元</div>
     </div>
     <!-- 列表 -->
     <s-table
@@ -34,20 +31,8 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1100 }"
+      :scroll="{ x: 1320 }"
       bordered>
-      <!-- 结算单号 -->
-      <template slot="purchaseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseNo }}</span>
-      </template>
-      <!-- 结算方式 -->
-      <template slot="sss" slot-scope="text, record">
-        <span>{{ record.state == 1 ? '现金' : '微信' }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="dashed" @click="handleDetail(record)" id="withdrawalManagementList-detail-btn">详情</a-button>
-      </template>
     </s-table>
     <!-- 提现说明 -->
     <div class="descriptions">
@@ -59,65 +44,54 @@
         <li><em>4、</em>提现账户为申请开通支付结算账户时所提供的账户信息。</li>
       </ul>
     </div>
+    <!-- 申请提现 -->
+    <cashOutModal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
-import rangeDate from '@/views/common/rangeDate.vue'
-// import { getRoleList, getServiceList } from '@/api/manage'
+import rangeDateTime from '@/views/common/rangeDateTime.vue'
+import cashOutModal from './cashOutModal.vue'
+import { satelliteWHWithdrawalList } from '@/api/satelliteWH'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDateTime, cashOutModal },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
       queryParam: {
-        beginDate: '',
-        endDate: ''
+        // beginDate: '',
+        // endDate: ''
       },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '提现时间', dataIndex: 'name', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '提现单号', dataIndex: 'paddyType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请提现金额', dataIndex: 'pssayType', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开户名', scopedSlots: { customRender: 'purchaseNo' }, width: 100, align: 'center' },
-        { title: '银行卡号', dataIndex: 'totalP', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'paysType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'remarks', align: 'center', ellipsis: true }
+        { title: '提现时间', dataIndex: 'cashOutDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提现单号', dataIndex: 'cashOutNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请提现金额', dataIndex: 'amount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '开户名', dataIndex: 'bankAccount', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '银行卡号', dataIndex: 'bankAccountNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remark', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        return satelliteWHWithdrawalList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
-      }
+      },
+      openModal: false, //  弹框
+      itemId: '', //  当前id
+      nowData: null //  当前记录数据
     }
   },
   methods: {
@@ -126,6 +100,16 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 申请提现
+    handleCashOut () {
+      this.openModal = true
+    },
+    handleOk () {
+      this.$refs.table.refresh(true)
+    },
+    closeModal () {
+      this.openModal = false
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ path: `/financialManagement/withdrawalManagement/detail/${row.id}` })

+ 80 - 46
src/views/inventoryManagement/satelliteWarehouseInventory/addModal.vue

@@ -7,39 +7,40 @@
     title="补货清单"
     v-model="isShow"
     @cancle="isShow=false"
-    width="80%">
+    :width="960">
     <!-- 补货清单 -->
     <div>
-      <h3 style="font-weight: bold;">车领主常青二路店</h3>
+      <h4 style="font-weight: bold;font-size: 16px;">{{ (nowData&&nowData.customerName) || '--' }}</h4>
       <s-table
         class="sTable"
         ref="table"
-        size="default"
+        size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
         :scroll="{ x: 1260 }"
+        :defaultLoadData="false"
         bordered>
         <!-- 补货数量 -->
-        <template slot="inventoryNumss" slot-scope="text, record">
+        <template slot="productQty" slot-scope="text, record">
           <a-button
             type="primary"
-            @click="handleNumSubtract"
+            @click="handleNumSubtract(record)"
             shape="circle"
             icon="minus"
             size="small"
             id="satelliteWarehouseInventoryList-num-add-btn"></a-button>
           <a-input-number
-            v-model="val"
+            v-model="record.productQty"
             :min="0"
             :max="999999"
             :precision="0"
             :step="1"
-            @change="onChange"
+            @change="e => onChange(e, record)"
             class="stepper" />
           <a-button
             type="primary"
-            @click="handleNumAdd"
+            @click="handleNumAdd(record)"
             shape="circle"
             icon="plus"
             size="small"
@@ -60,6 +61,7 @@
 
 <script>
 import { STable } from '@/components'
+import { satelliteWHSupplyList, satelliteWHSupplyUpdate, satelliteWHSupplyDel, satelliteWHSupplyValidateStock, satelliteWHSupplyAddSales } from '@/api/satelliteWH'
 export default {
   name: 'SatelliteWarehouseInventoryAddModal',
   components: { STable },
@@ -67,6 +69,10 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    nowData: {
+      type: Object,
+      default: null
     }
   },
   data () {
@@ -74,68 +80,91 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '客户名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '仓库名称', dataIndex: 'productBrand', align: 'center', ellipsis: true },
-        { title: '配件名称', dataIndex: 'productOldNum', align: 'center', ellipsis: true },
-        { title: '产品编码', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品原厂编码', dataIndex: 'productTyspe', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '补货数量', scopedSlots: { customRender: 'inventoryNumss' }, width: 200, align: 'center' },
+        { title: '客户名称', dataIndex: 'customer.customerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库名称', dataIndex: 'productBrand', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '配件名称', dataIndex: 'dealerProduct.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'dealerProduct.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品原厂编码', dataIndex: 'dealerProduct.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '补货数量', scopedSlots: { customRender: 'productQty' }, width: 200, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        return satelliteWHSupplyList(Object.assign(parameter, { customerSn: this.nowData.customerSn })).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          return data
         })
       },
       val: 1
     }
   },
   methods: {
-    //  获取详情
-    getDetail () {
-
-    },
     //  创建销售单
-    handleAdd () {},
+    handleAdd () {
+      const _this = this
+      // 校验库存
+      satelliteWHSupplyValidateStock({ sn: this.nowData.customerSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data.length == 0) {
+            // 创建销售单
+            _this.createSalesFun()
+          } else {
+            const str = res.data.join('、')
+            _this.$confirm({
+              title: '提示',
+              content: '产品编码为:【' + str + '】的产品库存不足!是否提交?',
+              centered: true,
+              onOk () {
+                _this.createSalesFun()
+              }
+            })
+          }
+        }
+      })
+    },
+    // 创建销售单
+    createSalesFun () {
+      satelliteWHSupplyAddSales({ sn: this.nowData.customerSn }).then(res => {
+        if (res.status == 200) {
+          this.$router.push({ name: 'salesEdit', params: { id: res.data.id, sn: res.data.salesBillSn, priceType: res.data.priceType } })
+        }
+      })
+    },
     //  补货数量  加
-    handleNumAdd () {
-      this.val < 999999 ? this.val++ : this.val
+    handleNumAdd (row) {
+      row.productQty < 999999 ? this.handleQty(++row.productQty, row) : row.productQty
     },
     //  补货数量  减
     handleNumSubtract (row) {
-      this.val > 1 ? this.val-- : this.handleRemove(row)
+      row.productQty > 1 ? this.handleQty(--row.productQty, row) : this.handleRemove(row)
     },
     //  删除配件信息
     handleRemove (row) {
-      console.log('删除')
+      satelliteWHSupplyDel({ sn: row.satelliteWarehouseSupplySn }).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+        }
+      })
     },
     //  补货数量  change
-    onChange (val) {
-      console.log(val)
+    onChange (val, row) {
+      val > 0 ? this.handleQty(val, row) : this.handleRemove(row)
+    },
+    handleQty (val, row) {
+      const params = {
+        satelliteWarehouseSupplySn: row.satelliteWarehouseSupplySn,
+        productSn: row.productSn,
+        productQty: val
+      }
+      satelliteWHSupplyUpdate(params).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+        }
+      })
     }
   },
   watch: {
@@ -147,6 +176,11 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+      } else {
+        const _this = this
+        setTimeout(() => {
+          _this.$refs.table.refresh(true)
+        }, 100)
       }
     }
   }

+ 129 - 109
src/views/inventoryManagement/satelliteWarehouseInventory/list.vue

@@ -9,145 +9,162 @@
         :rules="rules"
         :labelCol="labelCol"
         :wrapperCol="wrapperCol"
-        @keyup.enter.native="$refs.table.refresh(true)" >
+        @keyup.enter.native="getStockList(1)" >
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称" prop="customer">
-              <a-select
-                placeholder="请选择客户"
-                allowClear
-                v-model="queryParam.customer"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption"
-              >
-                <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
-              </a-select>
+            <a-form-model-item label="客户名称" prop="customer.customerSn">
+              <custSatelliteList ref="custSatelliteList" @change="custSatelliteChange"></custSatelliteList>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="配件名称">
-              <a-input id="satelliteWarehouseInventoryList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入配件名称" />
+              <a-input id="satelliteWarehouseInventoryList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入配件名称" />
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="配件编码">
-              <a-input id="satelliteWarehouseInventoryList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码或产品原厂编码" />
+              <a-input id="satelliteWarehouseInventoryList-queryWord" v-model.trim="queryParam.dealerProduct.queryWord" allowClear placeholder="请输入产品编码或产品原厂编码" />
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="satelliteWarehouseInventoryList-refresh" style="margin-top: 4px">
-              查询
-            </a-button>
-            <a-button @click="resetSearchForm" :disabled="disabled" id="satelliteWarehouseInventoryList-reset" style="margin: 4px 0 0 8px">重置</a-button>
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="satelliteWarehouseInventoryList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="satelliteWarehouseInventoryList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form-model>
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="satelliteWarehouseInventoryList-replenishment" type="primary" @click="handleReplenishment">
-        补货清单
-        <span v-if="checkedList.length>0">({{ checkedList.length }})</span>
-      </a-button>
+      <a-button id="satelliteWarehouseInventoryList-replenishment" type="primary" @click="handleReplenishment">补货清单</a-button>
     </div>
     <!-- 列表 -->
-    <s-table
+    <a-table
       class="sTable"
       ref="table"
       size="default"
-      :rowKey="record => record.id"
+      :rowKey="(record) => record.id"
       :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1010 }"
+      :data-source="loadData"
+      :pagination="paginationProps"
+      :loading="loading"
+      :scroll="{ x: 1210, y: tableHeight }"
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" v-if="checkedList.indexOf(record.id) != -1" @click="handleRemove(record)" id="satelliteWarehouseInventoryList-remove-btn">移出补货清单</a-button>
-        <a-button size="small" type="link" v-else @click="handleAdd(record)" id="satelliteWarehouseInventoryList-add-btn">加入补货单</a-button>
+        <a-button size="small" type="link" @click="handleAdd(record)" id="satelliteWarehouseInventoryList-add-btn">加入补货单</a-button>
       </template>
-    </s-table>
-    <!-- 客户详情 -->
-    <satellite-warehouse-inventory-add-modal :openModal="openModal" @close="closeModal" />
+    </a-table>
+    <!-- 补货单 -->
+    <satellite-warehouse-inventory-add-modal :openModal="openModal" :nowData="nowData" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import satelliteWarehouseInventoryAddModal from './addModal.vue'
-import { custAllList } from '@/api/customer'
+import custSatelliteList from '@/views/common/custSatelliteList.vue'
+import { satelliteWHStockList, satelliteWHSupplyInsert } from '@/api/satelliteWH'
 export default {
-  components: { STable, VSelect, satelliteWarehouseInventoryAddModal },
+  components: { STable, VSelect, satelliteWarehouseInventoryAddModal, custSatelliteList },
   data () {
     return {
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
+      tableHeight: 0,
       queryParam: {
-        //  查询条件
-        customer: undefined, //  客户名称
-        bundleName: '', //  套餐名称
-        itemName: '', //  服务名称
-        brand: undefined //  产品品牌
+        customer: {
+          customerSn: undefined
+        },
+        dealerProduct: {
+          name: '',
+          queryWord: ''
+        }
       },
       rules: {
-        customer: [{ required: true, message: '请输入客户名称', trigger: 'blur' }]
+        'customer.customerSn': [{ required: true, message: '请选择客户名称', trigger: ['blur', 'change'] }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      custAllList: [], //  客户 下拉数据
+      loading: false, //  表格加载中
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '客户名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '配件名称', dataIndex: 'productBrand', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '当前库存', dataIndex: 'inventoryNumss', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'customer.customerName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '配件名称', dataIndex: 'dealerProduct.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProduct.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'dealerProduct.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '当前库存', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
-              { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
-              { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
-            ]
-          }
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          _this.disabled = false
-          resolve(data)
-        })
+      loadData: [],
+      pageNo: 1, //  分页页码
+      pageSize: 10, //  分页 每页多少条
+      paginationProps: {
+        showSizeChanger: true, //  是否可以改变 pageSize
+        total: 0, //  分页总条数
+        current: 1,
+        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
+        onChange: (current) => this.changePage(current)
       },
-      openModal: false, //  查看客户详情  弹框
-      checkedList: [] //  加入补货单数据
+      openModal: false,
+      nowData: null
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    custSatelliteChange (val) {
+      this.queryParam.customer.customerSn = val.key
+      this.nowData = {
+        customerName: '',
+        customerSn: ''
+      }
+      this.nowData.customerName = val.label
+      this.nowData.customerSn = val.key
+    },
+    // 列表
+    getStockList (pageNo) {
+      this.pageNo = pageNo || this.pageNo
+      this.disabled = true
+      if (this.tableHeight == 0) {
+        this.tableHeight = window.innerHeight - 380
+      }
+      const params = {
+        pageNo: this.pageNo,
+        pageSize: this.pageSize
+      }
+      this.loading = true
+      satelliteWHStockList(Object.assign(params, this.queryParam)).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = data.pageNo
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.loadData = data.list
+          this.disabled = false
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.loadData = []
+        }
+      })
+    },
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.pageNo = current
+      this.pageSize = pageSize
+      this.getStockList()
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.pageNo = current
+      this.getStockList()
     },
     //  查询
     handleSearch () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          this.$refs.table.refresh(true)
+          this.getStockList(1)
         } else {
           console.log('error submit!!')
           return false
@@ -156,48 +173,51 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
+      this.queryParam.customer.customerSn = undefined
+      this.queryParam.dealerProduct.name = ''
+      this.queryParam.dealerProduct.queryWord = ''
+      this.$refs.custSatelliteList.resetForm()
+      this.nowData = null
+      this.paginationProps.total = 0
+      this.paginationProps.current = 1
+      this.loadData = []
+      this.getStockList(1)
     },
     //  补货清单
     handleReplenishment () {
-      this.openModal = true
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.openModal = true
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
     //  加入补货单
     handleAdd (row) {
-      this.checkedList.indexOf(row.id) == -1 ? this.checkedList.push(row.id) : null
-    },
-    //  移出补货单
-    handleRemove (row) {
-      this.checkedList.splice(this.checkedList.indexOf(row.id), 1)
-    },
-    //  关闭弹框
-    closeModal () {
-      this.openModal = false
-    },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
+      const params = {
+        sn: row.customerSn,
+        satelliteWarehouseSupply: {
+          productSn: row.dealerProduct.productSn,
+          productCode: row.dealerProduct.code,
+          productQty: 1
+        }
+      }
+      satelliteWHSupplyInsert(params).then(res => {
         if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
+          this.$message.success('添加成功')
         }
       })
     },
-    filterOption (input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    //  关闭弹框
+    closeModal () {
+      this.openModal = false
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getCustAllList()
+
     })
   }
 }