huangbin 4 年之前
父節點
當前提交
bd18783237

+ 6 - 3
src/views/platinum/platinum_agreement/compoments/detail/index.vue

@@ -18,11 +18,13 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
+import { defineComponent, PropType, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { Des, handleDesList } from '@/common/components/commonDes';
 import { QhjAgreementConfig } from '@/services/go/ermcp/qhj/interface';
 import { formatValue } from '@/common/methods';
+import { getAgreementTypeName } from '@/common/constants/enumsName';
+import { handleArgreementType } from '../../setup';
 
 export default defineComponent({
     name: 'custom-detail',
@@ -36,6 +38,7 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = closeModal('detail');
         const { desList, getDesList } = handleDesList();
+        const { getRateEnumName } = handleArgreementType();
         watchEffect(() => {
             if (visible.value) {
                 const data = props.selectedRow;
@@ -43,8 +46,8 @@ export default defineComponent({
                 const list = [
                     { label: '协议编号', value: formatValue(data.agreementno) },
                     { label: '协议名称', value: formatValue(data.agreementname) },
-                    { label: '协议类型', value: formatValue(data.agreementtype) },
-                    { label: '签署频率', value: formatValue(data.agreementfrequency) },
+                    { label: '协议类型', value: getAgreementTypeName(data.agreementtype) },
+                    { label: '签署频率', value: getRateEnumName(data.agreementfrequency) },
                     { label: '内容', value: formatValue(data.agreementcontent), className: 'blue' },
                 ];
                 getDesList(list);

+ 6 - 1
src/views/platinum/platinum_agreement/list/tab/index.vue

@@ -22,6 +22,9 @@
         <template #agreementtype="{ record }">
           <span>{{ getAgreementTypeName(record.agreementtype) }}</span>
         </template>
+        <template #agreementfrequency="{ record }">
+          <span>{{ getRateEnumName(record.agreementfrequency) }}</span>
+        </template>
       </a-table>
     </contextMenu>
     <ControlModal :selectedRow="selectedRow"
@@ -36,6 +39,7 @@ import { QhjAgreementConfig } from '@/services/go/ermcp/qhj/interface';
 import Filter from '../../compoments/filter/index.vue';
 import ControlModal from '../../compoments/controlModal/index.vue';
 import { getAgreementTypeName } from '@/common/constants/enumsName';
+import { handleArgreementType } from '../../setup';
 
 export default defineComponent({
     name: 'platinum_agreement_tab',
@@ -49,7 +53,7 @@ export default defineComponent({
         const [firstBtn, secondBtn] = _getBtnList('platinum_agreement_tab', true).value;
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<QhjAgreementConfig>();
-
+        const { getRateEnumName } = handleArgreementType();
         function getData() {
             // 获取列表数据
             queryTable(queryAgreementConfig);
@@ -70,6 +74,7 @@ export default defineComponent({
             selectedRow,
             Rowclick,
             updateColumn,
+            getRateEnumName,
             firstBtn,
             loading,
             tableList,

+ 17 - 1
src/views/platinum/platinum_agreement/setup.ts

@@ -18,5 +18,21 @@ export function handleArgreementType(formState?: UnwrapRef<FormState>) {
         // 协议类型为其它类型时,签署频率为首次;
         return formState?.agreementtype === AgreementType.login ? '每次' : '首次';
     }
-    return { getAgreementTypeList, getRate }
+
+    // 获取 签署频率 名
+    function getRateEnumName(type: number) {
+        //  agreementfrequency	:number;//协议频率 - 1:首次 2:每次 [登录为2, 其它为1]
+        let result = '--'
+        switch (type) {
+            case 1:
+                result = '首次'
+                break;
+            case 2:
+                result = '每次'
+                break;
+        }
+        return result;
+    }
+
+    return { getAgreementTypeList, getRate, getRateEnumName }
 }