123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <a-card :bordered="false" class="allLdDetail-page-info">
- <!-- 搜索条件 -->
- <div class="allLdDetail-searchForm">
- <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="refresh">
- <a-row :gutter="24">
- <a-col :xs="24" :sm="12" :md="8" :lg="5">
- <a-form-item label="创建时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
- <a-range-picker
- id="allLdDetail-time"
- v-model="time"
- style="width: 100%;"
- :format="dateFormat"
- :placeholder="['开始时间','结束时间']"
- :disabledDate="disabledDate"
- @change="onChange" />
- </a-form-item>
- </a-col>
- <a-col :xs="24" :sm="12" :md="8" :lg="5">
- <a-form-item label="变动类型" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
- <v-select
- v-model="queryParam.changeType"
- ref="changeType"
- id="allLdDetail-status"
- code="GOLD_CHANGE_TYPE"
- placeholder="请选择"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :xs="24" :sm="12" :md="8" :lg="5">
- <a-form-item label="变动原因" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
- <v-select
- v-model="queryParam.operateType"
- ref="operateType"
- id="allLdDetail-status"
- code="GOLD_OPERATE_TYPE_ALL"
- placeholder="请选择"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :xs="24" :sm="12" :md="8" :lg="5">
- <a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
- <a-input id="boxSetting-name" allowClear :maxLength="30" v-model="queryParam.name" placeholder="请输入用户手机" />
- </a-form-item>
- </a-col>
- <a-col :xs="24" :sm="12" :md="8" :lg="4">
- <a-button class="handle-btn serach-btn" id="allLdDetail-btn-serach" type="primary" @click="refresh">查询</a-button>
- <a-button class="handle-btn" type="" id="allLdDetail-btn-reset" @click="handleReset">重置</a-button>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 总计 -->
- <a-alert type="info" showIcon style="margin-bottom:15px">
- <div class="ftext" slot="message">共<span> {{ }} </span>条,乐豆变动总计<span> {{ }} </span>个</div>
- </a-alert>
- <!-- 列表 -->
- <s-table
- ref="table"
- size="default"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- bordered>
- </s-table>
- </a-card>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- import { customerGoldLogDetail } from '@/api/userInfo.js'
- import moment from 'moment'
- import getDate from '@/libs/getDate.js'
- export default {
- name: 'ShopOrder',
- components: { STable, VSelect },
- data () {
- return {
- formItemLayout: {
- labelCol: { span: 7 },
- wrapperCol: { span: 17 }
- },
- // 将默认近七天时间日期回显在时间选择框中
- time: [
- moment(getDate.getRecentday().starttime, 'YYYY-MM-DD'),
- moment(getDate.getRecentday().endtime, 'YYYY-MM-DD')
- ],
- dateFormat: 'YYYY-MM-DD',
- // 查询参数
- queryParam: {
- beginDate: null, // 开始时间
- endDate: null, // 结束时间
- changeType: '', // 类型
- operateType: '' // 原因
- },
- info: '',
- // 表头
- columns: [
- { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
- { title: '创建时间', dataIndex: 'createDate', width: 200, align: 'center' },
- { title: '用户手机', dataIndex: '', width: 200, align: 'center' },
- { title: '变动类型', dataIndex: 'changeTypeDictValue', width: 200, align: 'center' },
- { title: '变动原因', dataIndex: 'operateTypeDictValue', width: 200, align: 'center' },
- { title: '乐豆变动量(个)', dataIndex: 'changeNum', width: 200, align: 'center' }
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- const searchData = Object.assign(parameter, this.queryParam)
- if (this.time && this.time.length) {
- searchData.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
- searchData.endDate = moment(this.time[1]).format('YYYY-MM-DD')
- } else {
- searchData.beginDate = ''
- searchData.endDate = ''
- }
- return customerGoldLogDetail(Object.assign(parameter, searchData)).then(res => {
- if (res.status == 200) {
- const no = (res.data.pageNo - 1) * res.data.pageSize
- for (let i = 0; i < res.data.list.length; i++) {
- const _item = res.data.list[i]
- _item.no = no + i + 1
- }
- return res.data
- }
- })
- }
- }
- },
- methods: {
- // 不可选日期
- disabledDate (date, dateStrings) {
- return date && date.valueOf() > Date.now()
- },
- // 创建时间change
- onChange (dates, dateStrings) {
- if ((dates, dateStrings)) {
- this.queryParam.beginDate = dateStrings[0]
- this.queryParam.endDate = dateStrings[1]
- }
- },
- // 查询
- refresh () {
- this.$refs.table.refresh(true)
- },
- // 重置
- handleReset () {
- this.time = [moment(getDate.getRecentday().starttime, 'YYYY-MM-DD'),
- moment(getDate.getRecentday().endtime, 'YYYY-MM-DD')]
- this.queryParam.changeType = ''
- this.queryParam.operateType = ''
- this.$refs.table.refresh(true)
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .allLdDetail-page-info{
- .page-header{
- margin-bottom: 15px;
- span{
- margin-left: 20px;
- }
- .page-header-info{
- margin-left:0;
- font-weight: bold;
- }
- }
- .allLdDetail-searchForm{
- .ant-form-inline .ant-form-item{
- width: 100%;
- }
- // 搜索框的下间距
- .ant-form-item {
- margin-bottom: 15px;
- }
- .handle-btn{
- margin-top: 4px;
- }
- .serach-btn{
- margin-right: 10px;
- }
- }
- }
- </style>
|