订单管理界面
This commit is contained in:
@ -1,53 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单列表
|
||||
export function listOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售订单详细
|
||||
export function getOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/order/' + orderId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增销售订单
|
||||
export function addOrder(data) {
|
||||
return request({
|
||||
url: '/system/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改销售订单
|
||||
export function updateOrder(data) {
|
||||
return request({
|
||||
url: '/system/order',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除销售订单
|
||||
export function delOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/order/' + orderId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出销售订单
|
||||
export function exportOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单列表
|
||||
export function listOrder(query) {
|
||||
return request({
|
||||
url: '/custom/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售订单详细
|
||||
export function getOrder(orderId) {
|
||||
return request({
|
||||
url: '/custom/order/' + orderId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增销售订单
|
||||
export function addOrder(data) {
|
||||
return request({
|
||||
url: '/custom/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改销售订单
|
||||
export function updateOrder(data) {
|
||||
return request({
|
||||
url: '/custom/order',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除销售订单
|
||||
export function delOrder(orderId) {
|
||||
return request({
|
||||
url: '/custom/order/' + orderId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出销售订单
|
||||
export function exportOrder(query) {
|
||||
return request({
|
||||
url: '/custom/order/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
737
ruoyi-ui/src/views/custom/order/index.vue
Normal file
737
ruoyi-ui/src/views/custom/order/index.vue
Normal file
@ -0,0 +1,737 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input
|
||||
v-model="queryParams.customer"
|
||||
placeholder="请输入客户姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入电话"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="queryParams.payTypeId" placeholder="请选择收款方式" clearable size="small">
|
||||
<el-option v-for="dict in payTypeIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="queryParams.preSaleId" placeholder="请选择售前" clearable size="small">
|
||||
<el-option v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="queryParams.afterSaleId" placeholder="请选择售后" clearable size="small">
|
||||
<el-option v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="营养师" prop="nutritionistId">
|
||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
||||
<el-option v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId" label-width="90px">
|
||||
<el-select v-model="queryParams.nutriAssisId" placeholder="请选择助理营养师" clearable style="width: 170px"
|
||||
size="small">
|
||||
<el-option v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="queryParams.accountId" placeholder="请选择账号" clearable
|
||||
size="small">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="queryParams.plannerId" placeholder="请选择策划" clearable
|
||||
size="small">
|
||||
<el-option v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="queryParams.plannerAssisId" placeholder="请选择策划助理"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="queryParams.operatorId" placeholder="请选择运营"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-form-item label="推荐人" prop="recommender">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.recommender"-->
|
||||
<!-- placeholder="请输入推荐人"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-col :span="4">
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.orderTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini"
|
||||
@click="handleQuery">搜索
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:order:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['custom:order:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['custom:order:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['custom:order:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="编号" align="center" prop="orderId"/>
|
||||
<el-table-column label="客户姓名" align="center" prop="customer"/>
|
||||
<el-table-column label="电话" align="center" prop="phone"/>
|
||||
<el-table-column label="金额" align="center" prop="amount"/>
|
||||
<el-table-column label="收款方式" align="center" prop="payType"/>
|
||||
<el-table-column label="售前" align="center" prop="preSale"/>
|
||||
<el-table-column label="售后" align="center" prop="afterSale"/>
|
||||
<el-table-column label="营养师" align="center" prop="nutritionist"/>
|
||||
<el-table-column label="助理营养师" align="center" prop="nutriAssis"/>
|
||||
<el-table-column label="账号" align="center" prop="account"/>
|
||||
<el-table-column label="策划" align="center" prop="planner"/>
|
||||
<el-table-column label="策划助理" align="center" prop="plannerAssis"/>
|
||||
<el-table-column label="运营" align="center" prop="operator"/>
|
||||
<el-table-column label="推荐人" align="center" prop="recommender"/>
|
||||
<el-table-column label="成交日期" align="center" prop="orderTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['custom:order:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:order:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改销售订单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input v-model="form.customer" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="form.payTypeId" placeholder="请选择收款方式">
|
||||
<el-option
|
||||
v-for="dict in payTypeIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="form.preSaleId" placeholder="请选择售前">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="form.afterSaleId" placeholder="请选择售后">
|
||||
<el-option
|
||||
v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="营养师" prop="nutritionistId">
|
||||
<el-select v-model="form.nutritionistId" placeholder="请选择营养师">
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||
<el-select v-model="form.nutriAssisId" placeholder="请选择助理营养师">
|
||||
<el-option
|
||||
v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="form.plannerId" placeholder="请选择策划">
|
||||
<el-option
|
||||
v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="form.plannerAssisId" placeholder="请选择策划助理">
|
||||
<el-option
|
||||
v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="form.operatorId" placeholder="请选择运营">
|
||||
<el-option
|
||||
v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="form.accountId" placeholder="请选择账号">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col>
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.orderTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="推荐人" prop="recommender">
|
||||
<el-input v-model="form.recommender" placeholder="请输入推荐人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder} from "@/api/custom/order";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 销售订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 收款方式字典
|
||||
payTypeIdOptions: [],
|
||||
// 售前字典
|
||||
preSaleIdOptions: [],
|
||||
// 售后字典
|
||||
afterSaleIdOptions: [],
|
||||
// 营养师字典
|
||||
nutritionistIdOptions: [],
|
||||
// 助理营养师字典
|
||||
nutriAssisIdOptions: [],
|
||||
// 策划字典
|
||||
plannerIdOptions: [],
|
||||
// 账号
|
||||
accountIdOptions: [],
|
||||
// 策划助理字典
|
||||
plannerAssisIdOptions: [],
|
||||
// 运营字典
|
||||
operatorIdOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customer: null,
|
||||
phone: null,
|
||||
payTypeId: null,
|
||||
preSaleId: null,
|
||||
afterSaleId: null,
|
||||
nutritionistId: null,
|
||||
nutriAssisId: null,
|
||||
accountId: null,
|
||||
plannerId: null,
|
||||
plannerAssisId: null,
|
||||
operatorId: null,
|
||||
recommender: null,
|
||||
orderTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
customer: [
|
||||
{required: true, message: "客户姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
amount: [
|
||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("cus_pay_type").then(response => {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_pre_sale").then(response => {
|
||||
this.preSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_after_sale").then(response => {
|
||||
this.afterSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri").then(response => {
|
||||
this.nutritionistIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri_assis").then(response => {
|
||||
this.nutriAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner").then(response => {
|
||||
this.plannerIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_account").then(response => {
|
||||
this.accountIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner_assis").then(response => {
|
||||
this.plannerAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_operator").then(response => {
|
||||
this.operatorIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},// 收款方式字典翻译
|
||||
payTypeIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.payTypeIdOptions, row.payTypeId);
|
||||
},
|
||||
// 售前字典翻译
|
||||
preSaleIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.preSaleIdOptions, row.preSaleId);
|
||||
},
|
||||
// 售后字典翻译
|
||||
afterSaleIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.afterSaleIdOptions, row.afterSaleId);
|
||||
},
|
||||
// 营养师字典翻译
|
||||
nutritionistIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
||||
},
|
||||
// 助理营养师字典翻译
|
||||
nutriAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutriAssisIdOptions, row.nutriAssisId);
|
||||
},
|
||||
// 策划字典翻译
|
||||
plannerIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.plannerIdOptions, row.plannerId);
|
||||
},
|
||||
// 账号字典翻译
|
||||
accountIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.accountIdOptions, row.accountId);
|
||||
},
|
||||
// 策划助理字典翻译
|
||||
plannerAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.plannerAssisIdOptions, row.plannerAssisId);
|
||||
},
|
||||
// 运营字典翻译
|
||||
operatorIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.operatorIdOptions, row.operatorId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
orderId: null,
|
||||
customer: null,
|
||||
phone: null,
|
||||
amount: null,
|
||||
payTypeId: null,
|
||||
payType: null,
|
||||
preSaleId: null,
|
||||
createBy: null,
|
||||
preSale: null,
|
||||
createTime: null,
|
||||
afterSaleId: null,
|
||||
updateBy: null,
|
||||
afterSale: null,
|
||||
updateTime: null,
|
||||
nutritionistId: null,
|
||||
remark: null,
|
||||
nutritionist: null,
|
||||
nutriAssisId: null,
|
||||
nutriAssis: null,
|
||||
accountId: null,
|
||||
account: null,
|
||||
plannerId: null,
|
||||
planner: null,
|
||||
plannerAssisId: null,
|
||||
plannerAssis: null,
|
||||
operatorId: null,
|
||||
operator: null,
|
||||
recommender: null,
|
||||
orderTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.getDicts("cus_pay_type").then(response => {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_pre_sale").then(response => {
|
||||
this.preSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_after_sale").then(response => {
|
||||
this.afterSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri").then(response => {
|
||||
this.nutritionistIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri_assis").then(response => {
|
||||
this.nutriAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner").then(response => {
|
||||
this.plannerIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_custom").then(response => {
|
||||
this.accountIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner_assis").then(response => {
|
||||
this.plannerAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_operator").then(response => {
|
||||
this.operatorIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加销售订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改销售订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const orderIds = row.orderId || this.ids;
|
||||
this.$confirm('是否确认删除销售订单编号为"' + orderIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delOrder(orderIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有销售订单数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportOrder(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function () {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,360 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="业务员" prop="userId">
|
||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in userIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="成交日期" prop="saleTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.saleTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售渠道" prop="channelId">
|
||||
<el-select v-model="queryParams.channelId" placeholder="请选择销售渠道" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in channelIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:order:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:order:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:order:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="orderId" />
|
||||
<el-table-column label="用户昵称" align="center" prop="nickName" />
|
||||
<el-table-column label="金额" align="center" prop="amount" />
|
||||
<el-table-column label="成交日期" align="center" prop="saleTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.saleTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售渠道" align="center" prop="channelId" :formatter="channelIdFormat" />
|
||||
<el-table-column label="创建者" align="center" prop="createBy" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:order:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改销售订单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="业务员" prop="userId">
|
||||
<el-select v-model="form.userId" placeholder="请选择业务员">
|
||||
<el-option
|
||||
v-for="dict in userIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成交日期" prop="saleTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.saleTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售渠道" prop="channelId">
|
||||
<el-select v-model="form.channelId" placeholder="请选择销售渠道">
|
||||
<el-option
|
||||
v-for="dict in channelIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/system/order";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 销售订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 业务员字典
|
||||
userIdOptions: [],
|
||||
// 销售渠道字典
|
||||
channelIdOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
saleTime: null,
|
||||
channelId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userId: [
|
||||
{ required: true, message: "业务员不能为空", trigger: "change" }
|
||||
],
|
||||
amount: [
|
||||
{ required: true, message: "金额不能为空", trigger: "blur" }
|
||||
],
|
||||
saleTime: [
|
||||
{ required: true, message: "成交日期不能为空", trigger: "blur" }
|
||||
],
|
||||
channelId: [
|
||||
{ required: true, message: "销售渠道不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("sys_saller").then(response => {
|
||||
this.userIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_sale_channel").then(response => {
|
||||
this.channelIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 业务员字典翻译
|
||||
userIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.userIdOptions, row.userId);
|
||||
},
|
||||
// 销售渠道字典翻译
|
||||
channelIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.channelIdOptions, row.channelId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
orderId: null,
|
||||
userId: null,
|
||||
nickName: null,
|
||||
amount: null,
|
||||
saleTime: null,
|
||||
channelId: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加销售订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改销售订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const orderIds = row.orderId || this.ids;
|
||||
this.$confirm('是否确认删除销售订单编号为"' + orderIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delOrder(orderIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有销售订单数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportOrder(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user