Răsfoiți Sursa

费用管理布局变更 公共表格组件动态判断是否显示顶部按钮组

祁鹏飞 1 lună în urmă
părinte
comite
e2cdf9e22d

+ 21 - 22
src/components/complexTable/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="containerTable">
     <div class="table_box">
-      <div class="table-title-btn">
+      <div class="table-title-btn" v-if="$slots['table-title-btn']">
         <slot name="table-title-btn"></slot>
       </div>
       <el-table ref="multipleTableRef" :row-key="rowKey"
         :header-cell-style="{ 'background-color': '#F7F7F9', 'border-bottom': '1px solid #EEF1F6', 'font-size': '15px', 'color': '#333', 'padding': '10px 0' }"
         :data="props.tableData" :height="tableHeight" :max-height="maxHeight" table-layout="fixed" style="width: 100%;"
-        @selection-change="selectionChange" @select-all="selectAllChange"  @cell-mouse-enter="handleMouseEnter"
+        @selection-change="selectionChange" @select-all="selectAllChange" @cell-mouse-enter="handleMouseEnter"
         @cell-mouse-leave="handleMouseLeave" :highlight-current-row="highlightCurrentRow"
         @current-change="currentChange" v-loading="loading" :show-summary='props.showSummary' border>
         <!-- 空内容自定义 -->
@@ -23,8 +23,7 @@
             <div>
               <el-table :data="props.row.children">
                 <el-table-column v-for="column in secondaryColumns" :key="column.prop" :prop="column.prop"
-                  :label="column.label" :sortable="column.sortable ?'custom' : false" :width="column.width"
-                  >
+                  :label="column.label" :sortable="column.sortable ? 'custom' : false" :width="column.width">
                   <template #header>
                     <slot name="search" :slotData="column"></slot>
                   </template>
@@ -55,16 +54,16 @@
         </el-table-column>
         <el-table-column v-if="showIndex" type="index" label="序号" width="55" />
         <el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.label"
-          :sortable="column.sortable ?'custom' : false" :width="column.width" :filters="column.filters"
-          :filter-method="column.filters?(value, row) =>  row[column.prop] === value:undefined"
-          :filtered-value="column.filteredValue?column.filteredValue:undefined"
-          :align="column.align ? column.align : 'center'" show-overflow-tooltip >
+          :sortable="column.sortable ? 'custom' : false" :width="column.width" :filters="column.filters"
+          :filter-method="column.filters ? (value, row) => row[column.prop] === value : undefined"
+          :filtered-value="column.filteredValue ? column.filteredValue : undefined"
+          :align="column.align ? column.align : 'center'" show-overflow-tooltip>
           <template #header>
             <slot name="search" :slotData="column"></slot>
           </template>
           <template #default="scope" v-if="column.component === 'customSlot'">
-            <slot name="customSlot" :data="scope.row"  :bodyCell="{ scope, column }"></slot>
-            <slot :name="column.prop" :data="scope.row"  :bodyCell="{ scope, column }"></slot>
+            <slot name="customSlot" :data="scope.row" :bodyCell="{ scope, column }"></slot>
+            <slot :name="column.prop" :data="scope.row" :bodyCell="{ scope, column }"></slot>
           </template>
           <template #default="scope" v-else>
             <RouterLink v-if="column.component === 'RouterLink'" :to="getRouterLinkTo(scope.row, column)"
@@ -84,7 +83,7 @@
                 v-if="typeof getDisplayText(scope.row, column) === 'string' && getDisplayText(scope.row, column).includes('\n')"
                 class="flex f-c ">
                 <span v-for="(line, index) in getDisplayText(scope.row, column).split('\n')" :key="index">{{ line
-                }}</span>
+                  }}</span>
               </div>
               <span v-else>
                 {{ getDisplayText(scope.row, column) }}
@@ -116,15 +115,15 @@ import type { TableInstance } from "element-plus";
 interface TableRow {
   [key: string]: any;
 }
