加分组订单
This commit is contained in:
@@ -7,6 +7,38 @@
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-row :gutter="15">
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="门店:">
|
||||
<ele-tree-select
|
||||
:data="groupsList"
|
||||
label-key="groupsName"
|
||||
value-key="groupsId"
|
||||
v-model="where.bizId"
|
||||
:clearable="true"
|
||||
placeholder="请选择"
|
||||
:disabled="false"
|
||||
:default-expand-all="false"
|
||||
:expand-on-click-node="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="商品:">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="where.itemId"
|
||||
placeholder="请选择"
|
||||
class="ele-fluid"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in goodsList"
|
||||
:key="item.itemId"
|
||||
:value="item.itemId"
|
||||
:label="item.title"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="姓名:">
|
||||
<el-input clearable v-model="where.uname" placeholder="请输入" />
|
||||
@@ -30,19 +62,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
|
||||
<el-form-item label="来源:">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="where.cfrom"
|
||||
placeholder="请选择"
|
||||
class="ele-fluid"
|
||||
>
|
||||
<el-option label="门店" :value="0" />
|
||||
<el-option label="团队" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
|
||||
<el-form-item label="状态:">
|
||||
<el-select
|
||||
@@ -56,59 +75,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="商品:">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="where.itemId"
|
||||
placeholder="请选择"
|
||||
class="ele-fluid"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in goodsList"
|
||||
:key="item.itemId"
|
||||
:value="item.itemId"
|
||||
:label="item.title"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }"
|
||||
v-show="where.cfrom == '1' ? false : true"
|
||||
>
|
||||
<el-form-item label="门店:">
|
||||
<ele-tree-select
|
||||
:data="organizationList"
|
||||
label-key="organizationName"
|
||||
value-key="organizationId"
|
||||
v-model="where.bizId"
|
||||
:clearable="true"
|
||||
placeholder="请选择"
|
||||
:disabled="false"
|
||||
:default-expand-all="false"
|
||||
:expand-on-click-node="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }"
|
||||
v-show="where.cfrom == '0' ? false : true"
|
||||
>
|
||||
<el-form-item label="团队:">
|
||||
<ele-tree-select
|
||||
:data="teamList"
|
||||
label-key="teamName"
|
||||
value-key="teamId"
|
||||
v-model="where.teamId"
|
||||
:clearable="true"
|
||||
placeholder="请选择"
|
||||
:disabled="false"
|
||||
:default-expand-all="false"
|
||||
:expand-on-click-node="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
|
||||
<div class="ele-form-actions">
|
||||
<el-button
|
||||
@@ -127,8 +93,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrganizations } from '@/api/sylive/organization';
|
||||
import { listTeams } from '@/api/sylive/team';
|
||||
import { listGroups } from '@/api/sylive/groups';
|
||||
import { listGoods } from '@/api/sylive/goods';
|
||||
|
||||
export default {
|
||||
@@ -139,15 +104,12 @@
|
||||
uname: '',
|
||||
mobile: '',
|
||||
type: '',
|
||||
cfrom: '',
|
||||
bizId: '',
|
||||
teamId: ''
|
||||
bizId: ''
|
||||
};
|
||||
return {
|
||||
activityId: null,
|
||||
// 门店数据
|
||||
organizationList: [],
|
||||
// 团队数据
|
||||
teamList: [],
|
||||
groupsList: [],
|
||||
// 商品数据
|
||||
goodsList: [],
|
||||
// 表单数据
|
||||
@@ -160,11 +122,7 @@
|
||||
return this.$store.state.theme.styleResponsive;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.organizationQuery();
|
||||
this.teamQuery();
|
||||
this.goodsQuery();
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
/* 搜索 */
|
||||
search() {
|
||||
@@ -175,27 +133,13 @@
|
||||
this.where = { ...this.defaultWhere };
|
||||
this.search();
|
||||
},
|
||||
/* 查询机构 */
|
||||
organizationQuery() {
|
||||
listOrganizations({ unOrganizationType: 4 })
|
||||
/* 查询分组 */
|
||||
groupsQuery() {
|
||||
listGroups({ activityId: this.activityId })
|
||||
.then((list) => {
|
||||
this.organizationList = this.$util.toTreeData({
|
||||
this.groupsList = this.$util.toTreeData({
|
||||
data: list,
|
||||
idField: 'organizationId',
|
||||
parentIdField: 'parentId'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
/* 查询团队 */
|
||||
teamQuery() {
|
||||
listTeams({ unTeamType: 3 })
|
||||
.then((list) => {
|
||||
this.teamList = this.$util.toTreeData({
|
||||
data: list,
|
||||
idField: 'teamId',
|
||||
idField: 'groupsId',
|
||||
parentIdField: 'parentId'
|
||||
});
|
||||
})
|
||||
@@ -205,8 +149,7 @@
|
||||
},
|
||||
/* 查询商品 */
|
||||
goodsQuery() {
|
||||
const activityId = this.$route.query.id;
|
||||
listGoods({ activityId: activityId })
|
||||
listGoods({ activityId: this.activityId })
|
||||
.then((list) => {
|
||||
this.goodsList = list;
|
||||
})
|
||||
@@ -214,6 +157,27 @@
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler(route) {
|
||||
const { path } = route;
|
||||
if (path !== '/sylive/groups-order') {
|
||||
return;
|
||||
}
|
||||
const activityId = this.$route.query.id;
|
||||
if (!activityId || activityId == this.activityId) {
|
||||
return;
|
||||
}
|
||||
this.activityId = activityId;
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.reload({ page: 1 });
|
||||
}
|
||||
this.groupsQuery();
|
||||
this.goodsQuery();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
components: { GroOrderSearch },
|
||||
data() {
|
||||
return {
|
||||
activityId: null,
|
||||
// 加载状态
|
||||
title: '权益订单',
|
||||
loading: true,
|
||||
@@ -101,18 +102,6 @@
|
||||
return this.$util.toDateString(cellValue);
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'area',
|
||||
label: '区域',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
prop: 'stores',
|
||||
label: '门店',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
prop: 'consultant',
|
||||
label: '顾问',
|
||||
@@ -125,17 +114,29 @@
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 70
|
||||
},
|
||||
{
|
||||
prop: 'cfromName',
|
||||
label: '来源',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 50
|
||||
},
|
||||
{
|
||||
prop: 'statusName',
|
||||
label: '状态',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 60
|
||||
},
|
||||
{
|
||||
prop: 'levelName1',
|
||||
label: '战区',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
prop: 'levelName2',
|
||||
label: '战队',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
prop: 'stores',
|
||||
label: '门店',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -143,16 +144,12 @@
|
||||
methods: {
|
||||
/* 表格数据源 */
|
||||
datasource({ page, limit, where, order }) {
|
||||
const activityId = this.$route.query.id;
|
||||
const activityId = this.activityId;
|
||||
return listGroupsOrder({ ...where, ...order, page, limit, activityId });
|
||||
},
|
||||
query() {
|
||||
const activityId = this.$route.query.id;
|
||||
if (!activityId) {
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
getActivity(Number(activityId))
|
||||
getActivity(Number(this.activityId))
|
||||
.then((data) => {
|
||||
this.loading = false;
|
||||
// 修改页签标题
|
||||
@@ -181,11 +178,11 @@
|
||||
'订单价格',
|
||||
'付款时间',
|
||||
'创建时间',
|
||||
'区域',
|
||||
'战区',
|
||||
'战队',
|
||||
'门店',
|
||||
'顾问',
|
||||
'订单类型',
|
||||
'来源',
|
||||
'状态',
|
||||
'所选经销商',
|
||||
'地址'
|
||||
@@ -193,7 +190,7 @@
|
||||
];
|
||||
const loading = this.$loading({ lock: true });
|
||||
this.$refs.table.doRequest(({ where, order }) => {
|
||||
const activityId = this.$route.query.id;
|
||||
const activityId = this.activityId;
|
||||
exportGroupsOrder({ ...where, ...order, activityId })
|
||||
.then((data) => {
|
||||
loading.close();
|
||||
@@ -206,11 +203,11 @@
|
||||
d.totalPrice,
|
||||
this.$util.toDateString(d.payTime),
|
||||
this.$util.toDateString(d.createTime),
|
||||
d.area,
|
||||
d.levelName1,
|
||||
d.levelName2,
|
||||
d.stores,
|
||||
d.consultant,
|
||||
d.typeName,
|
||||
d.cfromName,
|
||||
d.statusName,
|
||||
d.biz,
|
||||
d.address
|
||||
@@ -240,6 +237,11 @@
|
||||
if (path !== ROUTE_PATH) {
|
||||
return;
|
||||
}
|
||||
const activityId = this.$route.query.id;
|
||||
if (!activityId || activityId == this.activityId) {
|
||||
return;
|
||||
}
|
||||
this.activityId = activityId;
|
||||
this.query();
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.reload({ page: 1 });
|
||||
|
||||
Reference in New Issue
Block a user