| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392 |
- <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 ||
- 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"
- 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 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
- :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: {
- // 承保规则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,
- },
- 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 {
- 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() {
- 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.tableSelectedCount=selections.length;
- 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);
- },
- //批量导出
- 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 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>
- .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>
|