Commit c871cecd by 李长胜

订单tab选择

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