123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <template>
- <div>
- <el-dialog v-dialogDrag :title="title" :visible.sync="visible" :close-on-click-modal="false" :modal-append-to-body="false" width="60%" @close="closeDialog" top="5vh">
- <p v-if="isShowText">共{{ CompanyNum }}家客户,其中{{ CompanyMultiple }}家客户有多份合同</p>
- <el-table :data="tableData" border style="margin: 20px 0" height="600">
- <el-table-column v-for="(col, index) in columns" :key="index" :prop="col.prop" :label="col.label" align="center">
- <template slot-scope="{ row }">
- <span v-if="col.label === '操作'" style="color: #409eff; cursor: pointer; font-size: 14px; margin-right: 20px" @click="historicalNotesClickHandler(row)">历史备注</span>
- <span v-else>{{ handleRowContent(row, col) }}</span>
- </template>
- </el-table-column>
- </el-table>
- <el-col :span="24" class="toolbar" v-if="total">
- <m-page :total="total" :page_no="page_no" @handleCurrentChange="handleCurrentChange" />
- </el-col>
- </el-dialog>
- <HistoricalNotesDlg :historicalNotesDlgVisible.sync="historicalNotesDlgVisible" :CompanyId.sync="historicalNotesId" />
- </div>
- </template>
- <script>
- import HistoricalNotesDlg from "@/components/historicalNotesDlg.vue";
- import { dataMainInterface } from "@/api/api.js";
- import mPage from "@/components/mPage.vue";
- export default {
- name: "",
- components: { HistoricalNotesDlg, mPage },
- props: {
- visible: {
- type: Boolean,
- default: false,
- },
- title: {
- type: String,
- default: "",
- },
- columns: {
- type: Array,
- default: [],
- },
- dataItem: {
- type: Object,
- default: {},
- },
- },
- data() {
- return {
- tableData: [],
- historicalNotesDlgVisible: false, //历史备注的弹框
- historicalNotesId: 0,
- total: 0,
- pageSize: 10,
- page_no: 1,
- CompanyMultiple: 0,
- CompanyNum: 0,
- };
- },
- computed: {
- isShowText() {
- return ["新签合同", "到期合同", "续约合同", "确认不续约合同"].includes(this.title);
- },
- },
- watch: {
- visible(val) {
- if (val) {
- this.getData();
- }
- },
- },
- created() {},
- mounted() {},
- methods: {
- closeDialog() {
- this.tableData = [];
- this.historicalNotesDlgVisible = false; //历史备注的弹框
- this.historicalNotesId = 0;
- this.total = 0;
- this.pageSize = 10;
- this.page_no = 1;
- this.CompanyMultiple = 0;
- this.CompanyNum = 0;
- this.$emit("update:visible", false);
- this.$emit("update:dataItem", {});
- },
- // 点击了历史留言
- historicalNotesClickHandler(row) {
- this.historicalNotesDlgVisible = true;
- this.historicalNotesId = row.CompanyId;
- },
- handleCurrentChange(val) {
- this.page_no = val;
- this.getData();
- },
- // 获取数据
- async getData() {
- const res = await dataMainInterface.getRaiDataSummaryList({
- DataType: this.dataItem.DataType,
- SellerId: this.dataItem.SellerId,
- CurrentIndex: this.page_no,
- PageSize: this.pageSize,
- PopupType: this.title,
- });
- if (res.Ret === 200) {
- this.tableData = res.Data.List;
- this.total = res.Data.Paging.Totals;
- this.CompanyMultiple = res.Data.CompanyMultiple;
- this.CompanyNum = res.Data.CompanyNum;
- }
- },
- // 处理表格内容
- handleRowContent(row, col) {
- if (col.label === "合同期限") {
- return `${row.StartDate} ~ ${row.EndDate}`;
- }
- return row[col.prop];
- },
- },
- };
- </script>
- <style scoped lang=""></style>
|