| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351 |
- <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="expand"
- v-if="agreementUnderwritingRuleShow"
- >
- <div class="tab-panestyle">
- <Product-Cost-Form ref="ProductRef" :form="dynamicFormArray" :operator="operatorlist" over-size="small" :underwritingRulesForm="underwritingRulesForm" :disabled="true"></Product-Cost-Form>
- </div>
- </el-table-column>
- <el-table-column
- type="expand"
- v-if="showSysUserAccountCardList"
- style="display: flex"
- >
- <template slot-scope="scope">
- <el-table
- :data="scope.row.sysUserAccountCardList"
- size="small"
- :header-cell-style="{
- background: '#ccc',
- fontWeight: '900',
- color: '#606266',
- }"
- style="width: 70%"
- >
- <el-table-column
- type="index"
- width="50"
- align="center"
- label="序号"
- >
- </el-table-column>
- <el-table-column prop="bankAccount" label="银行" style="flex: 1">
- </el-table-column>
- <el-table-column prop="bankAddress" label="开户行" style="flex: 1">
- </el-table-column>
- <el-table-column prop="bankNumber" label="银行卡号" style="flex: 1">
- </el-table-column>
- <el-table-column
- prop="realUserName"
- label="真实姓名"
- style="flex: 1"
- >
- </el-table-column>
- <el-table-column
- prop="auditStatus"
- label="审核状态"
- style="flex: 1"
- >
- <template slot-scope="scope1">
- <span>{{
- scope1.row.auditStatus == 0
- ? "未审核"
- : scope1.row.auditStatus == "1"
- ? "审核通过"
- : scope1.row.auditStatus == "2"
- ? "审核驳回"
- : scope1.row.auditStatus
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="delFlag"
- label="是否解绑"
- style="flex: 1"
- width="150"
- >
- <template slot-scope="scope1">
- <el-row>
- <el-col :span="8">
- <span style="margin-right: 20px">{{
- scope1.row.delFlag == "0" ? "未解绑" : "已解绑"
- }}</span>
- </el-col>
- <el-col :span="8">
- <el-button
- v-if="scope1.row.delFlag == '0'"
- type="text"
- size="mini"
- @click="
- handleBreak(
- scope.$index,
- scope.row,
- scope1.$index,
- scope1.row
- )
- "
- >解绑</el-button
- >
- </el-col>
- <el-col :span="8">
- <el-button
- v-if="scope1.row.delFlag == '1'"
- type="text"
- size="mini"
- @click="
- handleRebind(
- scope.$index,
- scope.row,
- scope1.$index,
- scope1.row
- )
- "
- >重绑</el-button
- >
- </el-col>
- <el-col :span="8">
- <el-button
- type="text"
- size="mini"
- @click="
- handleTimeLine(
- scope.$index,
- scope.row,
- scope1.$index,
- scope1.row
- )
- "
- >轨迹</el-button
- >
- </el-col>
- </el-row>
- </template>
- </el-table-column>
- </el-table>
- </template>
- </el-table-column>
- <el-table-column
- type="selection"
- width="50"
- fixed
- align="center"
- v-if="
- showBatchDelete ||
- showBatchSettled ||
- showBatchPrint ||
- customToolseletted ||
- 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"
- v-if="
- column.signIcon ||
- column.isImg ||
- column.isBtn ||
- column.isSex ||
- column.isStatus
- "
- >
- <template slot-scope="scope">
- <el-switch
- :disabled="column.isDisabled"
- v-if="column.signIcon"
- v-model="scope.row[column.prop]"
- active-value="1"
- inactive-value="0"
- @change="signStateChanged(scope.$index, scope.row)"
- ></el-switch>
- <img
- v-if="column.isImg"
- :width="column.imgWidth"
- :height="column.imgHeight"
- :src="scope.row[column.prop]"
- />
- <kt-button
- v-if="column.isBtn"
- icon="fa fa-edit"
- :label="column.btnName"
- :size="size"
- :perms="column.permsEdit"
- @click="handleBtnEdit(scope.$index, scope.row)"
- />
- <el-tag
- v-if="column.isSex && scope.row[column.prop]"
- :type="
- scope.row[column.prop] == '女'
- ? 'danger'
- : scope.row[column.prop] == '男'
- ? ''
- : 'danger'
- "
- effect="plain"
- >
- {{ scope.row[column.prop] }}
- </el-tag>
- <el-tag
- v-if="column.isStatus"
- :type="
- scope.row[column.prop] == '在职'
- ? 'success'
- : scope.row[column.prop] == '离司'
- ? 'info'
- : scope.row[column.prop] == '入司待审核'
- ? 'warning'
- : scope.row[column.prop] == '离司待审核'
- ? 'warning'
- : scope.row[column.prop] == '修改待审核'
- ? 'warning'
- : 'danger'
- "
- effect="plain"
- >
- {{ scope.row[column.prop] }}
- </el-tag>
- </template>
- </el-table-column>
- <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"
- v-else
- >
- <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">
- <kt-button
- type="primary"
- v-if="editButtonName"
- icon="fa fa-edit"
- :label="editButtonName"
- :perms="permsEdit"
- :size="size"
- @click="handleEdit(scope.$index, scope.row)"
- />
- <kt-button
- v-if="deleteButtonName"
- icon="fa fa-trash"
- :label="deleteButtonName"
- :perms="permsDelete"
- :size="size"
- type="danger"
- @click="handleDeleteFlag(scope.$index, scope.row)"
- />
- <kt-button
- :style="{
- background: button1Background + '',
- border: '1px solid' + button1Background,
- color: '#fff',
- }"
- v-if="button1Name"
- :label="button1Name"
- :perms="permsButton1"
- :size="size"
- :icon="button1Icon"
- @click="handleButton1(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button2Name"
- :label="button2Name"
- :perms="permsButton2"
- :size="size"
- :type="button2Type"
- :icon="button2Icon"
- @click="handleButton2(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button3Name"
- :label="button3Name"
- :perms="permsButton3"
- :size="size"
- :type="button3Type"
- :icon="button3Icon"
- @click="handleButton3(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button4Name"
- :icon="button4Icon"
- :type="button4Type"
- :label="button4Name"
- :perms="permsButton4"
- :size="size"
- @click="handleButton4(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button5Name"
- :label="button5Name"
- :size="size"
- :type="button5Type"
- :icon="button5Icon"
- @click="handleButton5(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button6Name"
- :label="button6Name"
- :size="size"
- :type="button6Type"
- @click="handleButton6(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button7Name && scope.row.status == button7Status"
- :label="button7Name"
- :size="size"
- :type="button7Type"
- @click="handleButton7(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button8Name && scope.row.status == button8Status"
- :label="button8Name"
- :size="size"
- :type="button8Type"
- @click="handleButton8(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button10Name && scope.row.status == button10Status"
- :label="button10Name"
- :size="size"
- :type="button10Type"
- @click="handleButton10(scope.$index, scope.row)"
- />
- <kt-button
- v-if="button9Name && scope.row.status == button9Status"
- :label="button9Name"
- :size="size"
- :type="button9Type"
- @click="handleButton9(scope.$index, scope.row)"
- />
- <el-button type="text" size="small" v-if="buttonDropdown.length > 0">
- <el-dropdown trigger="click">
- <span class="el-dropdown-link">
- 更多
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- v-for="val in buttonDropdown"
- :key="val.label"
- >
- <el-button
- style="width: 100%"
- size="mini"
- type="text"
- v-if="!val.hide || (val.hide && val.hide(scope.row))"
- @click="val.click(scope.row)"
- >{{ val.label }}</el-button
- >
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--分页栏-->
- <!-- 底部分页 -->
- <div class="bottomFixed" 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
- :label="customToolName1"
- :perms="permscustomTool"
- :size="size"
- type="danger"
- @click="customToolMethod1()"
- :disabled="selections.length === 0"
- style="float: left"
- v-if="customToolseletted"
- />
- <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"
- />
- <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: {
- // 承保规则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,
- },
- settledName: {
- //批量按钮name
- type: String,
- },
- deleteName: {
- type: String,
- },
- showBatchPrint: {
- //显示批量导出
- type: Boolean,
- default: false,
- },
- //显示合计
- showSummary: {
- type: Boolean,
- default: false,
- },
- button1Name: {
- type: String,
- },
- button2Name: {
- type: String,
- },
- button3Name: {
- type: String,
- },
- button4Name: {
- type: String,
- },
- button5Name: {
- type: String,
- },
- button6Name: {
- type: String,
- },
- button7Name: {
- type: String,
- },
- button7Status: {
- type: String,
- },
- button8Name: {
- type: String,
- },
- button8Status: {
- type: String,
- },
- button9Name: {
- type: String,
- },
- button9Status: {
- type: String,
- },
- button10Name: {
- type: String,
- },
- button10Status: {
- type: String,
- },
- buttonDropdown: {
- type: Array,
- default: () => [],
- },
- permsButton1: {
- type: String,
- },
- permsButton2: {
- type: String,
- },
- permsButton3: {
- type: String,
- },
- permsButton4: {
- type: String,
- },
- button1Background: {
- type: String,
- default: "#f56c6c",
- },
- button2Background: {
- type: String,
- default: "rgb(222, 80, 76)",
- },
- button3Background: {
- type: String,
- default: "rgb(14, 194, 22)",
- },
- button4Background: {
- type: String,
- default: "#1e87ed",
- },
- button1Icon: {
- type: String,
- default: "fa fa-trash",
- },
- button2Icon: {
- type: String,
- default: "",
- },
- button3Icon: {
- type: String,
- default: "",
- },
- button4Icon: {
- type: String,
- default: "",
- },
- button5Icon: {
- type: String,
- default: "",
- },
- button2Type: {
- type: String,
- default: "primary",
- },
- button3Type: {
- type: String,
- default: "primary",
- },
- button4Type: {
- type: String,
- default: "primary",
- },
- button5Type: {
- type: String,
- default: "primary",
- },
- button6Type: {
- type: String,
- default: "primary",
- },
- button7Type: {
- type: String,
- default: "primary",
- },
- button8Type: {
- type: String,
- default: "primary",
- },
- button9Type: {
- type: String,
- default: "primary",
- },
- button10Type: {
- type: String,
- default: "primary",
- },
- editButtonName: {
- type: String,
- },
- deleteButtonName: {
- type: String,
- },
- 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 {
- 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() {
- this.licenseQuery();
- this.getDicType('trafficManagementVehicleType') // 车辆列表
- },
- watch: {
- tableList(val, old) {
- if(val.length> 0) {
- let obj = val[0]
- this.underwritingRulesHistoryDetails(obj, val)
- }
- },
- },
- methods: {
- // 点击展开行
- handleExpandChange(row,rows) {
- if(rows.length>0) {
- this.underwritingRulesHistoryDetails(row)
- }
- },
- getDicType(type) {
- this.$api.insCompany.dicType(type).then((res) => {
- if (res.code == 200) {
- if (type == 'trafficManagementVehicleType') {
- let data = [];
- res.data.ddList.map(val => {
- data.push({
- code: val.dictValue,
- name: val.dictTag,
- })
- return val;
- })
- this.carClassList = data;
- } else {
- this[type + "options"] = res.data.ddList;
- }
- }
- });
- },
- licenseQuery() {
- this.$api.insCompany.getAreaLicense("14").then((res) => {
- let data = [];
- res.data.map(val => {
- data.push({
- code: val.areaNumber,
- name: val.license,
- })
- return val;
- })
- this.areanumberplateList = data;
- });
- this.$api.insCompany.getAreaLicense("0").then((res) => {
- let data = [];
- res.data.map(val => {
- data.push({
- code: val.areaNumber,
- name: val.license,
- })
- return val;
- })
- this.licenseAreaList = data;
- });
- },
- // 承保规则历史记录详情
- 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) {
- this.selections = selections;
- this.$emit("selectionChange", {
- selections: 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;
- // });
- },
- // 批量删除
- 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);
- },
- // 删除操作
- 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 bottomTop = that.$refs.bottomFixed.offsetTop;
- that.tableHeight = bottomTop - tableTop - 120 + "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>
- /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>
|