|
@@ -0,0 +1,640 @@
|
|
|
+<template>
|
|
|
+ <div style="position: relative" ref="commonTable">
|
|
|
+ <!--表格栏-->
|
|
|
+ <el-table id="commonTable" ref="doLayout" :data="data.content" :highlight-current-row="highlightCurrentRow"
|
|
|
+ @selection-change="selectionChange" @row-click="rowClick" @current-change="handleCurrentChange" :border="border"
|
|
|
+ :stripe="stripe" :show-summary="showSummary" :show-overflow-tooltip="showOverflowTooltip"
|
|
|
+ :height="tableHeights ? tableHeights : tableHeight" :size="size" :align="align" style="width: 100%"
|
|
|
+ :row-class-name="tableRowClassName" :expand-row-keys="expandRows" row-key="id">
|
|
|
+ <el-table-column type="selection" width="50" fixed align="center" v-if="
|
|
|
+ showBatchDelete ||
|
|
|
+ refreshStatus ||
|
|
|
+ showBatchSettled ||
|
|
|
+ showBatchPrint ||
|
|
|
+ customToolseletted ||
|
|
|
+ disableInBulk ||
|
|
|
+ select
|
|
|
+ "></el-table-column>
|
|
|
+ <el-table-column v-if="SerialShow" label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
+ <template v-for="column in columns">
|
|
|
+ <el-table-column header-align="center" align="center" :prop="column.prop" :label="column.label"
|
|
|
+ :width="column.width" :min-width="column.minWidth" :fixed="column.fixed" :key="column.prop"
|
|
|
+ :type="column.type" :formatter="column.formatter" :sortable="column.sortable ? column.sortable : false">
|
|
|
+ <template v-for="columnchildren in column.children">
|
|
|
+ <el-table-column v-if="columnchildren" header-align="center" align="center" :prop="columnchildren.prop"
|
|
|
+ :label="columnchildren.label" :width="columnchildren.width" :min-width="columnchildren.minWidth"
|
|
|
+ :fixed="columnchildren.fixed" :key="columnchildren.prop" :type="columnchildren.type"
|
|
|
+ :formatter="columnchildren.formatter" :sortable="columnchildren.sortable == null ? true : columnchildren.sortable
|
|
|
+ ">
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ <el-table-column label="操作" :width="operationWidth" :fixed="isNotFixed ? false : 'right'" v-if="showOperation"
|
|
|
+ header-align="center" align="center" class-name="table-fiexd">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <slot name="buttonSlot" :row="scope.row" :index="scope.$index"></slot>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ <!--分页栏-->
|
|
|
+ <!-- 底部分页 -->
|
|
|
+ <!-- <kt-button :label="customToolName" :perms="permscustomTool" :size="size" type="danger" @click="customToolMethod()"
|
|
|
+ :disabled="selections.length === 0" style="float: left" v-if="customToolseletted" />
|
|
|
+ <kt-button class="debutton" :label="deleteName" :perms="permsDelete" :size="size" type="danger"
|
|
|
+ @click="handleBatchDelete()" :disabled="selections.length === 0" style="float: left"
|
|
|
+ v-if="showBatchDelete & showOperation" />
|
|
|
+ <kt-button class="debutton" :label="refreshStatusName" :size="size" type="danger" @click="refreshStatusBatch()"
|
|
|
+ :disabled="selections.length === 0" style="float: left" v-if="refreshStatus" />
|
|
|
+ <kt-button :label="customToolName1" :perms="permscustomTool" :size="size" type="danger"
|
|
|
+ @click="customToolMethod1()" :disabled="selections.length === 0" style="float: left"
|
|
|
+ v-if="customToolseletted" />
|
|
|
+ <kt-button :label="disableInBulkName" :perms="disableInBulkperms" :size="size" type="danger"
|
|
|
+ @click="disableInBulkClick()" :disabled="selections.length === 0" style="float: left" v-if="disableInBulk" />
|
|
|
+ <kt-button :label="settledName" :perms="permsSettled" :size="size" type="danger" @click="handleBatchSettled()"
|
|
|
+ :disabled="selections.length === 0" style="float: left" v-if="showBatchSettled" />
|
|
|
+ <kt-button label="导出Excel" :perms="permsExcel" :size="size" type="danger" @click="handleBatchPrint()"
|
|
|
+ style="float: left" v-if="showBatchPrint" />
|
|
|
+ <div v-if="tableSelectedCount" class="tableSelectedCountClass">已选
|
|
|
+ <span>{{ tableSelectedCount }}</span>
|
|
|
+ 条
|
|
|
+ </div> -->
|
|
|
+ <pagination v-show="data.totalSize > 0" :total="data.totalSize" :page.sync="data.pageNum"
|
|
|
+ :limit.sync="data.pageSize" @pagination="findPage()" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "KtCommonTable",
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ //批量刷新状态
|
|
|
+ refreshStatus: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ // 承保规则expend内容
|
|
|
+ agreementUnderwritingRuleShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ select: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ tableHeights: {
|
|
|
+ type: Number,
|
|
|
+ },
|
|
|
+ operationWidth: {
|
|
|
+ type: Number,
|
|
|
+ default: 200,
|
|
|
+ },
|
|
|
+ // 是否需要固定列(指操作那一列)
|
|
|
+ isNotFixed: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ showBatchSettled: {
|
|
|
+ //显示批量结算
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ SerialShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ customToolName: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ customToolName1: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ permscustomTool: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ customToolseletted: {
|
|
|
+ // 自定义操作组件
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ disableInBulkName: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ disableInBulkperms: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ disableInBulk: {
|
|
|
+ // 批量禁用
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ settledName: {
|
|
|
+ //批量按钮name
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ deleteName: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ refreshStatusName: {
|
|
|
+ //批量更新状态按钮Name
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ showBatchPrint: {
|
|
|
+ //显示批量导出
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ //显示合计
|
|
|
+ showSummary: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ //更多操作
|
|
|
+ buttonDropdown: {
|
|
|
+ type: Array,
|
|
|
+ default: () => [],
|
|
|
+ },
|
|
|
+ isshowpagination: {
|
|
|
+ //是否显示分页栏
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+
|
|
|
+ showSummaryFieldList: Array, //自定义合计列配置
|
|
|
+ keyName: String, //主键字段名
|
|
|
+ columns: Array, // 表格列配置
|
|
|
+ data: {}, // 表格分页数据
|
|
|
+ permsEdit: String, // 编辑权限标识
|
|
|
+ permsDelete: String, // 底部按钮标识
|
|
|
+ permsSettled: String, // 底部按钮标识
|
|
|
+ permsExcel: String, // 底部按钮标识
|
|
|
+ size: {
|
|
|
+ // 尺寸样式
|
|
|
+ type: String,
|
|
|
+ default: "small ",
|
|
|
+ },
|
|
|
+ align: {
|
|
|
+ // 文本对齐方式
|
|
|
+ type: String,
|
|
|
+ default: "left",
|
|
|
+ },
|
|
|
+ // maxHeight: { // 表格最大高度
|
|
|
+ // type: Number,
|
|
|
+ // default: 1420
|
|
|
+ // },
|
|
|
+ // height: { // 表格最大高度
|
|
|
+ // type: Number,
|
|
|
+ // default: 250
|
|
|
+ // },
|
|
|
+ showOperation: {
|
|
|
+ // 是否显示操作组件
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+ border: {
|
|
|
+ // 是否显示边框
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ stripe: {
|
|
|
+ // 是否显示斑马线
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+ highlightCurrentRow: {
|
|
|
+ // 是否高亮当前行
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+ showOverflowTooltip: {
|
|
|
+ // 是否单行显示
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+ showBatchDelete: {
|
|
|
+ // 是否显示操作组件
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ showSysUserAccountCardList: {
|
|
|
+ // 是否显示二级列组件
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ showDefaultPage: {
|
|
|
+ // 是否默认调用一次查询
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableSelectedCount: "",
|
|
|
+ tableHeight: 0,
|
|
|
+ loading: false, // 加载标识
|
|
|
+ selections: [], // 列表选中列
|
|
|
+ pageRequest: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ },
|
|
|
+ taskPool: false,
|
|
|
+
|
|
|
+ underwritingRulesAddVehicleFactorVisible: false,
|
|
|
+ underwritingRulesForm: {
|
|
|
+ //承保因子表单项
|
|
|
+ agreementId: "", //协议id
|
|
|
+ ruleDescription: "", //规则描述
|
|
|
+ rulesStartDate: "",//规则起期
|
|
|
+ rulesEndDate: "",//规则止期
|
|
|
+ validInd: "1", //是否有效
|
|
|
+ rulesAttrList: [],//规则属性
|
|
|
+ carClassList: [],
|
|
|
+ areanumberplateList: [],
|
|
|
+ licenseAreaList: [],
|
|
|
+ },
|
|
|
+ expandRows: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //获取银行卡信息
|
|
|
+ getSysUserAccountCardList(row) {
|
|
|
+ if (typeof row.expanded === "undefined") {
|
|
|
+ row.expanded = true;
|
|
|
+ }
|
|
|
+ if (row.expanded) {
|
|
|
+ if (this.expandRows.includes(row.id)) {
|
|
|
+ this.expandRows = this.expandRows.filter(item => item !== row.id);
|
|
|
+ } else {
|
|
|
+ this.expandRows.push(row.id);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.expandRows = this.expandRows.filter(item => item !== row.id);
|
|
|
+ }
|
|
|
+ row.expanded = !row.expanded;
|
|
|
+ if (row.sysUserAccountCardList.length === 0) {
|
|
|
+ this.$api.dept.queryCardListByUserId(row.userId).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data) {
|
|
|
+ row.sysUserAccountCardList = res.data;
|
|
|
+ this.$set(this.data.content, row.index, row)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //this.$refs.doLayout.toggleRowExpansion(row, row.expanded);
|
|
|
+ },
|
|
|
+
|
|
|
+ tableRowClassName(row, rowIndex) {
|
|
|
+ // if (!!row.fieldName24 && row.fieldName24.indexOf("未") >= 0) {
|
|
|
+ // return "warningRow";
|
|
|
+ // } else if (!!row.fieldName24 && row.fieldName24.indexOf("已") >= 0) {
|
|
|
+ // return "successRow";
|
|
|
+ // }
|
|
|
+ if (!!this.taskPool) {
|
|
|
+ if (row.row.isExternal === 1) {
|
|
|
+ return "flagRow";
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$emit("tableRowClassName", row);
|
|
|
+ // return '';
|
|
|
+ },
|
|
|
+
|
|
|
+ // 分页查询
|
|
|
+ findPage: function () {
|
|
|
+ this.loading = true;
|
|
|
+ let callback = (res) => {
|
|
|
+ this.loading = false;
|
|
|
+ //解决操作栏位置偏移问题
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.doLayout.doLayout();
|
|
|
+ }, 200);
|
|
|
+ };
|
|
|
+ this.$emit("findPage", {
|
|
|
+ pageRequest: this.pageRequest,
|
|
|
+ callback: callback,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ hideLoading() {
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ // 选择切换
|
|
|
+ selectionChange: function (selections) {
|
|
|
+ let idlist = [];
|
|
|
+ this.tableSelectedCount = selections.length;
|
|
|
+ this.selections = selections;
|
|
|
+ // this.selections.map((item) => idlist.push(item.id));
|
|
|
+ this.$emit("selectionChange", selections);
|
|
|
+ },
|
|
|
+ // 选择切换
|
|
|
+ handleCurrentChange: function (val) {
|
|
|
+ this.$emit("handleCurrentChange", {
|
|
|
+ val: val,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ rowClick: function (row) {
|
|
|
+ this.$emit("rowClick", {
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 换页刷新
|
|
|
+ refreshPageRequest: function (pageNum) {
|
|
|
+ this.pageRequest.pageNum = pageNum;
|
|
|
+ // this.pageRequest.pageSize = 20;
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ // 每页条数发生改变
|
|
|
+ handleSizeChange(pageSize) {
|
|
|
+ this.pageRequest.pageSize = pageSize;
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ signStateChanged(index, row) {
|
|
|
+ this.$emit("signStateChanged", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 按钮编辑
|
|
|
+ handleBtnEdit: function (index, row) {
|
|
|
+ this.$emit("handleBtnEdit", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 编辑
|
|
|
+ handleEdit: function (index, row) {
|
|
|
+ this.$emit("handleEdit", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ // this.$emit('findLeftTreeData')
|
|
|
+ },
|
|
|
+ handleBreak: function (index, row, i, r) {
|
|
|
+ this.$emit("handleBreak", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ i: i,
|
|
|
+ r: r,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleTimeLine: function (index, row, i, r) {
|
|
|
+ this.$emit("handleTimeLine", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ i: i,
|
|
|
+ r: r,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleRebind: function (index, row, i, r) {
|
|
|
+ this.$emit("handleRebind", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ i: i,
|
|
|
+ r: r,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ handleDelete: function (index, row) {
|
|
|
+ let _keyName = "id";
|
|
|
+ if (!!this.keyName) {
|
|
|
+ _keyName = this.keyName;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.delete(row[_keyName]);
|
|
|
+ },
|
|
|
+ handleButton1: function (index, row) {
|
|
|
+ this.$emit("handleButton1", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton2: function (index, row) {
|
|
|
+ this.$emit("handleButton2", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton3: function (index, row) {
|
|
|
+ this.$emit("handleButton3", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton4: function (index, row) {
|
|
|
+ this.$emit("handleButton4", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton5: function (index, row) {
|
|
|
+ this.$emit("handleButton5", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton6: function (index, row) {
|
|
|
+ this.$emit("handleButton6", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton7: function (index, row) {
|
|
|
+ this.$emit("handleButton7", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton8: function (index, row) {
|
|
|
+ this.$emit("handleButton8", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton10: function (index, row) {
|
|
|
+ this.$emit("handleButton10", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton9: function (index, row) {
|
|
|
+ this.$emit("handleButton9", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleButton: function (index, row) {
|
|
|
+ this.$emit("handleButton", {
|
|
|
+ index: index,
|
|
|
+ row: row,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除单个
|
|
|
+ handleDeleteFlag: function (index, row) {
|
|
|
+ this.$emit("handleDeleteFlag", { index: index, row: row });
|
|
|
+ // var _keyName = "id";
|
|
|
+ // if (!!this.keyName) {
|
|
|
+ // _keyName = this.keyName;
|
|
|
+ // }
|
|
|
+ // let ids = row[_keyName];
|
|
|
+ // this.$confirm("确认删除吗?", "提示", {
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // let params = [];
|
|
|
+ // let idArray = (ids + "").split(",");
|
|
|
+ // for (var i = 0; i < idArray.length; i++) {
|
|
|
+ // var obj = {};
|
|
|
+ // obj[_keyName] = idArray[i];
|
|
|
+ // params.push(obj);
|
|
|
+ // }
|
|
|
+ // this.loading = true;
|
|
|
+ // let callback = (res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.$message({
|
|
|
+ // message: "操作成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.findPage();
|
|
|
+ // // this.$emit('findLeftTreeData')
|
|
|
+ // } else {
|
|
|
+ // this.$message({
|
|
|
+ // message: "操作失败, " + res.msg,
|
|
|
+ // type: "error",
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // this.$emit("handleDeleteFlag", {
|
|
|
+ // params: params,
|
|
|
+ // callback: callback,
|
|
|
+ // });
|
|
|
+ // this.loading = false;
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // this.loading = false;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ //批量刷新状态
|
|
|
+ refreshStatusBatch: function () {
|
|
|
+ let idlist = [];
|
|
|
+ this.selections.map((item) => idlist.push(item.subOrderId));
|
|
|
+ this.$emit("refreshStatusBatch", idlist);
|
|
|
+ },
|
|
|
+ // 批量删除
|
|
|
+ handleBatchDelete: function () {
|
|
|
+ let idlist = [];
|
|
|
+ this.selections.map((item) => idlist.push(item.id));
|
|
|
+ this.$emit("handleDelete", idlist);
|
|
|
+ },
|
|
|
+ //自定义批量操作按钮
|
|
|
+ customToolMethod() {
|
|
|
+ let idlist = [];
|
|
|
+ this.selections.map((item) => idlist.push(item.id));
|
|
|
+ this.$emit("customTool", idlist);
|
|
|
+ },
|
|
|
+
|
|
|
+ //自定义批量操作按钮1
|
|
|
+ customToolMethod1() {
|
|
|
+ let idlist = [];
|
|
|
+ this.selections.map((item) => idlist.push(item.id));
|
|
|
+ this.$emit("customTool1", idlist);
|
|
|
+ },
|
|
|
+ //批量导出
|
|
|
+ disableInBulkClick() {
|
|
|
+ let idlist = [];
|
|
|
+ this.selections.map((item) => idlist.push(item.id));
|
|
|
+ this.$emit("disableInBulkClick", idlist);
|
|
|
+ },
|
|
|
+ // 删除操作
|
|
|
+ delete: function (ids) {
|
|
|
+ var _keyName = "id";
|
|
|
+ if (!!this.keyName) {
|
|
|
+ _keyName = this.keyName;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm("确认删除吗?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let params = [];
|
|
|
+ let idArray = (ids + "").split(",");
|
|
|
+ for (var i = 0; i < idArray.length; i++) {
|
|
|
+ var obj = {};
|
|
|
+ obj[_keyName] = idArray[i];
|
|
|
+ params.push(obj);
|
|
|
+ }
|
|
|
+ let callback = (res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.findPage();
|
|
|
+ // this.$emit('findLeftTreeData')
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "操作失败, " + res.msg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.$emit("handleDelete", {
|
|
|
+ params: params,
|
|
|
+ callback: callback,
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+ },
|
|
|
+ //批量结算
|
|
|
+ handleBatchSettled: function () {
|
|
|
+ let _keyName = "orderno";
|
|
|
+ if (!!this.keyName) {
|
|
|
+ _keyName = this.keyName;
|
|
|
+ }
|
|
|
+ let idlist = [];
|
|
|
+ this.selections.map((item) => idlist.push(item[_keyName]));
|
|
|
+ this.$emit("handleSettled", idlist);
|
|
|
+ },
|
|
|
+ //批量打印
|
|
|
+ handleBatchPrint: function () {
|
|
|
+ // let _keyName = "orderno";
|
|
|
+ // if(!!this.keyName){
|
|
|
+ // _keyName = this.keyName;
|
|
|
+ // }
|
|
|
+ // let ids = this.selections.map(item => item[_keyName]).toString()
|
|
|
+ // console.log(ids);
|
|
|
+ this.$emit("handlePrint");
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+ const that = this;
|
|
|
+ if (this.showDefaultPage) {
|
|
|
+ that.refreshPageRequest(1);
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ let tableTop = that.$refs.commonTable.offsetTop;
|
|
|
+ let height = window.innerHeight;
|
|
|
+ that.tableHeight = height - tableTop - 225 + "px";
|
|
|
+ }, 10);
|
|
|
+ // window.onresize = function () {
|
|
|
+ // let tableTop = that.$refs.commonTable.offsetTop;
|
|
|
+ // let bottomTop = that.$refs.bottomFixed.offsetTop;
|
|
|
+
|
|
|
+ // that.tableHeight = bottomTop - tableTop - 120 + "px";
|
|
|
+ // };
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<style lang="scss" scoped></style>
|