|
|
@@ -0,0 +1,833 @@
|
|
|
+<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"
|
|
|
+ :element-loading-text="$t('action.loading')" :border="border" :stripe="stripe" :show-summary="showSummary"
|
|
|
+ :summary-method="getSummaries" :show-overflow-tooltip="showOverflowTooltip"
|
|
|
+ :height="tableHeights ? tableHeights : tableHeight" :size="size" :align="align" :header-cell-style="{
|
|
|
+ fontWeight: '900',
|
|
|
+ color: '#606266',
|
|
|
+ }" style="width: 100%" :row-class-name="tableRowClassName" @expand-change="handleExpandChange"
|
|
|
+ :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="$t('action.operation')" :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>
|
|
|
+ <!--分页栏-->
|
|
|
+ <!-- 底部分页 -->
|
|
|
+ <div class="bottomFixed flex a-c" ref="bottomFixed">
|
|
|
+ <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>
|
|
|
+ <el-pagination background @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ @current-change="refreshPageRequest" :current-page="data.pageNum" :page-size="data.pageSize"
|
|
|
+ :page-sizes="[10, 20, 50, 100, 200, 300, 400, 500]" :total="data.totalSize"
|
|
|
+ style="float: left; margin-left: 20px" v-if="isshowpagination">
|
|
|
+
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import KtButton from "@/views/Core/KtButton";
|
|
|
+import BigNumber from "bignumber.js";
|
|
|
+import ProductCostForm from '@/components/Form/ProductCostForm.vue';//表单组件
|
|
|
+export default {
|
|
|
+ name: "KtCommonTable",
|
|
|
+ components: {
|
|
|
+ KtButton,
|
|
|
+ ProductCostForm
|
|
|
+ },
|
|
|
+ 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: true,
|
|
|
+ },
|
|
|
+ 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,
|
|
|
+ },
|
|
|
+ tableList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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: true,
|
|
|
+ },
|
|
|
+ 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,
|
|
|
+ operator: { "pageNum": 1, "pageSize": 10, "columnFilters": { "label": { "name": "label", "value": "agreement_operator" } } },
|
|
|
+ dynamicFormArray: [],
|
|
|
+ operatorlist: [],
|
|
|
+ underwritingRulesForm: {
|
|
|
+ //承保因子表单项
|
|
|
+ agreementId: "", //协议id
|
|
|
+ ruleDescription: "", //规则描述
|
|
|
+ rulesStartDate: "",//规则起期
|
|
|
+ rulesEndDate: "",//规则止期
|
|
|
+ validInd: "1", //是否有效
|
|
|
+ rulesAttrList: [],//规则属性
|
|
|
+ carClassList: [],
|
|
|
+ areanumberplateList: [],
|
|
|
+ licenseAreaList: [],
|
|
|
+ },
|
|
|
+ expandRows: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ tableList(val, old) {
|
|
|
+ if (val.length > 0) {
|
|
|
+ let obj = val[0]
|
|
|
+ this.underwritingRulesHistoryDetails(obj, val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ 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);
|
|
|
+ },
|
|
|
+ // 点击展开行
|
|
|
+ handleExpandChange(row, rows) {
|
|
|
+ if (this.showSysUserAccountCardList) {
|
|
|
+ this.getSysUserAccountCardList(row)
|
|
|
+ }
|
|
|
+ if (rows.length > 0) {
|
|
|
+ if (this.agreementUnderwritingRuleShow) {
|
|
|
+ this.underwritingRulesHistoryDetails(row)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 承保规则历史记录详情
|
|
|
+ underwritingRulesHistoryDetails(row, value) {
|
|
|
+ let that = this
|
|
|
+ that.$api.dict.findPage(that.operator).then(res => {
|
|
|
+ that.operatorlist = res.data.content;
|
|
|
+ })
|
|
|
+ that.$api.insCompany.getUndwrtRulesFactorQuery(row.id).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ if (value && value.length == 1) {
|
|
|
+ this.expandRows.push(value[0].id)
|
|
|
+ }
|
|
|
+ let obj = Object.assign({}, res.data);
|
|
|
+ obj.costsAttrLinks.map(val => {
|
|
|
+ switch (val.attrType) {
|
|
|
+ case 'inputNumber':
|
|
|
+ case 'datetime':
|
|
|
+ if (!val.operator) {
|
|
|
+ val.operator = '1';
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (val.attrCode == 'LicenseNo') {
|
|
|
+ val.dictLabal = this.areanumberplateList;
|
|
|
+ }
|
|
|
+ if (val.attrCode == 'LicenseArea') {
|
|
|
+ val.dictLabal = this.licenseAreaList;
|
|
|
+ }
|
|
|
+ if (val.attrCode == 'CarClass') {
|
|
|
+ val.dictLabal = this.carClassList
|
|
|
+ }
|
|
|
+ return val;
|
|
|
+ })
|
|
|
+ that.dynamicFormArray = obj.costsAttrLinks;
|
|
|
+ that.underwritingRulesForm = {
|
|
|
+ id: obj.id,
|
|
|
+ agreementId: obj.agreementId, //协议id
|
|
|
+ ruleDescription: obj.ruleDescription, //规则描述
|
|
|
+ validInd: obj.validInd, //是否有效
|
|
|
+ rulesStartDate: obj.rulesStartDate,
|
|
|
+ rulesEndDate: obj.rulesEndDate,
|
|
|
+ rulesAttrList: [],//规则属性
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ that.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 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 '';
|
|
|
+ },
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计"; // 假设第一列显示文本'合计'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.showSummaryFieldList) {
|
|
|
+ // 如果当前列名不在需要计算的列名数组中,直接返回空值或其他标记
|
|
|
+ if (!this.showSummaryFieldList.includes(column.property)) {
|
|
|
+ sums[index] = "-";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let sum = new BigNumber(0);
|
|
|
+ data.forEach((item) => {
|
|
|
+ let value = item[column.property];
|
|
|
+ let number = new BigNumber(value);
|
|
|
+ if (!number.isNaN()) {
|
|
|
+ sum = sum.plus(number);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ sums[index] = sum.toFixed(); // 转换成字符串避免精度问题
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
+ // 分页查询
|
|
|
+ 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 - 160 + "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 scoped>
|
|
|
+/deep/ .el-table__fixed-body .el-table__fixed-right {
|
|
|
+ background-color: #f0f0f0;
|
|
|
+ /* 你想要的背景色 */
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .table-fiexd {
|
|
|
+ background: #fff !important;
|
|
|
+}
|
|
|
+
|
|
|
+/* 底部固定分页 */
|
|
|
+.bottomFixed {
|
|
|
+ height: 40px;
|
|
|
+ /* position: fixed; */
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ background: #fff;
|
|
|
+ /* margin-top: 10px; */
|
|
|
+ /* box-shadow: 0 -2px 0 0 #efefef; */
|
|
|
+}
|
|
|
+
|
|
|
+/deep/.el-table .el-table__row--striped {
|
|
|
+ background-color: inherit;
|
|
|
+}
|
|
|
+
|
|
|
+.el-table .warningRow {
|
|
|
+ background: oldlace;
|
|
|
+}
|
|
|
+
|
|
|
+.el-table .successRow {
|
|
|
+ background: #f0f9eb;
|
|
|
+}
|
|
|
+
|
|
|
+.el-dropdown-link {
|
|
|
+ cursor: pointer;
|
|
|
+ color: var(--themeColor);
|
|
|
+ font-size: 12px;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.tableSelectedCountClass {
|
|
|
+ color: #606266;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-left: 10px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-tag--plain {
|
|
|
+ background: rgba(93, 125, 255, 0.1);
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #5d7dff;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-tag--plain.el-tag--danger {
|
|
|
+ background: rgba(240, 85, 82, 0.1);
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+ border: 1px solid #f05552;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-tag--plain.el-tag--info {
|
|
|
+ background: rgba(158, 158, 158, 0.1);
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+ border: 1px solid #9e9e9e;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-tag--plain.el-tag--success {
|
|
|
+ background: rgba(81, 189, 44, 0.1);
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+ border: 1px solid #51bd2c;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-tag--plain.el-tag--warning {
|
|
|
+ background: rgba(242, 153, 47, 0.1);
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+ border: 1px solid #f2992f;
|
|
|
+}
|
|
|
+</style>
|