snow 1 year ago
parent
commit
737ebe6f83

+ 9 - 3
src/api/InvoiceSales/currentcyOrderRecord/index.ts

@@ -11,17 +11,23 @@ interface ResponseType extends Promise<any> {
   data?: any
 }
 
-//列表
+
+// 列表
 export const httpList = (data: any): ResponseType => {
   return http.request('post', `${baseUrl}paylist`, { data })
 }
 
-//详情
+// 创建
+export const httpCreate = (data: any) => {
+  return http.request('post', `${baseUrl}payadd`, { data })
+}
+
+// 详情
 export const httpDetail = (data: any): ResponseType => {
   return http.request('post', `${baseUrl}tradeloginfo`, { data })
 }
 
-//审核状态
+// 审核状态
 export const httpStatus = (data: any): ResponseType => {
   return http.request('post', `${baseUrl}orderpaystatus`, { data })
 }

+ 4 - 19
src/components/PageContent/src/actions/action-status.tsx

@@ -1,7 +1,7 @@
 import { defineComponent } from "vue";
 import { actionProps } from "../types";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
-import { useAsync, useResponseHandle } from "/@/hooks/core/useAsync";
+import { useAsync } from "/@/hooks/core/useAsync";
 
 const ActionStatus = defineComponent({
   name: "ActionDelete",
@@ -20,33 +20,18 @@ const ActionStatus = defineComponent({
   },
   emits: ["reload"],
   setup(props, { emit }) {
-    const responseHandle = useResponseHandle();
-
     const { run } = useAsync({ success: () => emit('reload') });
 
     async function handleStatus() {
-      const { config, row, isRequesetArray, statusRowProp } = props;
+      const { config, row, isRequestArray: iqa, statusRowProp } = props;
       const { status: rawStatus, id } = row;
-
       const status = String(rawStatus) === "1" ? "0" : "1";
 
       run(config.api({
-        ...(props.prop
-          ? {[props.prop] :row[props.prop]})
-      }))
-      const { code, message } = await config.api({
-        ...(props.prop
-          ? { [props.prop]: row[props.prop] }
-          : { id: isRequesetArray ? [id] : id }),
+        ...(props.prop ? { [props.prop]: row[props.prop] } : { id: iqa ? [id] : id }),
         ...(statusRowProp ? statusRowProp(row) : {}),
         status
-      });
-
-      responseHandle({
-        code,
-        message,
-        handler: () => emit("reload")
-      });
+      }));
     }
 
     return () => (

+ 2 - 2
src/components/PageContent/src/hooks/use-request.ts

@@ -10,14 +10,14 @@ import { useNav } from "/@/layout/hooks/nav";
 import { useParams } from "./use-params";
 import { useUserInfo } from "/@/hooks/core/useUser";
 
-export function useRequeset(props: PageContentProps) {
+export function useRequest(props: PageContentProps) {
   const { contentConfig } = props;
   const { mockData, notNeedCompanyFilter } = contentConfig;
 
   const { logout } = useNav();
   const loading = ref(false);
   const dataList = ref(mockData ? mockData : []);
-  const initRequest = ref(!props.contentConfig.notReuqiredInit);
+  const initRequest = ref(!props.contentConfig.notRequiredInit);
 
   const { currentCompany } = useCompany();
   const { isSuperUser } = useUserInfo();

+ 12 - 13
src/components/PageContent/src/page-content.tsx

@@ -7,7 +7,7 @@ import { TableProBar } from "../../ReTable";
 import { onBeforeRouteLeave } from "vue-router";
 import { useColumns } from "./hooks/use-columns";
 import { useActions } from "./hooks/use-actions";
-import { useRequeset } from "./hooks/use-request";
+import { useRequest } from "./hooks/use-request";
 import { useSelection } from "./hooks/use-selection";
 import { useRenderIcon } from "../../ReIcon/src/hooks";
 import { createActionProps } from "./utils/create-operation";
@@ -28,7 +28,9 @@ import {
 
 const PageContent = defineComponent({
   name: "PageContent",
+
   props: pageContentProps,
+
   emits: [
     "createBtnClick",
     "updateBtnClick",
@@ -53,7 +55,7 @@ const PageContent = defineComponent({
       getPagination,
       onBeforeAction,
       paginationConfig
-    } = useRequeset(props);
+    } = useRequest(props);
 
     const { selects } = useSelection();
     const { action } = useActions(props.contentConfig);
@@ -85,13 +87,12 @@ const PageContent = defineComponent({
         showPreview,
         showPayTagFn,
         showReturnTagFn,
-        isRequesetArray,
+        isRequestArray,
         superUserNoAction,
         superUserNoPerview,
       } = contentConfig;
 
       const view = showPreview ? showPreview(row) : true;
-
       const del = showDelete ? showDelete(row) : true;
 
       const noAction =
@@ -101,7 +102,7 @@ const PageContent = defineComponent({
         (superUserNoPerview && !isSuperUser.value) || !superUserNoPerview;
 
       const showPay = showPayTagFn ? showPayTagFn(row, powers) : true;
-      const showRerturn = showReturnTagFn ? showReturnTagFn(row, powers) : true;
+      const showReturn = showReturnTagFn ? showReturnTagFn(row, powers) : true;
 
       const _showStatus = showStatus
         ? showStatus(isSuperUser.value)
@@ -121,7 +122,7 @@ const PageContent = defineComponent({
 
           {slots.custom && slots.custom(row)}
 
-          {returnProps && noAction && showRerturn && (
+          {returnProps && noAction && showReturn && (
             <Operation.Tag
               row={row}
               tagProps={returnProps}
@@ -151,7 +152,7 @@ const PageContent = defineComponent({
               prop={contentConfig.statusProp}
               statusRowProp={contentConfig.statusRowProp}
               onReload={() => onSearch()}
-              isRequesetArray={isRequesetArray}
+              isRequestArray={isRequestArray}
               {...createActionProps("status", apis)}
             />
           )}
@@ -216,7 +217,7 @@ const PageContent = defineComponent({
 
     const renderExpand = (row) => slots.expand && slots.expand(row)
 
-    function renderFilterColumnns() {
+    function renderFilterColumns() {
       return (
         <div class="filter-columns__content">
           <div class="filter-columns_reset">
@@ -292,9 +293,7 @@ const PageContent = defineComponent({
           data={dataList.value}
           checkList={checkList}
           maxHeight={ maxHeight ? maxHeight : '660px'}
-          paginationSmall={
-            size === "small" ? true : false
-          }
+          paginationSmall={size === "small" ? true : false}
           rowClassName={tableRowClassName}
           headerCellStyle={{ background: "#fafafa", color: "#606266" }}
           onSelectionChange={handleSelection}
@@ -321,7 +320,7 @@ const PageContent = defineComponent({
 
       return (
         <TableProBar
-          tableRef={tableRef.value?.getTableRef()}
+          tableRef={(tableRef.value as any)?.getTableRef()}
           title={title}
           showTitle={showTitle}
           dataList={dataList.value}
@@ -330,7 +329,7 @@ const PageContent = defineComponent({
           custom
           v-slots={{
             buttons: () => renderButtons(),
-            toolbar: () => renderFilterColumnns(),
+            toolbar: () => renderFilterColumns(),
             default: ({ size, checkList }) => renderPureTable(size, checkList)
           }}
         />

+ 6 - 4
src/components/PageContent/src/types.ts

@@ -5,12 +5,14 @@ import PageContent from "./page-content";
  * @param title 标题
  * @param apis 请求
  * @param columns 列数据
- * @param notReuqiredInit 首次加载是否需要请求列表
+ * @param notRequiredInit 首次加载是否需要请求列表
  * @param notPagination 不需要分页器
  * @param mockData 模拟数据
  * @param isTree 是否为tree
  * @param powers 功能权限
  * @param treeProps
+ * @param rowKey
+ * @param mockData 模拟数据
  */
 export interface ContentConfig {
   title: string;
@@ -18,7 +20,7 @@ export interface ContentConfig {
   showTitle?: boolean;
   apis: ContentApis | any;
   columns: any;
-  notReuqiredInit?: boolean;
+  notRequiredInit?: boolean;
   notPagination?: boolean;
   notPreview?: boolean;
   statusProp?: string;
@@ -31,7 +33,7 @@ export interface ContentConfig {
   returnProps?: Record<string, string>;
   delTooltip?: string;
   inv?: boolean;
-  isRequesetArray?: boolean;
+  isRequestArray?: boolean;
   openStatus?: string;
   stopStatus?: string;
   notNeedCompanyFilter?: boolean;
@@ -108,7 +110,7 @@ export const actionProps = {
   config: {
     type: Object as PropType<{ api: API }>
   },
-  isRequesetArray: {
+  isRequestArray: {
     type: Boolean
   },
   statusConfig: {

+ 8 - 6
src/views/InvoiceSales/currentcyOrderRecord/detail.vue

@@ -4,16 +4,20 @@ import { useDetail } from "/@/hooks/core/useDetail";
 import { usePermission } from "/@/hooks/core/usePermission";
 import ReconciliationForm from "/@/components/ReconciliationForm";
 import { DefaultApprovalNode } from "/@/components/ApprovalNode";
+import { httpCreate,httpStatus  } from "/@/api/InvoiceSales/currentcyOrderRecord";
 import { useAsync } from '/@/hooks/core/useAsync';
+import { useRouter } from 'vue-router';
 
 const pageName = "currentcyOrderRecordDetail"
 
+const { push } = useRouter();
+
 const { run: approval } = useAsync({
   success: () => { }
 });
 
 const { run: create } = useAsync({
-  success: () => { }
+  success: () => push('/InvoiceSales/currentcyOrderRecord')
 })
 
 
@@ -23,25 +27,23 @@ const { id, title, isDetail, collapses } = useDetail({
 });
 
 const loading = shallowRef(false);
-
 const { hasPermissionWithCode } = usePermission(pageName);
-const handleCreate = (data:Record<string,any>) => create();
-const handleApproval = (data: Record<string, any>) => approval();
+const handleCreate = (data:Record<string,any>) => create(httpCreate(data));
+const handleApproval = (data: Record<string, any>) => approval(httpStatus(data));
 </script>
 
-
 <template>
   <div class="padding__container">
     <ElTabs>
       <ElTabPane :label="title">
         <ElCollapse v-model="collapses">
           <ElCollapseItem name="1" :title="title">
-              <!-- @create="handleCreate" -->
             <ReconciliationForm
               :id="id"
               ref="formRef"
               :loading="loading"
               :readonly="isDetail"
+              @create="handleCreate"
               isPurch
             />
           </ElCollapseItem>  

+ 0 - 2
src/views/InvoiceSales/currentcyOrderRecord/index.vue

@@ -8,8 +8,6 @@ import { usePermission } from "/@/hooks/core/usePermission";
 const pageName = "currentcyOrderRecord";
 
 const { push } = useRouter();
-
-
 const { hasPermissionWithCode } = usePermission(pageName);
 
 const hooks: PageHooks = {

+ 1 - 1
src/views/interest/company/config/content.config.ts

@@ -91,7 +91,7 @@ const contentConfig: ContentConfig = {
   title: "数据共享",
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
   columns,
-  isRequesetArray: true,
+  isRequestArray: true,
   apis: {
     httpList,
     httpStatus,

+ 1 - 1
src/views/interest/userGroup/config/content.config.ts

@@ -76,7 +76,7 @@ const columns = [
 const contentConfig: ContentConfig = {
   title: "用户组",
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
-  isRequesetArray: true,
+  isRequestArray: true,
   columns,
   apis: {
     httpList,

+ 1 - 1
src/views/parameter/setActionProcess/config/content.config.ts

@@ -111,7 +111,7 @@ const contentConfig: ContentConfig = {
   title: "流程节点设置",
   notNeedCompanyFilter: true,
   columns,
-  notReuqiredInit: true,
+  notRequiredInit: true,
   apis: {
     httpAdd,
     httpList,

+ 1 - 1
src/views/system/setBtn/config/content.config.ts

@@ -64,7 +64,7 @@ const columns = [
 const contentConfig: ContentConfig = {
   title: "按钮设置",
   columns,
-  notReuqiredInit: true,
+  notRequiredInit: true,
   notNeedCompanyFilter: true,
   apis: {
     httpList,