|
@@ -30,47 +30,71 @@
|
|
|
>
|
|
|
</el-cascader>
|
|
|
|
|
|
- <el-select style="margin-right: 20px; width: 220px" v-model="payInfo" placeholder="付款项目" clearable>
|
|
|
- <!-- <el-option v-for="item in tradeArr" :key="item.IndustryId" :label="item.IndustryName" :value="item.IndustryId"> </el-option> -->
|
|
|
+ <el-select @change="handleSelectChange" style="margin-right: 20px; width: 220px" v-model="payInfo" placeholder="付款项目" clearable>
|
|
|
+ <el-option v-for="item in paymentProjectList" :key="item" :label="item" :value="item"> </el-option>
|
|
|
</el-select>
|
|
|
- <el-select style="margin-right: 20px; width: 220px" v-model="payStatus" placeholder="支付状态" clearable>
|
|
|
- <!-- <el-option v-for="item in tradeArr" :key="item.IndustryId" :label="item.IndustryName" :value="item.IndustryId"> </el-option> -->
|
|
|
+ <el-select @change="handleSelectChange" style="margin-right: 20px; width: 220px" v-model="payStatus" placeholder="支付状态" clearable>
|
|
|
+ <el-option v-for="item in payStatusList" :key="item.key" :label="item.lable" :value="item.key"> </el-option>
|
|
|
</el-select>
|
|
|
- <el-input style="margin-right: 20px; width: 220px" prefix-icon="el-icon-search" v-model="orderNumber" placeholder="请输入订单号" />
|
|
|
+ <el-input @input="handleSelectChange" style="margin-right: 20px; width: 220px; margin-bottom: 20px" prefix-icon="el-icon-search" v-model="orderNumber" placeholder="请输入订单号" />
|
|
|
|
|
|
- <el-input style="width: 220px" prefix-icon="el-icon-search" v-model="orderNumber" placeholder="请输入姓名/手机号" />
|
|
|
+ <el-input @input="handleSelectChange" style="width: 220px; margin-bottom: 20px" prefix-icon="el-icon-search" v-model="keyWord" placeholder="请输入姓名/手机号" />
|
|
|
</div>
|
|
|
- <el-table :data="tableData" style="width: 100%" border>
|
|
|
+ <el-table :data="tableOrderData" style="width: 100%" border>
|
|
|
<el-table-column align="center" v-for="item in tableColums" :key="item.key" :prop="item.key" :label="item.label" :width="item.widthsty">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span @click="handleRowClick(row, item.key)" :style="handleRowStyle(item.key)">{{ handleRowContent(row, item.key) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="支付时间" prop="item.key" align="center"> </el-table-column>
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
+ <el-table-column label="支付时间" prop="PayTime" align="center"> </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="80">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <span>退款</span>
|
|
|
+ <span class="editsty" @click="refundHandler(row)">退款</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <!-- 页数选择器 -->
|
|
|
+ <m-page :page_no="page_no" :pageSize="page_size" :total="total" style="margin: 20px 0" @handleCurrentChange="pageChange" />
|
|
|
</el-card>
|
|
|
+
|
|
|
+ <el-dialog center v-dialogDrag title="退款" :visible.sync="dialogVisible" append-to-body width="30%" :before-close="handleClose">
|
|
|
+ <div>
|
|
|
+ <el-input type="textarea" :autosize="{ minRows: 6, maxRows: 8 }" placeholder="请输入退款原因" v-model="refundTextarea"> </el-input>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="handleClose">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="refundDialogHandlerVisible">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { contractInterface, customInterence } from "@/api/api.js";
|
|
|
import { tableColums } from "./components/tableColums.js";
|
|
|
+import mPage from "@/components/mPage.vue";
|
|
|
+
|
|
|
export default {
|
|
|
name: "",
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ mPage,
|
|
|
+ },
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
tabsList: [
|
|
|
- { lable: "畅读卡订单", key: "1" },
|
|
|
- { lable: "单场付费订单", key: "2" },
|
|
|
+ { lable: "畅读卡订单", key: 1 },
|
|
|
+ { lable: "单场付费订单", key: 2 },
|
|
|
+ ],
|
|
|
+ paymentProjectList: ["上市公司小范围", "专家调研", "买方交流"],
|
|
|
+ payStatusList: [
|
|
|
+ { lable: "已取消", key: 0 },
|
|
|
+ { lable: "待支付", key: 1 },
|
|
|
+ { lable: "已支付", key: 2 },
|
|
|
+ { lable: "已退款", key: 3 },
|
|
|
],
|
|
|
tabs_index: 1,
|
|
|
- timeRange: "", // 时间筛选
|
|
|
+ timeRange: [], // 时间筛选
|
|
|
sales: [],
|
|
|
salesArr: [], //销售
|
|
|
defaultSalesProps: {
|
|
@@ -82,19 +106,76 @@ export default {
|
|
|
payStatus: "", //支付状态
|
|
|
payInfo: "", //付款项目
|
|
|
orderNumber: "", //订单号
|
|
|
+ keyWord: "",
|
|
|
tableColums: [],
|
|
|
+ tableOrderData: [],
|
|
|
+ total: 0,
|
|
|
+ page_no: 1,
|
|
|
+ page_size: 10,
|
|
|
+ dialogVisible: false, // 退款的弹框
|
|
|
+ refundTextarea: "", // 退款原因
|
|
|
+ orderRefundCode: "",
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
+ this.getSale();
|
|
|
+ this.getOrderList();
|
|
|
this.tableColums = tableColums(1);
|
|
|
},
|
|
|
methods: {
|
|
|
- tabActive() {},
|
|
|
- //
|
|
|
- handleSelectChange() {},
|
|
|
+ // 修改页码
|
|
|
+ pageChange(page_no) {
|
|
|
+ this.page_no = page_no;
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
+ /* 获取销售 */
|
|
|
+ getSale() {
|
|
|
+ customInterence.getSale().then((res) => {
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.salesArr = res.Data.List;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取数据
|
|
|
+ async getOrderList() {
|
|
|
+ let salesArr = [];
|
|
|
+ if (this.sales.length) {
|
|
|
+ salesArr = this.sales.map((item) => {
|
|
|
+ return item[item.length - 1];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ const res = await contractInterface.getOrderList({
|
|
|
+ PageSize: this.page_size,
|
|
|
+ CurrentIndex: this.page_no,
|
|
|
+ AdminId: salesArr.join(","),
|
|
|
+ StartDate: this.timeRange.length ? this.timeRange[0] : "",
|
|
|
+ EndDate: this.timeRange.length ? this.timeRange[1] : "",
|
|
|
+ OrderType: this.tabs_index,
|
|
|
+ PaymentProject: this.payInfo,
|
|
|
+ OrderCode: this.orderNumber,
|
|
|
+ KeyWord: this.keyWord,
|
|
|
+ OrderStatus: this.payStatus,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.tableOrderData = res.Data.List;
|
|
|
+ this.total = res.Data.Paging.Totals || 0;
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ },
|
|
|
+ tabActive(item) {
|
|
|
+ if (this.tabs_index == item.key) return;
|
|
|
+ this.tableColums = tableColums(item.key);
|
|
|
+ this.tabs_index = item.key;
|
|
|
+ this.handleSelectChange();
|
|
|
+ },
|
|
|
+ // 所有筛选的改变
|
|
|
+ handleSelectChange() {
|
|
|
+ this.page_no = 1;
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
|
|
|
// 表格三件套
|
|
|
// 表格点击了
|
|
@@ -113,11 +194,39 @@ export default {
|
|
|
let styleColor = {
|
|
|
Title: "color: #409eff; cursor: pointer",
|
|
|
CompanyName: "color: #409eff; cursor: pointer",
|
|
|
+ SourceTitle: "color: #409eff; cursor: pointer",
|
|
|
};
|
|
|
return styleColor[key] ? styleColor[key] : "";
|
|
|
},
|
|
|
// 文本是否需要处理
|
|
|
- handleRowContent(row, key) {},
|
|
|
+ handleRowContent(row, key) {
|
|
|
+ if (key == "StartDate") return `${row["StartDate"]} ~ ${row["EndDate"]}`;
|
|
|
+ if (key == "OrderStatus") return row[key] == 0 ? "已取消" : row[key] == 1 ? "待支付" : row[key] == 2 ? "已支付" : row[key] == 3 ? "已退款" : "";
|
|
|
+ return row[key];
|
|
|
+ },
|
|
|
+ // 点击了退款按钮
|
|
|
+ refundHandler(row) {
|
|
|
+ this.orderRefundCode = row.OrderCode;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ // 关闭了退款弹框
|
|
|
+ handleClose() {
|
|
|
+ this.refundTextarea = "";
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ // 退款的确认弹框
|
|
|
+ async refundDialogHandlerVisible() {
|
|
|
+ if (!this.refundTextarea) return this.$message.warning("退款原因不能为空");
|
|
|
+ // 等待接口
|
|
|
+ const res = await contractInterface.orderRefund({
|
|
|
+ OrderCode: this.orderRefundCode,
|
|
|
+ Remark: this.refundTextarea,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.handleClose();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -156,7 +265,7 @@ export default {
|
|
|
|
|
|
.select-box {
|
|
|
/deep/ .el-input {
|
|
|
- margin-bottom: 20px;
|
|
|
+ margin-bottom: 20px !important;
|
|
|
}
|
|
|
}
|
|
|
}
|