Commit c871cecd by 李长胜

订单tab选择

1 parent ae7ee1c1
......@@ -64,59 +64,60 @@
</div> -->
<div class="equity-wrap">
<div class="equity-wrap contain">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row style="display: flex; align-items: center">
<el-form-item size="small" label="订单编号">
<el-input size="small" v-model="searchForm.orderCode" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item size="small" label="品牌名称">
<el-select size="small" v-model="searchForm.brandName" filterable placeholder="请选择" >
<el-option v-for="item in brandList" :key="item.brandId" :label="item.brandName" :value="item.brandName"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="商品名称">
<el-input v-model="searchForm.productName" placeholder="请输入" size="small" ></el-input>
</el-form-item>
</el-row>
<el-row >
<el-form-item size="small" label="门店名称">
<el-input v-model="searchForm.merchantName" placeholder="请输入" size="small" ></el-input>
</el-form-item>
<el-form-item size="small" label="用户信息">
<el-input v-model="searchForm.userInfo" placeholder="请输入" size="small" ></el-input>
</el-form-item>
<el-form-item size="small" label="下单时间">
<el-date-picker size="small" v-model="searchForm.daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable v-if="flag" ref="table" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams"
:getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="goodsMsg" slot-scope="scope">
<div>订单编号:{{scope.scope.orderCode}}</div>
<div>{{scope.scope.brandName}}</div>
<div>{{scope.scope.appearance == 2 ? scope.scope.productName + scope.scope.denomination : scope.scope.productName}}</div>
</span>
<span slot="priceAmount" slot-scope="scope">
<div>{{scope.scope.salePrices}}元</div>
<div>{{scope.scope.goodsQuality}}张</div>
<div></div>
</span>
<span slot="userInfo" slot-scope="scope">
<div>{{scope.scope.accountName}}</div>
<div>{{scope.scope.mobile}}</div>
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope, 'order')">查看详情</el-button>
</span>
</GLTable>
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row style="display: flex; align-items: center">
<el-form-item size="small" label="订单编号">
<el-input size="small" v-model="searchForm.orderCode" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item size="small" label="品牌名称">
<el-select size="small" v-model="searchForm.brandName" filterable placeholder="请选择">
<el-option v-for="item in brandList" :key="item.brandId" :label="item.brandName" :value="item.brandName"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="商品名称">
<el-input v-model="searchForm.productName" placeholder="请输入" size="small"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="门店名称">
<el-input v-model="searchForm.merchantName" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item size="small" label="用户信息">
<el-input v-model="searchForm.userInfo" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item size="small" label="下单时间">
<el-date-picker size="small" v-model="searchForm.daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<div class="choseRow">
<div class="choseItem" :class="{ active: currentIndex == index }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index)">
{{ item }}
</div>
</div>
<GLTable v-if="flag" ref="table" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="goodsMsg" slot-scope="scope">
<div>订单编号:{{ scope.scope.orderCode }}</div>
<div>{{ scope.scope.brandName }}</div>
<div>{{ scope.scope.appearance == 2 ? scope.scope.productName + scope.scope.denomination : scope.scope.productName }}</div>
</span>
<span slot="priceAmount" slot-scope="scope">
<div>{{ scope.scope.salePrices }}元</div>
<div>{{ scope.scope.goodsQuality }}张</div>
<div></div>
</span>
<span slot="userInfo" slot-scope="scope">
<div>{{ scope.scope.accountName }}</div>
<div>{{ scope.scope.mobile }}</div>
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope, 'order')">查看详情</el-button>
</span>
</GLTable>
</div>
</div>
</template>
......@@ -128,6 +129,8 @@ export default {
mixins: [orderMixin, searchMixin],
data() {
return {
choseList: ['全部', '待收货', '已完成', '退款|售后'],
currentIndex: 0,
size: 'small',
pickerOptions: {
disabledDate(time) {
......@@ -137,8 +140,8 @@ export default {
tabIndex: '',
flag: true,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm:{},
searchFormTable: {},
searchForm: {},
searchFormTable: {},
tableParams: {
listName: 'list',
getListApi: this.$apis.orderApi.getOrderList,
......@@ -148,25 +151,25 @@ export default {
label: '商品信息',
width: '280',
align: 'left',
addHtml:'goodsMsg',
addHtml: 'goodsMsg'
// formatter: (cell) => {
// let str = cell.appearance == 2 ? `${cell.productName}${cell.denomination}` : `${cell.productName}`
// return `订单编号:${cell.orderCode}
// ${cell.brandName}
// ${str}`
// ${str}`
// }
},
{
label: '订单门店',
prop:'merchantName',
minWidth: '180',
prop: 'merchantName',
minWidth: '180'
// formatter(cell) {
// return cell.merchantName || ''
// }
},
{
label: '价格/数量',
addHtml:'priceAmount',
addHtml: 'priceAmount'
// width: '100',
// formatter(cell) {
......@@ -176,7 +179,7 @@ export default {
},
{
label: '实收金额',
prop: 'orderPrices',
prop: 'orderPrices'
// width: '100'
},
{
......@@ -198,7 +201,7 @@ export default {
{
label: '用户信息',
minWidth: '200',
addHtml:'userInfo'
addHtml: 'userInfo'
// formatter(cell) {
// return `${cell.accountName || ''}
// ${cell.mobile || ''}`
......@@ -210,6 +213,40 @@ export default {
},
mounted() {},
methods: {
tabClick(index) {
this.currentIndex = index
this.searchForm.orderStatus = ''
switch (index) {
case 0:
delete this.searchForm['orderStatus[0]']
delete this.searchForm['orderStatus[1]']
delete this.searchForm['orderStatus']
// delete this.searchForm['orderStatus[2]']
// this.searchForm.orderStatus = ''
break
case 1:
delete this.searchForm['orderStatus[0]']
delete this.searchForm['orderStatus[1]']
this.searchForm['orderStatus[0]'] = 1
this.searchForm['orderStatus[1]'] = 2
delete this.searchForm['orderStatus']
break
case 2:
delete this.searchForm['orderStatus[0]']
delete this.searchForm['orderStatus[1]']
this.searchForm['orderStatus[0]'] = 3
delete this.searchForm['orderStatus']
break
case 3:
delete this.searchForm['orderStatus[0]']
delete this.searchForm['orderStatus[1]']
this.searchForm['orderStatus[0]'] = 4
this.searchForm['orderStatus[1]'] = 6
delete this.searchForm['orderStatus']
break
}
this.handleSearch()
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
......@@ -223,7 +260,7 @@ export default {
resolve()
})
},
setTableFinishFun() {
setTableFinishFun() {
// 接收到的数据为空
if (!this.$refs.table.data.length) {
this.$refs.table.setTableHeightFun()
......@@ -231,6 +268,7 @@ export default {
},
handleReset() {
this.flag = false
this.currentIndex = 0
this.searchForm = {}
this.$nextTick(() => {
this.flag = true
......@@ -238,7 +276,7 @@ export default {
},
handleSearch() {
this.$refs.table.refreshTable()
},
}
}
}
// <style src="@a/css/tao.css"></style>
......@@ -246,6 +284,27 @@ export default {
<style lang="scss" scoped>
.equity-wrap .contain {
.choseRow {
display: flex;
height: 34px;
.choseItem {
cursor: pointer;
width: 120px;
height: 34px;
line-height: 34px;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #333333;
}
.active {
color: #5850ff;
background-color: #f4f6fc;
}
}
}
.el-form-item {
margin-bottom: 15px;
}
......@@ -263,7 +322,6 @@ export default {
// .el-tabs__nav-wrap:after {
// display: none;
// }
// .container {
// width: 1160px;
......@@ -303,5 +361,5 @@ export default {
// align-items: center;
// font-size: 14px;
// margin: 0 68px 30px 0;
// }
// }
</style>
\ No newline at end of file
......@@ -417,6 +417,7 @@ export default {
font-weight: 400;
color: #333333;
cursor: pointer;
}
.active {
color: #5850ff;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!