瀏覽代碼

接口对接

zhangdan 3 年之前
父節點
當前提交
89b2eff52b

+ 53 - 0
src/api/merchant.js

@@ -38,3 +38,56 @@ export const merchantCashOutDetail = (params) => {
     method: 'get'
   })
 }
+
+// 结算管理列表
+export const queryShelfSettleRulePage = (params) => {
+  const url = `/merchant/queryShelfSettleRulePage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 结算管理合计
+export const queryShelfSettleRuleCount = (params) => {
+  const url = `/merchant/queryShelfSettleRuleCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 结算历史列表
+export const querySettleBillPage = (params) => {
+  const url = `/merchant/querySettleBillPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 待结明细列表
+export const queryOrderBillDetailPage = (params) => {
+  const url = `/merchant/queryOrderBillDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 待结明细合计
+export const queryOrderBillDetailCount = (params) => {
+  const url = `/merchant/queryOrderBillDetailCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

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

@@ -233,7 +233,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'unDetail/:id',
+                path: 'unDetail/:shelfSn/:settleType/:shelfName',
                 name: 'unSettlementDetail',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/numsGoodsShelves/settlementManagement/unSettlementDetail.vue'),
                 meta: {
@@ -245,7 +245,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'detail/:id',
+                path: 'detail/:shelfSn/:shelfName',
                 name: 'settlementDetail',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/numsGoodsShelves/settlementManagement/settlementDetail.vue'),
                 meta: {
@@ -282,32 +282,32 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
-          {
-            path: '/numsGoodsShelves/accountManagement',
-            redirect: '/numsGoodsShelves/accountManagement/list',
-            name: 'accountManagement',
-            component: BlankLayout,
-            meta: {
-              title: '账户明细',
-              icon: 'monitor'
-              // permission: 'M_salesQueryList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'accountManagementList',
-                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/accountManagement/list.vue'),
-                meta: {
-                  title: '账户明细列表',
-                  icon: 'monitor',
-                  hidden: true
-                  // permission: 'M_salesQueryList'
-                }
-              }
-            ]
           }
+          // {
+          //   path: '/numsGoodsShelves/accountManagement',
+          //   redirect: '/numsGoodsShelves/accountManagement/list',
+          //   name: 'accountManagement',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '账户明细',
+          //     icon: 'monitor'
+          //     // permission: 'M_salesQueryList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'accountManagementList',
+          //       component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/accountManagement/list.vue'),
+          //       meta: {
+          //         title: '账户明细列表',
+          //         icon: 'monitor',
+          //         hidden: true
+          //         // permission: 'M_salesQueryList'
+          //       }
+          //     }
+          //   ]
+          // }
         ]
       },
       // 销售管理

+ 1 - 1
src/libs/tools.js

@@ -214,7 +214,7 @@ export const numberToFixed = function (val, num) {
 
   return _value
 }
-// 保留两位小数(不四舍五入)
+// 保留decimal位小数(不四舍五入)  num 数值,decimal要保留的小数位数
 export const formatDecimal = function (num, decimal) {
   num = num.toString()
   const index = num.indexOf('.')

+ 2 - 1
src/views/numsGoodsShelves/accountManagement/list.vue

@@ -45,7 +45,8 @@ import { STable } from '@/components'
 import { queryTradeFlowPage, merchantCashOutDetail } from '@/api/merchant'
 import { toThousands } from '@/libs/tools.js'
 export default {
-  components: { STable, commonMixin },
+  mixins: [commonMixin],
+  components: { STable },
   data () {
     return {
       toThousands,

+ 68 - 91
src/views/numsGoodsShelves/settlementManagement/detailModal.vue

@@ -8,46 +8,50 @@
     v-model="isShow"
     @cancle="isShow=false"
     width="70%">
-    <div class="chooseImport-con">
-      <a-descriptions :column="3">
-        <a-descriptions-item label="结算时间">
-          Zhou Maomao
-        </a-descriptions-item>
-        <a-descriptions-item label="结算金额">
-          1810000000
-        </a-descriptions-item>
-        <a-descriptions-item label="支付方式">
-          Hangzhou, Zhejiang
-        </a-descriptions-item>
-      </a-descriptions>
-      <!-- 可导入数据 -->
-      <a-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.allocateSn"
-        :columns="nowColumns"
-        :dataSource="loadData"
-        :loading="loading"
-        :scroll="{ y: 200 }"
-        :pagination="false"
-        bordered>
-      </a-table>
-    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="chooseImport-con">
+        <a-descriptions :column="3">
+          <a-descriptions-item label="结算时间">
+            {{ this.settleData &&this.settleData.payDate?this.settleData.payDate:'--' }}
+          </a-descriptions-item>
+          <a-descriptions-item label="结算金额">
+            {{ this.settleData &&this.settleData.settleAmount?toThousands(this.settleData.settleAmount,2):'--' }}
+          </a-descriptions-item>
+          <a-descriptions-item label="支付方式">
+            {{ this.settleData&&this.settleData.payWayDictValue?this.settleData.payWayDictValue:'--' }}
+          </a-descriptions-item>
+        </a-descriptions>
+        <!-- 可导入数据 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.allocateSn"
+          :columns="nowColumns"
+          :data="loadData"
+          :loading="loading"
+          :defaultLoadData="true"
+          :scroll="{ y: 200 }"
+          bordered>
+        </s-table>
+      </div>
+    </a-spin >
   </a-modal>
 </template>
 
 <script>
-// import { hdExportExcel } from '@/libs/exportExcel'
-// import { sparePartsDetailParseProducts, sparePartsDetailFailExcel } from '@/api/spareParts'
+import { STable } from '@/components'
+import { queryOrderBillDetailPage } from '@/api/merchant'
+import { toThousands } from '@/libs/tools.js'
 export default {
+  components: { STable },
   name: 'ChooseImportModal',
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    paramsData: {
+    settleData: {
       type: Object,
       default: () => {
         return {}
@@ -56,72 +60,42 @@ export default {
   },
   data () {
     return {
+      toThousands,
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '取货时间', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '订单编号', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '取货号', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品售价', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下单数量', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '合计金额', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '取货时间', dataIndex: 'outDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '订单编号', dataIndex: 'orderBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', width: '15%', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', width: '20%', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品售价', width: '10%', dataIndex: 'salePrice', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '下单数量', width: '8%', dataIndex: 'totalQty', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '合计金额', width: '10%', dataIndex: 'saleAmount', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } }
       ],
-      loadData: [],
+      loadData: parameter => {
+        this.spinning = true
+        const paramsPage = Object.assign(parameter)
+        paramsPage.settleBillSn = this.settleData ? this.settleData.settleBillSn : ''
+        return queryOrderBillDetailPage(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
       loading: false
     }
   },
   methods: {
-    getData () {
-      const _this = this
-      this.loading = true
-      const params = {
-        sparePartsSn: this.paramsData.sparePartsSn,
-        path: this.paramsData.path
-      }
-      // sparePartsDetailParseProducts(params).then(res => {
-      //   this.loading = false
-      //   if (res.status == 200) {
-      //     if (res.data.okList && res.data.okList.length > 0) {
-      //       res.data.okList.map((item, index) => {
-      //         item.no = index + 1
-      //       })
-      //     }
-      //     if (res.data.failList && res.data.failList.length > 0) {
-      //       res.data.failList.map((item, index) => {
-      //         item.no = index + 1
-      //       })
-      //     }
-      //     _this.loadData = res.data.okList || []
-      //     _this.unLoadData = res.data.failList || []
-      //   }
-      // })
-    },
-    // 确认导入
-    handleSubmit () {
-      if (this.loadData.length == 0) {
-        this.$message.warning('无可导入产品!')
-      } else {
-        this.$emit('ok', this.loadData)
-        this.isShow = false
-      }
-    },
-    // 导出
-    handleError () {
-      // const _this = this
-      // if (_this.unLoadData.length < 1) {
-      //   _this.$message.info('暂无可导出错误项~')
-      //   return
-      // }
-      // _this.spinning = true
-      // const params = {
-      //   list: _this.unLoadData
-      // }
-      // hdExportExcel(sparePartsDetailFailExcel, params, '产品导入错误项', function () {
-      //   _this.spinning = false
-      // })
-    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -132,10 +106,13 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.loadData = []
-        this.unLoadData = []
-      } else {
-        this.getData()
+      }
+    },
+    settleData (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        if (this.settleData && this.settleData.settleBillSn) {
+          this.$refs.table.refresh(true)
+        }
       }
     }
   }

+ 142 - 61
src/views/numsGoodsShelves/settlementManagement/list.vue

@@ -5,39 +5,65 @@
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
-            <a-col :xl="6" :lg="6" :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfList @change="shelfChange"></shelfList>
+                <shelfList ref="shelfList" @change="shelfChange" :itemSn="queryParam.shelfSn"></shelfList>
               </a-form-item>
             </a-col>
-            <a-col :xl="6" :lg="6" :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="关联客户">
-                <custList @change="custChange"></custList>
+                <custList ref="custList" @change="custChange" :itemSn="queryParam.customerSn" :isEnabled="true"></custList>
               </a-form-item>
             </a-col>
-            <a-col :xl="4" :lg="4" :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="结算方式">
-                <shelfSettType></shelfSettType>
+                <v-select code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择状态"></v-select>
               </a-form-item>
             </a-col>
-            <a-col :xl="4" :lg="4" :md="12" :sm="24">
-              <a-form-item label="待结金额">
-                <div style="display: flex;">
-                  <a-input-number/> <span style="margin: 0 10px;">至</span> <a-input-number/>
-                </div>
-              </a-form-item>
-            </a-col>
-            <a-col :xl="4" :lg="4" :md="6" :sm="6">
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="待结金额">
+                  <a-input-group>
+                    <a-row>
+                      <a-col :span="11">
+                        <a-input-number
+                          v-model="queryParam.beginAmount"
+                          placeholder="起始金额"
+                          :precision="2"
+                          :min="0"
+                          :max="999999"
+                          style="width: 100%;display: inline-block;"/>
+                      </a-col>
+                      <a-col :span="2"><span style="display: block;text-align: center;line-height: 32px;">至</span></a-col>
+                      <a-col :span="11">
+                        <a-input-number
+                          placeholder="截止金额"
+                          :precision="2"
+                          :min="0"
+                          :max="999999"
+                          v-model="queryParam.endAmount"
+                          style="width: 100%;display: inline-block;"/>
+                      </a-col>
+                    </a-row>
+                  </a-input-group>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="outboundOrderList-refresh" >查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
           </a-row>
         </a-form>
       </div>
       <a-alert type="info" style="margin:10px 0">
         <div slot="message" style="display: flex;align-items: center;padding: 2px 0;">
-          共:<strong>{{ }}</strong>条记录;
-          待结算金额合计¥<strong>{{ }}</strong>
+          共:<strong>{{ count }}</strong>条记录;
+          待结算金额合计¥<strong>{{ toThousands(total,2) }}</strong>
         </div>
       </a-alert>
       <s-table
@@ -72,89 +98,144 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { toThousands } from '@/libs/tools.js'
 import moment from 'moment'
-import { STable } from '@/components'
+import { STable, VSelect } from '@/components'
 import shelfList from '@/views/common/shelfList.vue'
 import custList from '@/views/common/custList.vue'
-import shelfSettType from '@/views/common/shelfSettleType.js'
+import { queryShelfSettleRulePage, queryShelfSettleRuleCount } from '@/api/merchant'
 export default {
-  components: { STable, commonMixin, shelfList, custList, shelfSettType },
+  components: { STable, shelfList, custList, VSelect },
+  mixins: [commonMixin],
   data () {
     return {
+      toThousands,
+      advanced: true, // 高级搜索 展开/关闭
       spinning: false,
       disabled: false,
       tableHeight: 0,
       showModal: false,
       currentData: null,
+      total: 0,
+      count: 0,
       time: [],
+      queryParam: {
+        shelfSn: undefined,
+        settleType: undefined,
+        beginAmount: '',
+        endAmount: ''
+      },
       columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '交易时间', dataIndex: 'createDate', width: '15%', align: 'center' },
-        { title: '调回单号', dataIndex: 'name', width: '30%', align: 'center' },
-        { title: '货架名称', dataIndex: '', width: '10%', align: 'center' },
-        { title: '状态', dataIndex: '', width: '10%', align: 'center' },
-        { title: '调回总量', dataIndex: '', width: '10%', align: 'center' },
-        { title: '操作', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '货架名称', dataIndex: 'shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '关联客户', dataIndex: 'dealerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '结算方式', dataIndex: 'settleTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '待结金额', dataIndex: 'waitSettleAmount', width: '15%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '操作', width: '15%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const _this = this
         _this.disabled = true
         _this.spinning = true
-        return new Promise(function (resolve, reject) {
-          const data = {
-            list: [{ id: 1, createDate: '2020-08-09' }]
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
-          }
-          _this.spinning = false
-          _this.disabled = false
-          resolve(data)
-        })
-
-        // const paramsPage = Object.assign(this.queryParam) //  有分页
-        // return reportSalesReturnThjdReportList(paramsPage).then(res => {
-        //   let data
-        //   if (res.status == 200) {
-        //     data = res.data
-        //     // this.getCount(paramsPage)
-        //     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
-        //   }
-        //   this.spinning = false
-        //   return data
-        // })
+        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        if (this.checkValueRange()) {
+          return queryShelfSettleRulePage(paramsPage).then(res => {
+            let data
+            if (res.status == 200) {
+              data = res.data
+              this.getCount(paramsPage)
+              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
+            }
+            this.spinning = false
+            return data
+          })
+        } else {
+          const _this = this
+          this.disabled = true
+          this.spinning = true
+          return new Promise(function (resolve, reject) {
+            const data = []
+            _this.disabled = false
+            _this.spinning = false
+            resolve(data)
+          })
+        }
       }
     }
   },
   methods: {
-    // 选择货架
-    shelfChange (data) {
-
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.customerSn = obj.key || undefined
+    },
+    // 货架  change
+    shelfChange (obj) {
+      this.queryParam.shelfSn = obj.key || undefined
     },
     // 禁止选择今天之后的日期
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    // 校验待结金额数值范围
+    checkValueRange () {
+      const isONull = this.queryParam.beginAmount === null || this.queryParam.beginAmount === undefined
+      const isOEmpty = this.queryParam.beginAmount === ''
+      const isOZero = this.queryParam.beginAmount === 0
+      const isTNull = this.queryParam.endAmount === null || this.queryParam.endAmount === undefined
+      const isTEmpty = this.queryParam.endAmount === ''
+      const isTZero = this.queryParam.endAmount === 0
+      //  第一个为空(可为null可为空字符)第二个不为空
+      //  第一个不为空第二个为空(可为null可为空字符)
+      //  第一个大于第二个
+      if ((isONull || isOEmpty) && (this.queryParam.endAmount || isTZero)) {
+        this.$message.info('请输入正确的待结金额查询范围!')
+        return false
+      }
+      if ((this.queryParam.beginAmount || isOZero) && (isTNull || isTEmpty)) {
+        this.$message.info('请输入正确的待结金额查询范围!')
+        return false
+      }
+      if (this.queryParam.beginAmount > this.queryParam.endAmount) {
+        this.$message.info('请输入正确的待结金额查询范围!')
+        return false
+      }
+      this.queryParam.beginAmount = this.queryParam.beginAmount > 999999999 ? 999999999 : this.queryParam.beginAmount
+      this.queryParam.endAmount = this.queryParam.endAmount > 999999999 ? 999999999 : this.queryParam.endAmount
+      return true
+    },
     // 重置
     resetSearchForm () {
       this.time = []
+      this.queryParam = {
+        shelfSn: undefined,
+        settleType: undefined,
+        beginAmount: '',
+        endAmount: ''
+      }
+      this.$refs.table.refresh(true)
     },
-    // 申请提现
-    handleTX () {
-      this.showModal = true
+    // 合计
+    getCount (val) {
+      queryShelfSettleRuleCount(val).then(res => {
+        if (res.status == 200) {
+          this.count = res.data.size || 0
+          this.total = res.data.waitSettleAmount || 0
+        }
+      })
     },
     // 待结明细
     handleUndetail (row) {
-      this.$router.push({ name: 'unSettlementDetail', params: { id: row.id } })
+      this.$router.push({ name: 'unSettlementDetail', params: { shelfSn: row.shelfSn, settleType: row.settleType, shelfName: row.shelfName } })
+      // this.$router.push({ path: `/numsGoodsShelves/settlementManagement/warehouseDetail/${row.shelfPlaceSn}/${row.productSn}` })
     },
     // 结算历史
     handleDetail (row) {
-      this.$router.push({ name: 'settlementDetail', params: { id: row.id } })
+      this.$router.push({ name: 'settlementDetail', params: { shelfSn: row.shelfSn, shelfName: row.shelfName } })
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 51 - 26
src/views/numsGoodsShelves/settlementManagement/settlementDetail.vue

@@ -4,7 +4,7 @@
       <a-page-header :ghost="false" :backIcon="false" class="goodsAllocationSet-baseInfo" >
         <template slot="subTitle">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
-          <span style="margin: 0 15px;color: #666;">货架名称:{{ '西安车领主常青二路数字货架' }}</span>
+          <span style="margin: 0 15px;color: #666;">{{ this.$route.params.shelfName||'--' }}</span>
         </template>
       </a-page-header>
       <a-card :bordered="false" size="small" class="goodsAllocationSet-baseInfo">
@@ -13,12 +13,12 @@
             <a-row :gutter="15">
               <a-col :xl="6" :lg="6" :md="12" :sm="24">
                 <a-form-item label="结算时间">
-                  <a-range-picker v-model="time" :format="dateFormat" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD"/>
+                  <a-range-picker v-model="time" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD" @change="dateChange"/>
                 </a-form-item>
               </a-col>
               <a-col :xl="6" :lg="6" :md="12" :sm="24">
                 <a-form-item label="支付方式">
-                  <v-select code="ENABLE_FLAG" v-model="form.isEnable" allowClear placeholder="请选择支付方式"></v-select>
+                  <v-select code="PAY_WAY" v-model="queryParam.payWay" allowClear placeholder="请选择支付方式"></v-select>
                 </a-form-item>
               </a-col>
               <a-col :xl="6" :lg="6" :md="6" :sm="6" >
@@ -54,7 +54,7 @@
         </s-table>
       </a-card>
       <!-- 导入货位模板 -->
-      <detailModal :openModal="openModal" @close="openModal=false"></detailModal>
+      <detailModal :openModal="openModal" @close="openModal=false" :settleData="settleData"></detailModal>
     </a-spin>
   </div>
 </template>
@@ -62,10 +62,13 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { getPowerUserList } from '@/api/power-user.js'
 import detailModal from './detailModal.vue'
+import moment from 'moment'
+import { querySettleBillPage } from '@/api/merchant'
+import { toThousands } from '@/libs/tools.js'
 export default {
-  components: { STable, VSelect, detailModal, commonMixin },
+  mixins: [commonMixin],
+  components: { STable, VSelect, detailModal },
   data () {
     return {
       spinning: false,
@@ -77,29 +80,26 @@ export default {
         wrapperCol: { span: 16 }
       },
       time: [],
-      form: {
-        isEnable: '',
-        name: '',
-        phone: '',
-        loginName: '',
-        sex: undefined,
-        loginFlag: '', // 状态
-        roleNames: undefined, // 角色
-        productMsg: '', // 图片
-        remarks: ''
+      queryParam: {
+        beginDate: '',
+        endDate: '',
+        payWay: undefined
       },
+      settleData: null,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '12.5%', align: 'center' },
-        { title: '结算时间', dataIndex: 'name', width: '25%', align: 'center', scopedSlots: { customRender: 'name' } },
-        { title: '结算金额', dataIndex: 'createDate', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '支付方式', dataIndex: '', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', width: '12.5%', align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '结算时间', dataIndex: 'payDate', width: '25%', align: 'center', scopedSlots: { customRender: 'name' } },
+        { title: '结算金额', dataIndex: 'settleAmount', width: '25%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '支付方式', dataIndex: 'payWayDictValue', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', width: '12.5%', align: 'right', scopedSlots: { customRender: 'action' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
-        return getPowerUserList(Object.assign(parameter)).then(res => {
+        const paramsPage = Object.assign(parameter, this.queryParam)
+        paramsPage.shelfSn = this.$route.params.shelfSn
+        return querySettleBillPage(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -107,7 +107,6 @@ export default {
             for (let i = 0; i < data.list.length; i++) {
               const _item = data.list[i]
               _item.no = no + i + 1
-              _item.loginFlag = _item.loginFlag + '' === '1'
             }
           }
           this.spinning = false
@@ -116,19 +115,45 @@ export default {
       }
     }
   },
-  mounted () {
-    this.$refs.table.refresh()
-  },
   methods: {
     handleBack () {
       this.$router.go(-1)
     },
+    dateChange (date) {
+	  this.queryParam.beginDate = moment(date[0]).format('YYYY-MM-DD')
+	  this.queryParam.endDate = moment(date[1]).format('YYYY-MM-DD')
+    },
+    disabledDate (current) {
+	  return current && current > moment().endOf('day')
+    },
     // 重置
-    resetSearchForm () {},
+    resetSearchForm () {
+      this.time = []
+      this.queryParam = {
+        beginDate: '',
+        endDate: '',
+        payWay: undefined
+      }
+      this.$refs.table.refresh(true)
+    },
     // 查看详情
     handleDetail (row) {
+      this.settleData = row
       this.openModal = true
     }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      // this.getPageInfo()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      // this.getPageInfo()
+      this.resetSearchForm()
+    }
   }
 }
 </script>

+ 102 - 42
src/views/numsGoodsShelves/settlementManagement/unSettlementDetail.vue

@@ -4,25 +4,25 @@
       <a-page-header :ghost="false" :backIcon="false" class="goodsAllocationSet-baseInfo" >
         <template slot="subTitle">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
-          <span style="margin: 0 15px;color: #666;">货架名称:{{ '西安车领主常青二路数字货架' }}</span>
+          <span style="margin: 0 15px;color: #666;"> {{ this.$route.params.shelfName||'--' }} </span>
         </template>
       </a-page-header>
       <!-- 额度统计 授信结算类型 显示-->
-      <a-card size="small" :bordered="false" style="margin-bottom: 10px;">
+      <a-card size="small" :bordered="false" style="margin-bottom: 10px;" v-if="this.$route.params.settleType=='CREDIT'">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="额度统计">
             <a-descriptions size="small" :column="4">
               <a-descriptions-item label="授信额度">
-                <a-statistic :precision="2" :value="112893" ><template #prefix>¥</template></a-statistic>
+                <span>{{ total && total.creditLimit? toThousands(total.creditLimit,2):'--' }}</span>
               </a-descriptions-item>
               <a-descriptions-item label="待结金额">
-                <a-statistic :precision="2" :value="112893" ><template #prefix>¥</template></a-statistic>
+                <span>{{ total && total.waitSettleAmount? toThousands(total.waitSettleAmount,2):'--' }}</span>
               </a-descriptions-item>
               <a-descriptions-item label="冻结金额">
-                <a-statistic :precision="2" :value="112893" ><template #prefix>¥</template></a-statistic>
+                <span>{{ total && total.freezeAmount? toThousands(total.freezeAmount,2):'--' }}</span>
               </a-descriptions-item>
               <a-descriptions-item label="可用额度">
-                <a-statistic :precision="2" :value="112893" ><template #prefix>¥</template></a-statistic>
+                <span>{{ total && total.usableAmount?toThousands(total.usableAmount,2):'--' }}</span>
               </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
@@ -34,17 +34,17 @@
             <a-row :gutter="15">
               <a-col :xl="6" :lg="6" :md="12" :sm="24">
                 <a-form-item label="下单时间">
-                  <a-range-picker v-model="time" :format="dateFormat" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD"/>
+                  <a-range-picker v-model="orderDate" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD" @change="orderDateChange"/>
                 </a-form-item>
               </a-col>
               <a-col :xl="6" :lg="6" :md="12" :sm="24">
                 <a-form-item label="取货时间">
-                  <a-range-picker v-model="time" :format="dateFormat" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD"/>
+                  <a-range-picker v-model="time" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD" @change="dateChange"/>
                 </a-form-item>
               </a-col>
               <a-col :xl="6" :lg="6" :md="12" :sm="24">
                 <a-form-item label="取货单编号">
-                  <a-input placeholder="请输入取货单编号"/>
+                  <a-input placeholder="请输入取货单编号" v-model="queryParam.orderBillNo" allowClear/>
                 </a-form-item>
               </a-col>
               <a-col :xl="6" :lg="6" :md="6" :sm="6" >
@@ -56,8 +56,8 @@
         </div>
         <a-alert type="info" style="margin:10px 0">
           <div slot="message" style="display: flex;align-items: center;padding: 2px 0;">
-            共<strong>25</strong>条记录;
-            待结算金额合计¥<strong>40000.00</strong>
+            共<strong>{{ count }}</strong>条记录;
+            待结算金额合计¥<strong>{{ priceTotal?toThousands(priceTotal,2):'--' }}</strong>
           </div>
         </a-alert>
         <s-table
@@ -70,10 +70,6 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
-          <template slot="name" slot-scope="text, record">
-            <a-input allowClear placeholder="请输入货位号" v-if="isEdit" style="width: 80%;"/>
-            <span v-if="!isEdit">{{ record.name }}</span>
-          </template>
         </s-table>
       </a-card>
       <!-- 导入货位模板 -->
@@ -85,12 +81,15 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { getPowerUserList } from '@/api/power-user.js'
-// import importHuoweiModal from './importHuoweiModal.vue'
+import { toThousands } from '@/libs/tools.js'
+import moment from 'moment'
+import { queryOrderBillDetailPage, queryOrderBillDetailCount, merchantCashOutDetail } from '@/api/merchant'
 export default {
+  mixins: [commonMixin],
   components: { STable, VSelect, commonMixin },
   data () {
     return {
+      toThousands,
       spinning: false,
       disabled: false,
       isEdit: false, // 货位号是否为编辑
@@ -100,41 +99,46 @@ export default {
         wrapperCol: { span: 16 }
       },
       time: [],
-      form: {
-        isEnable: '',
-        name: '',
-        phone: '',
-        loginName: '',
-        sex: undefined,
-        loginFlag: '', // 状态
-        roleNames: undefined, // 角色
-        productMsg: '', // 图片
-        remarks: ''
+      orderDate: [],
+      count: 0,
+      priceTotal: 0,
+      total: null,
+      queryParam: {
+        orderBeginDate: '',
+        orderEndDat: '',
+        outBeginDate: '',
+        outEndDate: '',
+        orderBillNo: ''
       },
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '取货时间', dataIndex: 'name', width: '11%', align: 'center', scopedSlots: { customRender: 'name' } },
-        { title: '订单编号', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货位号', dataIndex: '', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品售价', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下单数量', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '合计金额', width: '9%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '下单时间', dataIndex: 'orderDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '取货时间', dataIndex: 'outDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '订单编号', dataIndex: 'orderBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', width: '10%', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', width: '15%', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '结算价', width: '10%', dataIndex: 'settlePrice', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '下单数量', width: '8%', dataIndex: 'totalQty', align: 'center', customRender: function (text) { return toThousands(text) || '--' } },
+        { title: '合计金额', width: '10%', dataIndex: 'settleAmount', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
-        return getPowerUserList(Object.assign(parameter)).then(res => {
+        const paramsPage = Object.assign(parameter, this.queryParam)
+        paramsPage.settleState = 'WAIT'
+        paramsPage.billState = 'FINISH'
+        paramsPage.shelfSn = this.$route.params.shelfSn
+        return queryOrderBillDetailPage(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            this.getCount(paramsPage)
             const no = (data.pageNo - 1) * data.pageSize
             for (let i = 0; i < data.list.length; i++) {
               const _item = data.list[i]
               _item.no = no + i + 1
-              _item.loginFlag = _item.loginFlag + '' === '1'
             }
           }
           this.spinning = false
@@ -143,15 +147,71 @@ export default {
       }
     }
   },
-  mounted () {
-    this.$refs.table.refresh()
-  },
+
   methods: {
     handleBack () {
       this.$router.go(-1)
     },
+    orderDateChange (date) {
+      console.log(date, date)
+      this.orderDate = date
+      this.queryParam.orderBeginDate = moment(date[0]).format('YYYY-MM-DD')
+      this.queryParam.orderEndDat = moment(date[1]).format('YYYY-MM-DD')
+    },
+    dateChange (date) {
+      this.time = date
+      this.queryParam.outBeginDate = moment(date[0]).format('YYYY-MM-DD')
+      this.queryParam.outEndDate = moment(date[1]).format('YYYY-MM-DD')
+    },
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    getPageInfo () {
+      this.spinning = true
+      merchantCashOutDetail({}).then(res => {
+        console.log(res, '===========')
+        if (res.status == 200) {
+          this.total = res.data
+        } else {
+          this.total = null
+        }
+        this.spinning = false
+      })
+    },
+    getCount (val) {
+      queryOrderBillDetailCount(val).then(res => {
+        if (res.status == 200) {
+          this.count = res.data.detailNum
+          this.priceTotal = res.data.settleAmount
+        }
+      })
+    },
     // 重置
-    resetSearchForm () {}
+    resetSearchForm () {
+      this.time = []
+      this.orderDate = []
+      this.queryParam = {
+        orderBeginDate: '',
+        orderEndDat: '',
+        outBeginDate: '',
+        outEndDate: '',
+        orderBillNo: ''
+      }
+      this.$refs.table.refresh(true)
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.getPageInfo()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.getPageInfo()
+      this.resetSearchForm()
+    }
   }
 }
 </script>

+ 16 - 15
src/views/numsGoodsShelves/withdrawalManagement/list.vue

@@ -20,7 +20,7 @@
       <div style="margin:10px 0">
         <div style="display: flex;align-items: center;padding: 2px 0;">
           <div style="display: flex;align-items: center;">
-            可提现金额:<span>{{pageInfo?toThousands(pageInfo.activeAmount,2):'--'}}</span>
+            可提现金额:<span>{{ pageInfo?toThousands(pageInfo.activeAmount,2):'--' }}</span>
             <a-button size="small" type="primary" class="button-primary" @click="handleTX">申请提现</a-button>
             <span>(提示:① 提现手续费为0.5元/笔;② 资金到账周期为工作日+1天)</span>
           </div>
@@ -49,10 +49,11 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import { STable } from '@/components'
 import applyWithdrawal from './applyWithdrawal.vue'
-import {queryMerchantCashOutPage,merchantCashOutDetail} from '@/api/merchant'
-import {toThousands} from '@/libs/tools.js'
+import { queryMerchantCashOutPage, merchantCashOutDetail } from '@/api/merchant'
+import { toThousands } from '@/libs/tools.js'
 export default {
-  components: { STable, applyWithdrawal, commonMixin },
+  mixins: [commonMixin],
+  components: { STable, applyWithdrawal },
   data () {
     return {
       toThousands,
@@ -62,16 +63,16 @@ export default {
       showModal: false,
       currentData: null,
       time: [],
-      pageInfo:null,
-      queryParam:{
-        beginDate:'',
-        endDate:''
+      pageInfo: null,
+      queryParam: {
+        beginDate: '',
+        endDate: ''
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '提现单号', dataIndex: 'cashOutNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '提现时间', dataIndex: 'cashOutDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请提现金额', dataIndex: 'amount', width: '10%', align: 'right', customRender: function (text) { return toThousands(text,2) || '--' } },
+        { title: '申请提现金额', dataIndex: 'amount', width: '10%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
         { title: '开户名', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '银行卡号', dataIndex: 'bankCard', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '提现人', dataIndex: 'operName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -83,9 +84,9 @@ export default {
         const _this = this
         _this.disabled = true
         _this.spinning = true
-        const paramsPage = Object.assign(parameter,this.queryParam) //  有分页
-        paramsPage.merchantSn=this.pageInfo?this.pageInfo.merchantSn:''
-         paramsPage.merchantType='DEALER'
+        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        paramsPage.merchantSn = this.pageInfo ? this.pageInfo.merchantSn : ''
+        paramsPage.merchantType = 'DEALER'
         return queryMerchantCashOutPage(paramsPage).then(res => {
           let data
           if (res.status == 200) {
@@ -105,9 +106,9 @@ export default {
   methods: {
     // 时间改变
     dateChange (date) {
-      console.log(date,'date')
-      this.queryParam.beginDate=moment(date[0]).format('YYYY-MM-DD') 
-      this.queryParam.endDate=moment(date[1]).format('YYYY-MM-DD') 
+      console.log(date, 'date')
+      this.queryParam.beginDate = moment(date[0]).format('YYYY-MM-DD')
+      this.queryParam.endDate = moment(date[1]).format('YYYY-MM-DD')
     },
     // 禁止选择今天之后的日期
     disabledDate (current) {