|
@@ -100,6 +100,7 @@
|
|
|
</el-select>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col
|
|
|
:span="3"
|
|
|
class="fr"
|
|
@@ -114,6 +115,20 @@
|
|
|
批量删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ class="fr"
|
|
|
+ style="width: 90px; padding: 0 0 0 10px"
|
|
|
+ v-if="powers.some((i) => i == '087')"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ :size="searchSize"
|
|
|
+ @click="batchExport(selection)"
|
|
|
+ >
|
|
|
+ 订单导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -195,7 +210,8 @@ import asyncRequest from "@/apis/service/youzan/othTransferOrderLog";
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import { columns, pay_type_list, status_list } from "./columns";
|
|
|
+import { columns, pay_type_list, status_list, tHeader, filterVal } from "./columns";
|
|
|
+import { formatJson } from "@/utils/publicMethods";
|
|
|
export default {
|
|
|
name: "othTransferOrderLog",
|
|
|
mixins: [mixinPage, resToken],
|
|
@@ -410,6 +426,48 @@ export default {
|
|
|
}
|
|
|
this.loading = false;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 批量导出
|
|
|
+ * @param {Array} selection 当前选择项
|
|
|
+ */
|
|
|
+ batchExport(selection) {
|
|
|
+ if (!this.loading) {
|
|
|
+ if (selection.length == 0) {
|
|
|
+ this.$message.warning("请至少选择一条数据!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(selection);
|
|
|
+
|
|
|
+ this.loading = true;
|
|
|
+ let data = [].concat(...selection);
|
|
|
+ let list = [];
|
|
|
+ data.forEach((item) => {
|
|
|
+ let model = Object.assign({}, item);
|
|
|
+ model.status =
|
|
|
+ (this.status_list.find((item) => item.value == model.status + "") || {})
|
|
|
+ .label || "--";
|
|
|
+ model.pay_type =
|
|
|
+ (this.pay_type_list.find((item) => item.value == model.pay_type + "") || {})
|
|
|
+ .label || "--";
|
|
|
+ list.push(model);
|
|
|
+ });
|
|
|
+ console.log(list);
|
|
|
+ const xlsName = `有赞转单记录批量导出`;
|
|
|
+ import("@/vendor/Export2Excel").then((excel) => {
|
|
|
+ const data = formatJson(filterVal, list);
|
|
|
+ excel.export_json_to_excel({
|
|
|
+ header: tHeader,
|
|
|
+ data,
|
|
|
+ filename: `${xlsName}`,
|
|
|
+ });
|
|
|
+ this.$message.success(`${xlsName}成功!`);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|