|
@@ -9,7 +9,7 @@
|
|
:topType="topType"
|
|
:topType="topType"
|
|
:pendingType="pendingType"
|
|
:pendingType="pendingType"
|
|
/>
|
|
/>
|
|
- <table-list
|
|
|
|
|
|
+ <!-- <table-list
|
|
rowKey="refundId"
|
|
rowKey="refundId"
|
|
:tableSets="tableSet"
|
|
:tableSets="tableSet"
|
|
:tableData="tableData"
|
|
:tableData="tableData"
|
|
@@ -25,7 +25,88 @@
|
|
<template slot="btn" slot-scope="props">
|
|
<template slot="btn" slot-scope="props">
|
|
<el-button type="text" @click="audit(props.scope.row)">审核</el-button>
|
|
<el-button type="text" @click="audit(props.scope.row)">审核</el-button>
|
|
</template>
|
|
</template>
|
|
- </table-list>
|
|
|
|
|
|
+ </table-list> -->
|
|
|
|
+ <div style="text-align: end; margin-bottom: 12px">
|
|
|
|
+ <el-button size="small" type="primary" @click="setGoodsOptions"
|
|
|
|
+ >批量审核</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <el-table
|
|
|
|
+ v-if="!loading"
|
|
|
|
+ ref="tableList"
|
|
|
|
+ :data="tableData"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ row-key="refundId"
|
|
|
|
+ border
|
|
|
|
+ lazy
|
|
|
|
+ :load="load"
|
|
|
|
+ :tree-props="prop"
|
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ @select-all="selectAll"
|
|
|
|
+ @select="selectRow"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column align="center" type="selection" width="55">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-for="(item, index) in tableSet"
|
|
|
|
+ header-align="center"
|
|
|
|
+ :prop="item.prop"
|
|
|
|
+ sort-by="sort"
|
|
|
|
+ :key="index"
|
|
|
|
+ :width="item.width"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :align="index === 1 ? 'left' : 'center'"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="item.scope === 'aTimeList'">{{
|
|
|
|
+ scope.row[item.prop] === null
|
|
|
|
+ ? "--"
|
|
|
|
+ : $methodsTools.onlyForma(scope.row[item.prop], !item.isDiszing)
|
|
|
|
+ }}</span>
|
|
|
|
+ <span v-else-if="item.scope === 'eduTypes'">
|
|
|
|
+ {{
|
|
|
|
+ scope.row[item.prop1] +
|
|
|
|
+ "-" +
|
|
|
|
+ scope.row[item.prop2] +
|
|
|
|
+ "-" +
|
|
|
|
+ scope.row[item.prop3]
|
|
|
|
+ }}{{ scope.row[item.prop4] ? "-" + scope.row[item.prop4] : "" }}
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else-if="item.scope === 'leftCh'">
|
|
|
|
+ {{ item.ch }}{{ scope.row[item.prop] }}
|
|
|
|
+ </span>
|
|
|
|
+ <div v-else-if="item.scope === 'isOptions'">
|
|
|
|
+ <template v-for="(itemt, indext) in item.options">
|
|
|
|
+ <span
|
|
|
|
+ :key="indext"
|
|
|
|
+ v-if="itemt.value === scope.row[item.prop]"
|
|
|
|
+ :style="itemt.style ? itemt.style : ''"
|
|
|
|
+ >{{ itemt.label }}</span
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ <span v-else-if="item.scope === 'outStandingAmount'">
|
|
|
|
+ ¥{{ (scope.row[item.prop1] - scope.row[item.prop2]).toFixed(2) }}
|
|
|
|
+ </span>
|
|
|
|
+ <div v-else-if="item.scope === 'periodStatusShow'">
|
|
|
|
+ {{
|
|
|
|
+ scope.row[item.prop] === 2
|
|
|
|
+ ? "同意,待退款"
|
|
|
|
+ : scope.row[item.prop] === 3
|
|
|
|
+ ? "同意,已退款"
|
|
|
|
+ : "待审核"
|
|
|
|
+ }}
|
|
|
|
+ </div>
|
|
|
|
+ <span v-else>{{ item.ch }}{{ scope.row[item.prop] }}</span></template
|
|
|
|
+ >
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="120" align="center">
|
|
|
|
+ <template slot-scope="props">
|
|
|
|
+ <el-button type="text" @click="audit(props.row)">审核</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
<pagination
|
|
<pagination
|
|
:total="total"
|
|
:total="total"
|
|
:pageSize="formData.pageSize"
|
|
:pageSize="formData.pageSize"
|
|
@@ -39,12 +120,12 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import searchBoxNew from "@/components/searchBoxNew";
|
|
import searchBoxNew from "@/components/searchBoxNew";
|
|
-import tableList from "@/components/tableList";
|
|
|
|
|
|
+// import tableList from "@/components/tableList";
|
|
import pagination from "@/components/pagination";
|
|
import pagination from "@/components/pagination";
|
|
import refundDia from "./refundDia.vue";
|
|
import refundDia from "./refundDia.vue";
|
|
export default {
|
|
export default {
|
|
name: "PendingRefundOrder",
|
|
name: "PendingRefundOrder",
|
|
- components: { searchBoxNew, tableList, pagination, refundDia },
|
|
|
|
|
|
+ components: { searchBoxNew, pagination, refundDia },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
loading: false, //当前表单加载是否加载动画
|
|
loading: false, //当前表单加载是否加载动画
|
|
@@ -100,6 +181,12 @@ export default {
|
|
},
|
|
},
|
|
// 表单
|
|
// 表单
|
|
tableSet: [
|
|
tableSet: [
|
|
|
|
+ {
|
|
|
|
+ label: "订单编码",
|
|
|
|
+ prop: "orderSn",
|
|
|
|
+ hidden: true,
|
|
|
|
+ width: "240px",
|
|
|
|
+ },
|
|
{
|
|
{
|
|
label: "订单时间",
|
|
label: "订单时间",
|
|
prop: "createTime",
|
|
prop: "createTime",
|
|
@@ -107,12 +194,6 @@ export default {
|
|
scope: "aTimeList",
|
|
scope: "aTimeList",
|
|
width: "180px",
|
|
width: "180px",
|
|
},
|
|
},
|
|
- {
|
|
|
|
- label: "订单编码",
|
|
|
|
- prop: "orderSn",
|
|
|
|
- hidden: true,
|
|
|
|
- width: "210px",
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
label: "手机号码",
|
|
label: "手机号码",
|
|
prop: "telphone",
|
|
prop: "telphone",
|
|
@@ -208,6 +289,9 @@ export default {
|
|
],
|
|
],
|
|
tableData: [], //表单数据
|
|
tableData: [], //表单数据
|
|
total: 0, //一共多少条
|
|
total: 0, //一共多少条
|
|
|
|
+ isCheckedAll: false,
|
|
|
|
+ allCheckData: [],
|
|
|
|
+ prop: { hasChildren: "hasChildren", children: "children" },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -217,16 +301,119 @@ export default {
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ tableRowClassName({ row, rowIndex }) {
|
|
|
|
+ if (row.backGround) {
|
|
|
|
+ return "backGround";
|
|
|
|
+ } else if (row.childrenGround) {
|
|
|
|
+ return "childrenGround";
|
|
|
|
+ } else {
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ load(tree, treeNode, resolve) {
|
|
|
|
+ const table = this.$refs["tableList"];
|
|
|
|
+ this.$api
|
|
|
|
+ .obtainOrderRefundlistAll({
|
|
|
|
+ orderSn: tree.orderSn,
|
|
|
|
+ periodStatus: this.formData.periodStatus,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ const NewArray = res.data.filter((item) => {
|
|
|
|
+ item.childrenGround = true;
|
|
|
|
+ return item.refundId != tree.refundId;
|
|
|
|
+ });
|
|
|
|
+ tree.children = NewArray;
|
|
|
|
+ resolve(NewArray);
|
|
|
|
+ this.$set(
|
|
|
|
+ //更新table内部的数据 不这样的话勾选父节点以后子节点还是不能勾选 就很奇怪
|
|
|
|
+ table.store.states.lazyTreeNodeMap,
|
|
|
|
+ tree.refundId, //父节点id
|
|
|
|
+ tree.children //新数组
|
|
|
|
+ );
|
|
|
|
+ // 这里判断当前父节点是否有被勾选
|
|
|
|
+ let dt = this.allCheckData.find((m) => {
|
|
|
|
+ return m.refundId == tree.refundId;
|
|
|
|
+ });
|
|
|
|
+ this.setChildren(tree.children, dt ? true : false);
|
|
|
|
+ }, 1000)
|
|
|
|
+ .catch(() => {
|
|
|
|
+ resolve([]);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ setChildren(children, type) {
|
|
|
|
+ // 编辑多个子层级
|
|
|
|
+ children.map((j) => {
|
|
|
|
+ this.toggleSelection(j, type);
|
|
|
|
+ if (j.children) {
|
|
|
|
+ this.setChildren(j.children, type);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 选中父节点时,子节点一起选中取消
|
|
|
|
+ async selectRow(selection, row) {
|
|
|
|
+ const hasSelect = selection.some((el) => {
|
|
|
|
+ return row.refundId === el.refundId;
|
|
|
|
+ });
|
|
|
|
+ if (hasSelect) {
|
|
|
|
+ if (row.children) {
|
|
|
|
+ // 解决子组件没有被勾选到
|
|
|
|
+ this.setChildren(row.children, true);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (row.children) {
|
|
|
|
+ this.setChildren(row.children, false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 选择全部
|
|
|
|
+ selectAll(selection) {
|
|
|
|
+ // tabledata第一层只要有在selection里面就是全选
|
|
|
|
+ const isSelect = selection.some((el) => {
|
|
|
|
+ const tableDataIds = this.tableData.map((j) => j.refundId);
|
|
|
|
+ return tableDataIds.includes(el.refundId);
|
|
|
|
+ });
|
|
|
|
+ // tableDate第一层只要有不在selection里面就是全不选
|
|
|
|
+ const isCancel = !this.tableData.every((el) => {
|
|
|
|
+ const selectIds = selection.map((j) => j.refundId);
|
|
|
|
+ return selectIds.includes(el.refundId);
|
|
|
|
+ });
|
|
|
|
+ if (isSelect) {
|
|
|
|
+ selection.map((el) => {
|
|
|
|
+ if (el.children) {
|
|
|
|
+ // 解决子组件没有被勾选到
|
|
|
|
+ this.setChildren(el.children, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (isCancel) {
|
|
|
|
+ this.tableData.map((el) => {
|
|
|
|
+ if (el.children) {
|
|
|
|
+ // 解决子组件没有被勾选到
|
|
|
|
+ this.setChildren(el.children, false);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toggleSelection(row, select) {
|
|
|
|
+ if (row) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.tableList.toggleRowSelection(row, select);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleSelectionChange(selection) {
|
|
|
|
+ this.allCheckData = selection;
|
|
|
|
+ },
|
|
/**
|
|
/**
|
|
* 批量审核
|
|
* 批量审核
|
|
*/
|
|
*/
|
|
setGoodsOptions() {
|
|
setGoodsOptions() {
|
|
- if (!this.$refs.tableList.allCheckData.length) {
|
|
|
|
|
|
+ if (!this.allCheckData.length) {
|
|
this.$message.warning("请选择订单");
|
|
this.$message.warning("请选择订单");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.$refs.refundDia.openBox(
|
|
this.$refs.refundDia.openBox(
|
|
- this.$refs.tableList.allCheckData,
|
|
|
|
|
|
+ this.allCheckData,
|
|
this.formData.periodStatus === "1,2"
|
|
this.formData.periodStatus === "1,2"
|
|
? 1
|
|
? 1
|
|
: this.formData.periodStatus === 0
|
|
: this.formData.periodStatus === 0
|
|
@@ -253,8 +440,9 @@ export default {
|
|
}
|
|
}
|
|
if (int === 4) {
|
|
if (int === 4) {
|
|
this.formData.pageNum = 1;
|
|
this.formData.pageNum = 1;
|
|
- this.$refs.tableList.clearMoreActive();
|
|
|
|
}
|
|
}
|
|
|
|
+ this.allCheckData = [];
|
|
|
|
+ this.$refs.tableList.clearSelection();
|
|
var data = JSON.parse(JSON.stringify(this.formData));
|
|
var data = JSON.parse(JSON.stringify(this.formData));
|
|
data.inputOrderSn = this.$route.query.inputOrderSn;
|
|
data.inputOrderSn = this.$route.query.inputOrderSn;
|
|
if (this.formData.searchStartTime) {
|
|
if (this.formData.searchStartTime) {
|
|
@@ -266,7 +454,13 @@ export default {
|
|
this.$api
|
|
this.$api
|
|
.inquireorderrefundlist(data)
|
|
.inquireorderrefundlist(data)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- this.tableData = res.rows;
|
|
|
|
|
|
+ this.tableData = res.rows.map((e) => {
|
|
|
|
+ if (e.goodsNum > 1) {
|
|
|
|
+ e.hasChildren = true;
|
|
|
|
+ }
|
|
|
|
+ e.backGround = true;
|
|
|
|
+ return e;
|
|
|
|
+ });
|
|
this.total = res.total;
|
|
this.total = res.total;
|
|
this.navText.index = res.total;
|
|
this.navText.index = res.total;
|
|
})
|
|
})
|
|
@@ -301,6 +495,28 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
|
+::v-deep .el-table .backGround {
|
|
|
|
+ td {
|
|
|
|
+ background-color: rgb(252, 248, 229);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+::v-deep .el-table .childrenGround {
|
|
|
|
+ td {
|
|
|
|
+ background-color: rgb(252, 238, 238);
|
|
|
|
+ &:nth-of-type(2) {
|
|
|
|
+ background: rgb(237, 246, 245);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+// el-table表格对齐
|
|
|
|
+::v-deep .el-table__row:not([class*="el-table__row--level-"]) {
|
|
|
|
+ td:nth-of-type(2) {
|
|
|
|
+ padding-left: 24px !important; //一级数据无Child缩进
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+::v-deep .el-table__placeholder {
|
|
|
|
+ margin-left: 3px; //子节点无Child缩进
|
|
|
|
+}
|
|
/deep/.el-button {
|
|
/deep/.el-button {
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
}
|
|
}
|
|
@@ -394,4 +610,3 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
-
|
|
|