|
@@ -4,19 +4,19 @@
|
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :span="6">
|
|
|
- <a-form-item label="投递时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <a-form-item label="投递时间:" :label-col="{ span: 7 }" :wrapper-col="{ span: 17}">
|
|
|
<a-range-picker
|
|
|
- id="shopOrder-time"
|
|
|
- v-model="time"
|
|
|
- :format="dateFormat"
|
|
|
- :placeholder="['开始时间','结束时间']"
|
|
|
+ style="width:100%"
|
|
|
+ id="PaySettlementRecords-queryOrderDate"
|
|
|
:disabledDate="disabledDate"
|
|
|
- @change="onChange" />
|
|
|
+ v-model="queryOrderDate"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ :placeholder="['开始时间', '结束时间']" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="设备编号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-input id="shopOrder-orderNo" allowClear :maxLength="30" v-decorator="[ 'queryParam.orderNo', { initialValue: queryParam.orderNo, getValueFromEvent: $filterEmpty, rules: [] }]" placeholder="请输入设备编号" />
|
|
|
+ <a-input id="shopOrder-srcDeviceCode" allowClear :maxLength="30" v-model=" queryParam.srcDeviceCode " placeholder="请输入设备编号" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
@@ -38,7 +38,7 @@
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="用户账号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-input id="shopOrder-contactPhone" allowClear :maxLength="11" v-decorator="[ 'queryParam.contactPhone', { initialValue: queryParam.contactPhone, getValueFromEvent: $filterEmpty, rules: [] }]" placeholder="请输入用户账号" />
|
|
|
+ <a-input id="shopOrder-customerMobile" allowClear :maxLength="11" v-model=" queryParam.customerMobile" placeholder="请输入用户账号" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -56,17 +56,26 @@
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
<!-- 订单状态 -->
|
|
|
- <!-- <template slot="orderStatus" slot-scope="text, record">
|
|
|
- <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
|
|
|
- </template> -->
|
|
|
- <!-- 订单总额 -->
|
|
|
- <template slot="orderPrice" slot-scope="text, record">
|
|
|
- <span>{{ record.orderPrice || 0 }}乐豆</span>
|
|
|
+ <template slot="one" slot-scope="text, record">
|
|
|
+ <span v-if="record.rubbishType=='CLOTHING'">{{ record.rubbishWeight }}</span>
|
|
|
+ <span v-else>0</span>
|
|
|
+ </template>
|
|
|
+ <template slot="two" slot-scope="text, record">
|
|
|
+ <span v-if="record.rubbishType=='PAPER'">{{ record.rubbishWeight }}</span>
|
|
|
+ <span v-else>0</span>
|
|
|
+ </span></template>
|
|
|
+ <template slot="therr" slot-scope="text, record">
|
|
|
+ <span v-if="record.rubbishType=='PLASTIC'">{{ record.rubbishWeight }}</span>
|
|
|
+ <span v-else>0</span>
|
|
|
+ </template>
|
|
|
+ <template slot="four" slot-scope="text, record">
|
|
|
+ <span v-if="record.rubbishType=='METAL'">{{ record.rubbishWeight }}</span>
|
|
|
+ <span v-else>0</span>
|
|
|
+ </template>
|
|
|
+ <template slot="five" slot-scope="text, record">
|
|
|
+ <span v-if="record.rubbishType=='RUBBISH'">{{ record.rubbishWeight }}</span>
|
|
|
+ <span v-else>0</span>
|
|
|
</template>
|
|
|
- <!-- 操作 -->
|
|
|
- <!-- <template slot="action" slot-scope="text, record">
|
|
|
- <a-icon type="eye" id="shopOrder-handleView" title="详情" class="actionBtn icon-green" @click="handleView(record)" />
|
|
|
- </template> -->
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
|
|
@@ -74,10 +83,9 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import getDate from '@/libs/getDate.js'
|
|
|
+import { getDeliveryLogList, getDeliveryLogTotal } from '@/api/releaseRecord.js'
|
|
|
import moment from 'moment'
|
|
|
export default {
|
|
|
- name: 'ShopOrder',
|
|
|
components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
@@ -86,58 +94,58 @@ export default {
|
|
|
labelCol: { span: 4 },
|
|
|
wrapperCol: { span: 16 }
|
|
|
},
|
|
|
+ queryOrderDate: undefined,
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
beginDate: null, // 开始时间
|
|
|
endDate: null, // 结束时间
|
|
|
- contactPhone: '', // 用户手机
|
|
|
- orderNo: '', // 订单编号
|
|
|
- orderStatus: null // 订单状态
|
|
|
+ customerMobile: '', // 用户手机
|
|
|
+ srcDeviceCode: '', // 设备编号
|
|
|
+ orderStatus: null // 网点名称
|
|
|
},
|
|
|
+ orderTotal: 0, // 总单数
|
|
|
+ amountTotal: 0, // 总金额
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '投放时间', dataIndex: 'orderDate', width: 200, align: 'center' },
|
|
|
- { title: '网点名称', dataIndex: 'userMoblie', width: 200, align: 'center' },
|
|
|
- { title: '设备编号', dataIndex: 'orderNo', width: 200, align: 'center' },
|
|
|
- { title: '用户账号', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
|
|
|
- { title: '本次兑换乐豆(个)', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
|
|
|
- { title: '1号箱(g)', width: 200, align: 'center' },
|
|
|
- { title: '2号箱(g)', width: 200, align: 'center' },
|
|
|
- { title: '3号箱(g)', width: 200, align: 'center' },
|
|
|
- { title: '4号箱(g)', width: 200, align: 'center' }
|
|
|
+ { title: '投放时间', dataIndex: 'deliveryTime', width: 200, align: 'center' },
|
|
|
+ { title: '网点名称', dataIndex: 'stationName', width: 200, align: 'center' },
|
|
|
+ { title: '设备编号', dataIndex: 'srcDeviceCode', width: 200, align: 'center' },
|
|
|
+ { title: '用户账号', dataIndex: 'customerMobile', width: 200, align: 'center' },
|
|
|
+ { title: '本次兑换乐豆(个)', dataIndex: 'goldNum', width: 200, align: 'center' },
|
|
|
+ { title: '内置各箱体投放重量(g)',
|
|
|
+ children: [
|
|
|
+ { title: '废旧衣物', width: 200, align: 'center', scopedSlots: { customRender: 'one' } },
|
|
|
+ { title: '废旧纸张', width: 200, align: 'center', scopedSlots: { customRender: 'two' } },
|
|
|
+ { title: '废旧塑料', width: 200, align: 'center', scopedSlots: { customRender: 'therr' } },
|
|
|
+ { title: '废旧金属', width: 200, align: 'center', scopedSlots: { customRender: 'four' } },
|
|
|
+ { title: '有害垃圾', width: 200, align: 'center', scopedSlots: { customRender: 'five' } }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- // return getTenantsList(Object.assign(parameter, this.queryParam)).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
|
|
|
- // _item.status = _item.status + '' === '1'
|
|
|
- // }
|
|
|
- // return res.data
|
|
|
- // }
|
|
|
- // })
|
|
|
- return new Promise((resolve) => {
|
|
|
- const data = [
|
|
|
- { no: 1, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
- { no: 2, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
|
|
|
- { no: 3, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
- { no: 4, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
- { no: 5, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
|
|
|
- { no: 6, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' }
|
|
|
- ]
|
|
|
- resolve(data)
|
|
|
+ const searchData = Object.assign(parameter, this.queryParam)
|
|
|
+ if (this.queryOrderDate && this.queryOrderDate.length) {
|
|
|
+ searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
|
+ searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
|
|
|
+ } else {
|
|
|
+ searchData.beginDate = ''
|
|
|
+ searchData.endDate = ''
|
|
|
+ }
|
|
|
+ return getDeliveryLogList(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
|
|
|
+ }
|
|
|
+ this.getListTotal()
|
|
|
+ return res.data
|
|
|
+ }
|
|
|
})
|
|
|
- },
|
|
|
- // 将默认当天时间日期回显在时间选择框中
|
|
|
- time: [
|
|
|
- moment(getDate.getToday().starttime, this.dateFormat),
|
|
|
- moment(getDate.getToday().endtime, this.dateFormat)
|
|
|
- ],
|
|
|
- dateFormat: 'YYYY-MM-DD'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
@@ -158,20 +166,39 @@ export default {
|
|
|
this.queryParam.endDate = dateStrings[1]
|
|
|
}
|
|
|
},
|
|
|
- // 查看详情
|
|
|
- // handleView (row) {
|
|
|
- // this.$router.push({ path: `/shop/order/detail/${row.no}` })
|
|
|
- // },
|
|
|
+ // 合计
|
|
|
+ getListTotal () {
|
|
|
+ const params = {
|
|
|
+ customerMobile: this.queryParam.customerMobile,
|
|
|
+ beginDate: this.queryParam.beginDate,
|
|
|
+ endDate: this.queryParam.endDate,
|
|
|
+ srcDeviceCode: this.queryParam.srcDeviceCode, // 设备编号
|
|
|
+ orderStatus: this.queryParam.orderStatus // 网点名称
|
|
|
+ }
|
|
|
+ if (this.queryOrderDate && this.queryOrderDate.length) {
|
|
|
+ params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
|
+ params.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
|
|
|
+ } else {
|
|
|
+ params.beginDate = ''
|
|
|
+ params.endDate = ''
|
|
|
+ }
|
|
|
+ getDeliveryLogTotal(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ if (res.data) {
|
|
|
+ this.orderTotal = res.data.totalNum || 0
|
|
|
+ this.amountTotal = res.data.goldNum || 0
|
|
|
+ } else {
|
|
|
+ this.orderTotal = 0
|
|
|
+ this.amountTotal = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 重置
|
|
|
handleReset () {
|
|
|
- this.queryParam.beginDate = getDate.getToday().starttime
|
|
|
- this.queryParam.endDate = getDate.getToday().endtime
|
|
|
- this.time = [
|
|
|
- moment(getDate.getToday().starttime, this.dateFormat),
|
|
|
- moment(getDate.getToday().endtime, this.dateFormat)
|
|
|
- ]
|
|
|
- this.queryParam.contactPhone = ''
|
|
|
- this.queryParam.orderNo = ''
|
|
|
+ this.queryOrderDate = undefined
|
|
|
+ this.queryParam.customerMobile = ''
|
|
|
+ this.queryParam.srcDeviceCode = ''
|
|
|
this.queryParam.orderStatus = null
|
|
|
this.$refs.table.refresh(true)
|
|
|
}
|