-const emit = defineEmits(['getList', 'selectAllChange', 'selectionChange', 'currentChange','handleMouseEnter','handleMouseLeave']);
-interface Props{
+const emit = defineEmits(['getList', 'selectAllChange', 'selectionChange', 'currentChange', 'handleMouseEnter', 'handleMouseLeave']);
+interface Props {
   tableData: Array<TableRow>;
   columnwidth: number,//操作栏宽度
   secondaryTable?: boolean,//是否展示二级表格
   highlightCurrentRow?: boolean,//是否可点击
   showOperation?: boolean,//操作显示/隐藏
-  loading?:boolean,
-  showSummary?:boolean, //合计
+  loading?: boolean,
+  showSummary?: boolean, //合计
   columns: {
     prop: string;
     label: string;
@@ -167,14 +166,14 @@ interface RouterLink {
 const props = withDefaults(defineProps<Props>(), {
   showOperation: true, // 默认值为 true
 });
-const loading=ref(false)
+const loading = ref(false)
 const tableHeight = ref(props.tableheight); // 初始化表格高度
 const newSelectionList = ref<string[]>([]);
 const multipleTableRef = ref<TableInstance>();
 const TableData = ref<TableRow[]>();
 watch(props, () => {
-  if(props.loading!=undefined){
-    loading.value=props.loading;
+  if (props.loading != undefined) {
+    loading.value = props.loading;
 
   }
 })
@@ -186,7 +185,7 @@ onMounted(() => {
     counter: counter++
 
   }));
-  if(!props.tableheight) handleResize();
+  if (!props.tableheight) handleResize();
 });
 function handleResize() {
   // 获取当前窗口的高度
@@ -226,14 +225,14 @@ const selectAllChange = (value: any[]) => {
  * //单元格移入事件
  * @param row 行数据
  */
-const handleMouseEnter=(row:any)=>{
+const handleMouseEnter = (row: any) => {
   emit('handleMouseEnter', row)
 }
 /**
  * //单元格移出事件
  * @param row 行数据
  */
- const handleMouseLeave=(row:any)=>{
+const handleMouseLeave = (row: any) => {
   emit('handleMouseLeave', row)
 }
 //行点击事件
@@ -285,7 +284,7 @@ function htmlEvent(row: Row, column: any) {
 }
 </script>
 <style lang="scss" scoped>
-.el-table .el-table__cell .routerlick > a {
+.el-table .el-table__cell .routerlick>a {
   color: red;
 }
 

+ 54 - 55
src/views/quoteConfig/agreement/agreementDetails.vue

@@ -1,59 +1,58 @@
 <!-- 模板区域 -->
 <template>
   <div>
-    <PageMain>
-      <div class="headers">
-        <div class="flex f-c a-start">
-          <div class="flex j-s a-c" style="width: 100%;">
-            <span class="title">{{ agreementInfo.agreementTitle }}</span>
-            <div>
-              <el-button type="default" @click="agreementAuth">协议授权</el-button>
-              <el-button type="default" plain @click="agreementEdit">编辑</el-button>
-              <el-dropdown trigger="click" @command="dropdownCommand" style="margin-left: 10px;">
-                <el-button plain>
-                  更多 <el-icon class="el-icon--right">
-                    <CaretBottom />
-                  </el-icon></el-button>
-                <template #dropdown>
-                  <el-dropdown-menu>
-                    <el-dropdown-item command="启用" v-if="agreementInfo.isEnable == '1'">启用</el-dropdown-item>
-                    <el-dropdown-item command="禁用" v-else>禁用</el-dropdown-item>
-                    <el-dropdown-item command="删除">删除</el-dropdown-item>
-                    <el-dropdown-item command="复制协议">复制协议</el-dropdown-item>
-                  </el-dropdown-menu>
-                </template>
-              </el-dropdown>
+    <PageMain class="agreement vh100">
+      <el-tabs v-model="activeName" class="demo-tabs h-full">
+        <el-tab-pane label="协议信息" name="agreementInfo">
+          <div class="headers">
+            <div class="flex f-c a-start">
+              <div class="flex j-s a-c" style="width: 100%;">
+                <span class="title">{{ agreementInfo.agreementTitle }}</span>
+                <div>
+                  <el-button type="default" @click="agreementAuth">协议授权</el-button>
+                  <el-button type="default" plain @click="agreementEdit">编辑</el-button>
+                  <el-dropdown trigger="click" @command="dropdownCommand" style="margin-left: 10px;">
+                    <el-button plain>
+                      更多 <el-icon class="el-icon--right">
+                        <CaretBottom />
+                      </el-icon></el-button>
+                    <template #dropdown>
+                      <el-dropdown-menu>
+                        <el-dropdown-item command="启用" v-if="agreementInfo.isEnable == '1'">启用</el-dropdown-item>
+                        <el-dropdown-item command="禁用" v-else>禁用</el-dropdown-item>
+                        <el-dropdown-item command="删除">删除</el-dropdown-item>
+                        <el-dropdown-item command="复制协议">复制协议</el-dropdown-item>
+                      </el-dropdown-menu>
+                    </template>
+                  </el-dropdown>
+                </div>
+              </div>
+              <div style="margin-top: 10px;" class="flex">
+                <el-tag type="primary" style="margin-right: 20px;">{{
+                  getDict('is_enable').find(val => val.value == agreementInfo.isEnable)?.label}}</el-tag>
+                <el-tag type="success">{{getDict('valid_status').find(val => val.value ==
+                  agreementInfo.validStatus)?.label
+                  }}</el-tag>
+              </div>
             </div>
+            <el-descriptions :column="3" style="margin-top: 10px;">
+              <el-descriptions-item label="协议号:">{{ agreementInfo.agreementCode }}</el-descriptions-item>
+              <el-descriptions-item label="协议名称:">{{ agreementInfo.agreementTitle }}</el-descriptions-item>
+              <el-descriptions-item label="归属机构:">{{ agreementInfo.deptName }}</el-descriptions-item>
+              <el-descriptions-item label="授权机构数量:">{{ authDeptlength }}</el-descriptions-item>
+              <el-descriptions-item label="添加人:">
+                {{ agreementInfo.createBy }}
+              </el-descriptions-item>
+              <el-descriptions-item label="添加时间:">
+                {{ agreementInfo.createTime }}
+              </el-descriptions-item>
+            </el-descriptions>
           </div>
-          <div style="margin-top: 10px;" class="flex">
-            <el-tag type="primary" style="margin-right: 20px;">{{
-              getDict('is_enable').find(val => val.value == agreementInfo.isEnable)?.label}}</el-tag>
-            <el-tag type="success">{{getDict('valid_status').find(val => val.value == agreementInfo.validStatus)?.label
-              }}</el-tag>
-          </div>
-        </div>
-        <el-descriptions :column="3" style="margin-top: 10px;">
-          <el-descriptions-item label="协议号:">{{ agreementInfo.agreementCode }}</el-descriptions-item>
-          <el-descriptions-item label="协议名称:">{{ agreementInfo.agreementTitle }}</el-descriptions-item>
-          <el-descriptions-item label="归属机构:">{{ agreementInfo.deptName }}</el-descriptions-item>
-          <el-descriptions-item label="授权机构数量:">{{ authDeptlength }}</el-descriptions-item>
-          <el-descriptions-item label="添加人:">
-            {{ agreementInfo.createBy }}
-          </el-descriptions-item>
-          <el-descriptions-item label="添加时间:">
-            {{ agreementInfo.createTime }}
-          </el-descriptions-item>
-        </el-descriptions>
-      </div>
-    </PageMain>
-    <PageMain class="agreement ">
-      <el-tabs v-model="activeName" class="demo-tabs">
-        <el-tab-pane label="协议信息" name="agreementInfo">
           <el-descriptions title="基本信息" class="m-top-20" :column="3">
             <el-descriptions-item label="协议名称:">{{ agreementInfo.agreementTitle
-            }}</el-descriptions-item>
+              }}</el-descriptions-item>
             <el-descriptions-item label="协议简称:">{{ agreementInfo.agreementAbbreviation
-            }}</el-descriptions-item>
+              }}</el-descriptions-item>
             <el-descriptions-item label="协议生效时间:">{{ agreementInfo.startDate }}</el-descriptions-item>
             <el-descriptions-item label="协议失效时间:">{{ agreementInfo.endDate }}</el-descriptions-item>
             <el-descriptions-item label="是否含增值税结算:">
@@ -100,7 +99,7 @@
           </div>
 
         </el-tab-pane>
-        <el-tab-pane label="费用管理" name="costManagement">
+        <el-tab-pane label="费用管理" name="costManagement" class="overflow-y-auto h-full">
           <span class="strong m-right-20">规则与费用</span>
           <el-button type="primary" @click="addUnderwritingRule" plain>
             添加承保规则
@@ -117,7 +116,7 @@
                   <div class="flex a-c">
                     <img src="../../../assets/images/fee.png" alt="">
                     <span style="margin-right: 30px;font-size: 16px;" class="strong m-left-10">承保规则一{{ index + 1
-                      }}</span>
+                    }}</span>
                   </div>
                   <div class="flex">
                     <el-button link type="primary" :icon="CopyDocument" @click="handleCopy(item, {})">复制费用</el-button>
@@ -136,8 +135,8 @@
                       </el-icon></el-button>
                   </div>
                 </div>
-                <p class=" m-top-10" style="font-size: 14px;letter-spacing: 2px;">规则描述:{{ item.inputDescription }}</p>
-                <p class=" m-top-10" style="font-size: 14px;letter-spacing: 2px;">规则因子描述:{{ item.ruleDescription }}</p>
+                <div class=" m-t-10px" style="font-size: 14px;letter-spacing: 2px;">规则描述:{{ item.inputDescription }}</div>
+                <div class=" m-t-10px" style="font-size: 14px;letter-spacing: 2px;">规则因子描述:{{ item.ruleDescription }}</div>
               </div>
               <div class="header-content" v-if="item.ruleFeeShow">
                 <el-button plain type="primary" @click="ruleFeeAdd(item)" class="m-top-10 m-btn-10">添加费用
@@ -151,12 +150,12 @@
                   v-if="item.costVoList">
                   <el-tab-pane v-for="(costitem, costindex) in item.costVoList" :key="costindex"
                     :label="costitem.productName" :name="costitem.productName">
-                    <div class="flex justify-between items-center">
+                    <div class="flex justify-between items-center m-b-10px">
                       <div class="">
                         <span class="strong">{{ costitem.productName }}费用({{
                           showCostVoList(costitem.ptlAgreementCostVoList,
-                          item).length
-                          }}条)</span>
+                            item).length
+                        }}条)</span>
                         <el-button type="primary" link @click="handleUpdateValidDate()"> 批量设置有效期
                         </el-button>
                         <el-button type="primary" link @click="handleUpdateCostRatio()"> 批量设置比例