瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/platinum/platinum_agreement/compoments/add/index.vue
yu jie 4 年之前
父節點
當前提交
5d9e84d349

+ 4 - 7
src/views/platinum/platinum_agreement/compoments/add/index.vue

@@ -89,6 +89,7 @@ import {addCustomerInfoOperate} from "@/services/proto/accountinfo";
 import {agreementConfigOperate} from "@/services/proto/manager";
 import {QHJAgreementConfigOperateReq} from "@/services/proto/manager/interface";
 import {getUserId} from "@/services/bus/account";
+import { handleArgreementType } from '@/views/platinum/platinum_agreement/setup';
 
 export default defineComponent({
     name: 'add-custom',
@@ -99,12 +100,8 @@ export default defineComponent({
         // 表单
         const { formRef, formState, rules } = handleForm();
         // 协议类型
-        const agreementTypeList = getAgreementTypeList();
-        function getRate() {
-            // 协议类型为登录时,签署频率为每次;
-            // 协议类型为其它类型时,签署频率为首次;
-            return formState.agreementtype === AgreementType.login ? '每次' : '首次';
-        }
+        const { getAgreementTypeList, getRate } = handleArgreementType(formState);
+
         const loading = ref<boolean>(false);
 
         function submit(OperateType: 1 | 2) {
@@ -126,7 +123,7 @@ export default defineComponent({
         }
 
         return {
-            agreementTypeList,
+            agreementTypeList: getAgreementTypeList(),
             getRate,
             formState,
             rules,

+ 2 - 1
src/views/platinum/platinum_agreement/compoments/filter/index.vue

@@ -13,13 +13,14 @@ import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent, ref } from 'vue';
 import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
 import { Moment } from 'moment';
-import { getAgreementTypeList } from '@/views/platinum/platinum_agreement/setup';
+import { handleArgreementType } from '@/views/platinum/platinum_agreement/setup';
 
 export default defineComponent({
     name: 'filter-platinum_pick_query',
     components: { FilterOption },
     setup(props, context) {
         const date = ref<Moment>();
+        const { getAgreementTypeList } = handleArgreementType();
         const select = ref<SelectList[]>([
             {
                 value: undefined,

+ 15 - 29
src/views/platinum/platinum_agreement/compoments/modify/index.vue

@@ -20,12 +20,8 @@
             :rules="rules">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="协议编号"
-                       name="agreementno">
-            <a-input class="dialogInput"
-                     v-model:value="formState.agreementno"
-                     style="width: 200px"
-                     placeholder="请输入协议编号" />
+          <a-form-item label="协议编号">
+            <span class="white">{{formState.agreementno}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -38,37 +34,24 @@
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="协议类型"
-                       name="agreementtype">
-            <a-select class="typeSelect"
-                      style="width: 200px"
-                      v-model:value="formState.agreementtype"
-                      placeholder="请选择协议类型">
-              <a-select-option v-for="item in userinfotypeList"
-                               :value="item.key"
-                               :key="item.key">
-                {{item.name}}
-              </a-select-option>
-            </a-select>
+          <a-form-item label="协议类型">
+            <span class="white">{{formState.agreementtype}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="签署频率"
                        name="agreementname">
-            <a-input class="dialogInput"
-                     v-model:value="formState.agreementname"
-                     readonly
-                     style="width: 200px"
-                     placeholder="" />
+            <span class="white">{{getRate()}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="24">
           <a-form-item label="协议内容"
                        name="agreementcontent">
-            <a-input class="dialogInput"
-                     style="width: 635px"
-                     v-model:value="formState.agreementcontent"
-                     placeholder="请输入协议内容" />
+            <a-textarea class="dialogInput"
+                        v-model:value="formState.agreementcontent"
+                        style="width: 635px"
+                        placeholder="请输入协议内容"
+                        :autosize="{ minRows: 8, maxRows: 24 }" />
           </a-form-item>
         </a-col>
       </a-row>
@@ -84,6 +67,7 @@ import { FormState } from '../add/interface';
 import { mergeTwoObj } from '@/utils/objHandle';
 import { validateAction } from '@/common/setup/form';
 import { QhjAgreementConfig } from '@/services/go/ermcp/qhj/interface';
+import { handleArgreementType } from '../../setup';
 
 export default defineComponent({
     name: 'modify-custom',
@@ -100,13 +84,14 @@ export default defineComponent({
         const loading = ref<boolean>(false);
 
         const { formRef, formState, rules } = handleForm();
-
+        // 协议类型
+        const { getRate } = handleArgreementType(formState);
         watchEffect(() => {
             if (visible.value) {
                 mergeTwoObj(formState, props.selectedRow);
             }
         });
-        function submit(OperateType: 1 | 2) {
+        function submit() {
             validateAction<FormState>(formRef, formState).then((param) => {
                 // const reqParam: QHJAgreementConfigOperateReq = {};
                 // requestResultLoadingAndInfo(agreementConfigOperate, reqParam, loading, ['新增协议成功', '新增协议失败:']).then(() => {
@@ -116,6 +101,7 @@ export default defineComponent({
             });
         }
         return {
+            getRate,
             formState,
             rules,
             formRef,

+ 18 - 6
src/views/platinum/platinum_agreement/setup.ts

@@ -1,10 +1,22 @@
 import { AgreementType } from "@/common/constants/enumCommon";
 import { getAgreementTypeName } from "@/common/constants/enumsName";
+import { UnwrapRef } from "@vue/reactivity";
+import { FormState } from "./compoments/add/interface";
 
-export function getAgreementTypeList() {
-    return [
-        { value: AgreementType.register, lable: getAgreementTypeName(AgreementType.register) },
-        { value: AgreementType.login, lable: getAgreementTypeName(AgreementType.login) },
-        { value: AgreementType.trade, lable: getAgreementTypeName(AgreementType.trade) },
-    ]
+export function handleArgreementType(formState?: UnwrapRef<FormState>) {
+    // 获取协议类型列表
+    function getAgreementTypeList() {
+        return [
+            { value: AgreementType.register, lable: getAgreementTypeName(AgreementType.register) },
+            { value: AgreementType.login, lable: getAgreementTypeName(AgreementType.login) },
+            { value: AgreementType.trade, lable: getAgreementTypeName(AgreementType.trade) },
+        ]
+    }
+    // 签署频率
+    function getRate() {
+        // 协议类型为登录时,签署频率为每次;
+        // 协议类型为其它类型时,签署频率为首次;
+        return formState?.agreementtype === AgreementType.login ? '每次' : '首次';
+    }
+    return { getAgreementTypeList, getRate }
 }