| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
- <el-form-item label="订单编号" prop="orderCode">
- <el-input
- v-model="queryParams.orderCode"
- placeholder="请输入订单编号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="用户昵称" prop="nickName">
- <el-input
- v-model="queryParams.nickName"
- placeholder="请输入用户昵称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="所属公司" prop="companyId">
- <el-select v-model="queryParams.companyId" placeholder="请选择公司" clearable filterable size="small">
- <el-option
- v-for="item in companyList"
- :key="item.companyId"
- :label="item.companyName"
- :value="item.companyId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="服务类型" prop="serviceType">
- <el-select v-model="queryParams.serviceType" placeholder="请选择服务类型" clearable size="small">
- <el-option
- v-for="item in serviceTypeOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审核状态" prop="status">
- <el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable size="small">
- <el-option
- v-for="item in statusOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="售后状态" prop="salesStatus">
- <el-select v-model="queryParams.salesStatus" placeholder="请选择售后状态" clearable size="small">
- <el-option
- v-for="item in salesStatusOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="物流单号" prop="deliverySn">
- <el-input
- v-model="queryParams.deliverySn"
- placeholder="请输入物流单号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="提交时间" prop="createTime">
- <el-date-picker
- v-model="dateRange"
- size="small"
- style="width: 220px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" 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="warning"
- plain
- icon="el-icon-download"
- size="mini"
- :loading="exportLoading"
- @click="handleExport"
- v-hasPermi="['his:integralAfterSales:export']"
- >导出</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" border :data="afterSalesList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="售后单号" align="center" prop="id" width="90" />
- <el-table-column label="订单编号" align="center" prop="orderCode" show-overflow-tooltip />
- <el-table-column label="用户昵称" align="center" prop="nickName" />
- <el-table-column label="用户电话" align="center" prop="userPhone" />
- <el-table-column label="所属公司" align="center" prop="companyName" show-overflow-tooltip />
- <el-table-column label="退款金额" align="center" prop="refundAmount">
- <template slot-scope="scope">
- <span v-if="scope.row.refundAmount != null">¥{{ scope.row.refundAmount }}</span>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column label="退回积分" align="center" prop="refundIntegral">
- <template slot-scope="scope">
- <span v-if="scope.row.refundIntegral != null">{{ scope.row.refundIntegral }}</span>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column label="服务类型" align="center" prop="serviceType" width="100">
- <template slot-scope="scope">
- <el-tag v-if="getDictLabel(serviceTypeOptions, scope.row.serviceType)"
- :type="serviceTypeTagType(scope.row.serviceType)">
- {{ getDictLabel(serviceTypeOptions, scope.row.serviceType) }}
- </el-tag>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column label="审核状态" align="center" prop="status" width="100">
- <template slot-scope="scope">
- <el-tag v-if="getDictLabel(statusOptions, scope.row.status)"
- :type="statusTagType(scope.row.status)">
- {{ getDictLabel(statusOptions, scope.row.status) }}
- </el-tag>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column label="售后状态" align="center" prop="salesStatus" width="100">
- <template slot-scope="scope">
- <el-tag v-if="getDictLabel(salesStatusOptions, scope.row.salesStatus)"
- :type="salesStatusTagType(scope.row.salesStatus)">
- {{ getDictLabel(salesStatusOptions, scope.row.salesStatus) }}
- </el-tag>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column label="物流单号" align="center" prop="deliverySn" show-overflow-tooltip />
- <el-table-column label="提交时间" align="center" prop="createTime" width="160" />
- <el-table-column label="操作" align="center" fixed="right" width="100" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- @click="handleShow(scope.row)"
- v-hasPermi="['his:integralAfterSales:query']"
- >查看</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-drawer
- :with-header="false"
- size="75%"
- :title="drawerTitle"
- :visible.sync="drawerOpen"
- @close="getList"
- >
- <integral-after-sales-details ref="details" />
- </el-drawer>
- </div>
- </template>
- <script>
- import {
- listIntegralAfterSales,
- exportIntegralAfterSales
- } from "@/api/his/integralAfterSales";
- import { getCompanyList } from "@/api/company/company";
- import integralAfterSalesDetails from "./components/integralAfterSalesDetails";
- export default {
- name: "IntegralAfterSales",
- components: { integralAfterSalesDetails },
- data() {
- return {
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 售后单列表
- afterSalesList: [],
- // 选中数组
- ids: [],
- // 单个禁用
- single: true,
- // 多个禁用
- multiple: true,
- // 日期范围
- dateRange: [],
- // 抽屉
- drawerOpen: false,
- drawerTitle: "售后订单详情",
- // 公司下拉
- companyList: [],
- // 字典
- statusOptions: [],
- salesStatusOptions: [],
- serviceTypeOptions: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- orderCode: null,
- nickName: null,
- companyId: null,
- serviceType: null,
- status: null,
- salesStatus: null,
- deliverySn: null,
- beginTime: null,
- endTime: null
- }
- };
- },
- created() {
- this.getList();
- // 审核状态(status):已提交/已审核/已发货...
- this.getDicts("integral_after_sales_status").then(response => {
- this.statusOptions = response.data;
- });
- // 售后状态(salesStatus)与实体注释一致:0正常 1用户取消 2商家拒绝 3已完成
- this.salesStatusOptions = [
- { dictValue: '0', dictLabel: '正常' },
- { dictValue: '1', dictLabel: '用户取消' },
- { dictValue: '2', dictLabel: '商家拒绝' },
- { dictValue: '3', dictLabel: '已完成' }
- ];
- this.getDicts("store_after_sales_service_type").then(response => {
- this.serviceTypeOptions = response.data;
- });
- getCompanyList().then(response => {
- this.companyList = response.data;
- });
- },
- methods: {
- /** 获取字典标签(无匹配返回空串) */
- getDictLabel(options, value) {
- if (value === null || value === undefined || value === '') return '';
- const item = options.find(d => d.dictValue == value);
- return item ? item.dictLabel : '';
- },
- /** 审核状态标签类型 */
- statusTagType(status) {
- const typeMap = { 0: 'info', 1: 'warning', 2: 'warning', 3: 'primary', 4: 'danger', 5: 'success' };
- return typeMap[status] || 'info';
- },
- /** 售后状态标签类型 */
- salesStatusTagType(salesStatus) {
- const typeMap = { 0: '', 1: 'info', 2: 'danger', 3: 'success' };
- return typeMap[salesStatus] || 'info';
- },
- /** 服务类型标签类型 */
- serviceTypeTagType(serviceType) {
- const typeMap = { 0: 'warning', 1: 'danger' };
- return typeMap[serviceType] || 'info';
- },
- /** 查询售后单列表 */
- getList() {
- this.loading = true;
- const params = this.addDateRange(this.queryParams, this.dateRange);
- listIntegralAfterSales(params).then(response => {
- this.afterSalesList = response.rows;
- this.total = response.total;
- this.loading = false;
- }).catch(() => {
- this.loading = false;
- });
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.dateRange = [];
- this.resetForm("queryForm");
- this.queryParams.beginTime = null;
- this.queryParams.endTime = null;
- this.handleQuery();
- },
- /** 多选框选中数据 */
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id);
- this.single = selection.length !== 1;
- this.multiple = !selection.length;
- },
- /** 查看详情 */
- handleShow(row) {
- this.drawerOpen = true;
- const id = row.id;
- setTimeout(() => {
- this.$refs.details.getDetails(id);
- }, 200);
- },
- /** 导出 */
- handleExport() {
- this.exportLoading = true;
- const params = this.addDateRange(this.queryParams, this.dateRange);
- exportIntegralAfterSales(params).then(response => {
- this.download(response.msg);
- this.exportLoading = false;
- }).catch(() => {
- this.exportLoading = false;
- });
- }
- }
- };
- </script>
|