Parcourir la source

修改客户资料新增

huangbin il y a 4 ans
Parent
commit
d0bfbed721

+ 1 - 1
src/views/information/custom/compoments/addCustom/index.vue

@@ -147,7 +147,7 @@
               </a-select-option>
               <a-select-option value="2">
                 客户二
-              </a-select-optio@/common/methods
+              </a-select-option>
             </a-select>
             <a-select class="inlineFormSelect"
                       style="width: 205px"

+ 94 - 81
src/views/information/custom/list/normal-use/index.vue

@@ -1,97 +1,110 @@
 <template>
-    <!-- 客户信息: 正常 -->
-    <div class="custom-normal" :loading="loading">
-        <filterCustomTable @search="search">
-            <a-button class="operBtn" v-if="hasPermission('custom_info_btn_add')" @click="openAction">新增</a-button>
-        </filterCustomTable>
-        <contextMenu :contextMenuList="contextMenuList" :tableList="customList">
-            <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :data-source="customList">
-                <template #userinfotype="{ text }">
-                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
-                </template>
-            </a-table>
-        </contextMenu>
-        <!-- 详情 -->
-        <CustomDetail />
-        <!-- 修改 -->
-        <ModifyCustom />
-        <!-- 停用 -->@/common/methods
-        <DisableCustom />
-    </div>
+  <!-- 客户信息: 正常 -->
+  <div class="custom-normal"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-if="hasPermission('custom_info_btn_add')"
+                @click="openAction">新增</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="contextMenuList"
+                 :tableList="customList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="customList">
+        <template #userinfotype="{ text }">
+          <a>{{ text === '2' ? '企业' : '个人' }}</a>
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- 新增 -->
+    <AddCustom />
+    <!-- 详情 -->
+    <CustomDetail />
+    <!-- 修改 -->
+    <ModifyCustom />
+    <!-- 停用 -->
+    <DisableCustom />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
+import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
 
-    import { initData } from '@/common/methods/index';
-    import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
-    import { MenuItem } from '@/common/components/contextMenu/interface';
-    import contextMenu from '@/common/components/contextMenu/index.vue';
-    import { getCustomList } from '../setup';
-    import { openModal } from '@/common/setup/modal/index';
-    import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
-    import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
-    import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
+import { initData } from '@/common/methods/index';
+import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
+import { MenuItem } from '@/common/components/contextMenu/interface';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import { getCustomList } from '../setup';
+import { openModal } from '@/common/setup/modal/index';
+import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
+import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
+import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
+import AddCustom from '@/views/information/custom/compoments/addCustom/index.vue';
 
-    // 处理详情
-    function handleDetail(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('customDetail');
-        contextMenuList.value.push({ lable: '详情', callback: openAction });
-    }
-    // 处理修改
-    function handleModify(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('modifyCustomInfo');
-        function modifyAction() {
-            contextMenuList.value.push({ lable: '修改', callback: openAction });
-        }
-        return { modifyAction };
+// 处理详情
+function handleDetail(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('customDetail');
+    contextMenuList.value.push({ lable: '详情', callback: openAction });
+}
+// 处理修改
+function handleModify(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('modifyCustomInfo');
+    function modifyAction() {
+        contextMenuList.value.push({ lable: '修改', callback: openAction });
     }
+    return { modifyAction };
+}
 
-    // 处理停用
-    function handleDisable(contextMenuList: Ref<MenuItem[]>) {
-        const { openAction } = openModal('disableCustomInfo');
-        function disableAction() {
-            contextMenuList.value.push({ lable: '停用', callback: openAction });
-        }
-        return { disableAction };
+// 处理停用
+function handleDisable(contextMenuList: Ref<MenuItem[]>) {
+    const { openAction } = openModal('disableCustomInfo');
+    function disableAction() {
+        contextMenuList.value.push({ lable: '停用', callback: openAction });
     }
-    export default defineComponent({
-        name: 'custom-normal',
-        components: {
-            filterCustomTable,
-            contextMenu,
-            CustomDetail,
-            ModifyCustom,
-            DisableCustom,
-        },
-        setup() {
-            const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
-            const { hasPermission } = handlePermission('custom_info_normal');
-            const contextMenuList = ref<MenuItem[]>([]);
+    return { disableAction };
+}
+export default defineComponent({
+    name: 'custom-normal',
+    components: {
+        filterCustomTable,
+        contextMenu,
+        CustomDetail,
+        ModifyCustom,
+        DisableCustom,
+        AddCustom,
+    },
+    setup() {
+        const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
+        const { hasPermission } = handlePermission('custom_info_normal');
+        const contextMenuList = ref<MenuItem[]>([]);
 
-            const { openAction } = openModal('addCustomInfo');
+        const { openAction } = openModal('addCustomInfo');
 
-            handleDetail(contextMenuList);
-            const { modifyAction } = handleModify(contextMenuList);
-            const { disableAction } = handleDisable(contextMenuList);
+        handleDetail(contextMenuList);
+        const { modifyAction } = handleModify(contextMenuList);
+        const { disableAction } = handleDisable(contextMenuList);
 
-            const stop = watchEffect(() => {
-                hasPermission('custom_info_btn_modify') && modifyAction();
-                hasPermission('custom_info_btn_disable') && disableAction();
-            });
-            onUnmounted(() => {
-                stop();
-            });
-            initData(() => {
-                actionQuery(3);
-                getColumns();
-            });
-            return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
-        },
-    });
+        const stop = watchEffect(() => {
+            hasPermission('custom_info_btn_modify') && modifyAction();
+            hasPermission('custom_info_btn_disable') && disableAction();
+        });
+        onUnmounted(() => {
+            stop();
+        });
+        initData(() => {
+            actionQuery(3);
+            getColumns();
+        });
+        return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
+    },
+});
 </script>
 
 <style lang="less">
-    .custom-normal {
-    }</style
+.custom-normal {
+}
+</style
 >;