snow 1 year ago
parent
commit
8bdf64d1bf

+ 7 - 6
.env.development

@@ -16,18 +16,16 @@ VITE_APP_ID = "ww6076e6fd4268ee31"
 # 微信开发环境基础重定向url
 REDIRECT_BASE_URL = "http://cxinv.api.caixiao365.com"
 # 开发环境后端用户地址
-VITE_PROXY_USER_REAL1 = "http://user.api.caixiao365.com"
+VITE_PROXY_USER_REAL1 = "http://user.test241.wanyuhengtong.com"
 # 开发环境后端用户地址
-VITE_PROXY_USER_REAL = "http://cxinv.api.caixiao365.com"
+VITE_PROXY_USER_REAL = "http://stockinv.test241.wanyuhengtong.com"
 # 开发环境后端业务地址
-VITE_PROXY_DOMAIN_REAL = "http://cxinv.api.caixiao365.com"
+VITE_PROXY_DOMAIN_REAL = "http://stockinv.test241.wanyuhengtong.com"
 
 VITE_IS_PROD = true
 
-# 跳转采销地址
+# 跳转结算地址
 VITE_PURCHASE_URL = 'http://pin.caixiao365.com/'
-# 跳转工单地址
-VITE_GD_URL = 'http://bug.caixiao365.com/'
 
 # 报表地址
 VITE_DASHBOARD_URL = 'http://web.report.caixiao365.com/'
@@ -35,3 +33,6 @@ VITE_DASHBOARD_URL = 'http://web.report.caixiao365.com/'
 # token密钥
 VITE_SECRET_KEY = 'key123'
 
+
+# 跳转工单地址
+VITE_GD_URL = 'http://bug.caixiao365.com/'

+ 11 - 38
src/components/PageContainer/src/page-container.tsx

@@ -1,47 +1,20 @@
 import { defineComponent, inject, ref, watch, unref } from "vue";
-import { FormConfig, PageSearch } from "../../PageSearch";
-import type { Events, Hooks } from "./types";
+import { PageContent } from "/@/components/PageContent";
+import { PageSearch } from "../../PageSearch";
+import { type Hooks, props } from "./types";
 
-import { type ModalConfig, PageModal } from "../../PageModal";
-
-import {
-  PageContent,
-  type ContentConfig,
-  type PageContentInstance
-} from "/@/components/PageContent";
+import { PageModal } from "../../PageModal";
+import { any } from "vue-types";
 
 const PageContainer = defineComponent({
   name: "PageContainer",
-  props: {
-    pageName: {
-      type: String,
-      default: ""
-    },
-    contentConfig: {
-      type: Object as PropType<ContentConfig>
-    },
-    searchConfig: {
-      type: Object as PropType<FormConfig>
-    },
-    modalConfig: {
-      type: Object as PropType<ModalConfig>
-    },
-    getContentRef: {
-      type: Function as PropType<(ref: PageContentInstance) => any>
-    },
-    getModalRef: {
-      type: Function as PropType<(ref: PageContentInstance) => any>
-    },
-    hooks: {
-      type: Object as PropType<Hooks>,
-      default: () => ({})
-    },
-    events: {
-      type: Object as PropType<Events>,
-      default: () => ({})
-    }
+
+  props: props,
+
+  emits: {
+    "content-select-change": (value: any) => any
   },
-  emits: ["content-select-change"],
+
   setup(props, { slots, emit, expose }) {
     const { pageSearchHook, pageModalHook } = props.hooks as Hooks;
     const search = pageSearchHook ? pageSearchHook() : ({} as any);

+ 33 - 1
src/components/PageContainer/src/types.ts

@@ -1,4 +1,6 @@
-import { PageContentInstance } from "../../PageContent";
+import { ContentConfig, PageContentInstance } from "../../PageContent";
+import { ModalConfig } from "../../PageModal";
+import { FormConfig } from "../../PageSearch";
 import PageContainer from "./page-container";
 
 export type Hooks = {
@@ -16,6 +18,36 @@ export type Events = {
   };
 };
 
+export const props = {
+  pageName: {
+    type: String,
+    default: ""
+  },
+  contentConfig: {
+    type: Object as PropType<ContentConfig>
+  },
+  searchConfig: {
+    type: Object as PropType<FormConfig>
+  },
+  modalConfig: {
+    type: Object as PropType<ModalConfig>
+  },
+  getContentRef: {
+    type: Function as PropType<(ref: PageContentInstance) => any>
+  },
+  getModalRef: {
+    type: Function as PropType<(ref: PageContentInstance) => any>
+  },
+  hooks: {
+    type: Object as PropType<Hooks>,
+    default: () => ({})
+  },
+  events: {
+    type: Object as PropType<Events>,
+    default: () => ({})
+  }
+}
+
 export type PageContainerInstance = InstanceType<typeof PageContainer> & {
   content: PageContentInstance;
 };

+ 22 - 30
src/components/PageContent/src/actions/action-delete.tsx

@@ -1,7 +1,7 @@
 import { defineComponent } from "vue";
 import { actionProps } from "../types";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
-import { useResponseHandle } from "/@/hooks/core/useAsync";
+import { useAsync } from "/@/hooks/core/useAsync";
 
 const ActionDelete = defineComponent({
   name: "ActionDelete",
@@ -20,39 +20,31 @@ const ActionDelete = defineComponent({
   },
   emits: ["reload"],
   setup(props, { emit }) {
-    const responseHandle = useResponseHandle();
+    const { run } = useAsync({ success: () => emit('reload') });
 
-    async function handleDelete() {
+    return () => {
       const { config, row, prop } = props;
-      const { code, message } = await config.api({
-        ...(prop ? { [prop]: row[prop] } : { id: row.id })
-      });
+      const { api } = config;
 
-      responseHandle({
-        code,
-        message,
-        handler: () => emit("reload")
-      });
+      return (
+        <el-popconfirm
+          title={props.delTooltip || "是否确认删除"}
+          placement="top"
+          onConfirm={() => run(api({ ...(prop ? { [prop]: row[prop] } : { id: row.id }) }))}
+          v-slots={{
+            reference: () => (
+              <el-button
+                class="reset-margin"
+                link
+                size="small"
+                type="primary"
+                icon={useRenderIcon("delete")}
+              />
+            )
+          }}
+        />
+      )
     }
-
-    return () => (
-      <el-popconfirm
-        title={props.delTooltip || "是否确认删除"}
-        placement="top"
-        onConfirm={handleDelete}
-        v-slots={{
-          reference: () => (
-            <el-button
-              class="reset-margin"
-              link
-              size="small"
-              type="primary"
-              icon={useRenderIcon("delete")}
-            />
-          )
-        }}
-      />
-    );
   }
 });
 

+ 9 - 2
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 { useResponseHandle } from "/@/hooks/core/useAsync";
+import { useAsync, useResponseHandle } from "/@/hooks/core/useAsync";
 
 const ActionStatus = defineComponent({
   name: "ActionDelete",
@@ -22,11 +22,18 @@ const ActionStatus = defineComponent({
   setup(props, { emit }) {
     const responseHandle = useResponseHandle();
 
+    const { run } = useAsync({ success: () => emit('reload') });
+
     async function handleStatus() {
       const { config, row, isRequesetArray, 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] }
@@ -44,7 +51,7 @@ const ActionStatus = defineComponent({
 
     return () => (
       <el-popconfirm
-        title={String(props.row.status) === "1" ? "改为禁用" : "改为启用?"}
+        title={String(props.row.status) === "1" ? "改为禁用?" : "改为启用?"}
         onConfirm={handleStatus}
         v-slots={{
           reference: () => (

+ 1 - 1
src/components/PageContent/src/types.ts

@@ -14,7 +14,7 @@ import PageContent from "./page-content";
  */
 export interface ContentConfig {
   title: string;
-  maxHeight: string;
+  maxHeight?: string;
   showTitle?: boolean;
   apis: ContentApis | any;
   columns: any;

+ 6 - 6
src/hooks/core/useAsync.ts

@@ -57,16 +57,16 @@ export function useAsync<D = any>({
     setloading(true);
     return promise.then(response => {
       setloading(false);
-      const { code: _code, message, data } = response;
-      if (String(_code) !== "0") isError.value = true;
+      if (Number(response.code) !== 0) isError.value = true;
+
       responseHandle({
-        code: _code,
-        message,
+        code: response.code,
+        message: response.message,
         handler: () => {
-          setData(isList ? (data as any).list : data);
+          setData(isList ? (response.data as any).list : response.data);
           isError.value = false;
           if (pagination) pagination.total = (data as any).count;
-          success && success(unref(data));
+          success && success(unref(response.data));
         }
       });
     });

+ 1 - 1
src/utils/details/_purchase/porder.ts

@@ -21,7 +21,7 @@ export const PURCHASE_STATUS = [
   },
   {
     value: "1",
-    label: "对账"
+    label: "对账"
   }
 ];
 

+ 30 - 12
src/views/InvoiceSales/currentcyAssOrderRecord/config/content.config.ts

@@ -1,12 +1,7 @@
 import { ContentConfig } from "/@/components/PageContent";
 import { httpList } from "/@/api/InvoiceSales/capitalPool";
-
-// {
-//   label: '卖出方公司',
-//     prop: 'supplierName',
-//       minWidth: 175,
-//     ...renderIconLabelLeft('supplierNo', 'supplierName', '卖出方公司编码:')
-// },
+import { renderIconLabelLeft, renderProp } from "/@/utils/columnRenderHelper";
+import { PURCHASE_STATUS } from "/@/utils/details/_purchase/porder";
 
 const columns = [
   {
@@ -27,13 +22,36 @@ const columns = [
   },
   {
     label: '卖出方公司',
-
+    prop: 'supplierName',
+    minWidth: 175,
+    ...renderIconLabelLeft('supplierNo', 'supplierName', '卖出方公司编码:')
+  },
+  {
+    label: '买入方公司',
+    prop: 'companyName',
+    minWidth: 175,
+    ...renderIconLabelLeft('companyNo', 'companyName', '买入方公司编码:')
+  },
+  {
+    label: '下单数量',
+    prop: 'todo',
+    width: 80,
+  },
+  {
+    label: '销售单价',
+    prop: 'todo',
+    width: 80
+  },
+  {
+    label: '对账状态',
+    prop: 'status',
+    width: 80,
+    ...renderProp(PURCHASE_STATUS, 'status')
   },
   {
-    label: "操作",
-    fixed: "right",
-    width: 60, //后期修改
-    slot: "operation"
+    label: '下单时间',
+    prop: 'addtime',
+    width: 140
   }
 ];
 

+ 10 - 27
src/views/InvoiceSales/currentcyAssOrderRecord/config/search.config.ts

@@ -11,41 +11,24 @@ const searchFormConfig: FormConfig = {
         type: "daterange",
         startProp: "start",
         endProp: "end",
-        startPlaceholder: "资金认领起始时间",
-        endPlaceholder: "资金认领结束时间"
+        startPlaceholder: "始时间",
+        endPlaceholder: "结束时间"
       }
     },
     {
-      field: "status",
-      type: "select",
-      placeholder: "资金认领状态",
-      options: CAPITAL_STATUS
-    },
-    {
-      field: "platform_type",
-      type: "select",
-      placeholder: "平台类型",
-      options: useTypeOptions
-    },
-    {
-      field: "logNo",
-      type: "input",
-      placeholder: "资金认领编码"
-    },
-    {
-      field: "tradNo",
+      field: "orderCode",
       type: "input",
-      placeholder: "资金编码"
+      placeholder: "销售订单编号"
     },
     {
-      field: "orderCode",
-      type: "input",
-      placeholder: "销售订单编码"
+      field: "companyNo",
+      placeholder: "买入方公司",
+      type: 'business-query'
     },
     {
-      field: "cxCode",
-      type: "input",
-      placeholder: "销售主单号"
+      field: 'supplierNo',
+      placeholder: '卖出方公司',
+      type: 'supplier-query'
     }
   ]
 };

+ 2 - 2
src/views/InvoiceSales/currentcyAssOrderRecord/index.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import contentConfig from "./config/content.config";
 import searchConfig from "./config/search.config";
-import { usePageSearch, type PageHooks, type PageEvent } from "/@/hooks/page";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
 
 const pageName = "currentcyAssOrderRecord";
 
@@ -14,7 +14,7 @@ const hooks: PageHooks = {
   <PageAuth :pageName="pageName">
     <PageContainer
       :hooks="hooks"
-      :contentConfig="contentConfig"
+      :content-config="contentConfig"
       :search-config="searchConfig"
     />
   </PageAuth>

+ 14 - 11
src/views/InvoiceSales/currentcyOrderRecord/detail.vue

@@ -1,12 +1,22 @@
 <script setup lang="ts">
-import { ref, computed, shallowRef } from 'vue'
+import { shallowRef } from 'vue'
 import { useDetail } from "/@/hooks/core/useDetail";
 import { usePermission } from "/@/hooks/core/usePermission";
 import ReconciliationForm from "/@/components/ReconciliationForm";
 import { DefaultApprovalNode } from "/@/components/ApprovalNode";
+import { useAsync } from '/@/hooks/core/useAsync';
 
 const pageName = "currentcyOrderRecordDetail"
 
+const { run: approval } = useAsync({
+  success: () => { }
+});
+
+const { run: create } = useAsync({
+  success: () => { }
+})
+
+
 const { id, title, isDetail, collapses } = useDetail({
   baseName: '订单对账',
   collapseLen:2
@@ -15,15 +25,8 @@ const { id, title, isDetail, collapses } = useDetail({
 const loading = shallowRef(false);
 
 const { hasPermissionWithCode } = usePermission(pageName);
-
-function handleCreate() { 
-
-}
-
-function handleApproval() { 
-
-}
-
+const handleCreate = (data:Record<string,any>) => create();
+const handleApproval = (data: Record<string, any>) => approval();
 </script>
 
 
@@ -33,12 +36,12 @@ function handleApproval() {
       <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 - 11
src/views/purchase/purchPay/config/content.config.ts

@@ -52,23 +52,12 @@ const columns = [
     width: 110,
     align: "left"
   },
-  // {
-  //   label: "卖方公司编码",
-  //   prop: "supplierNo",
-  //   width: 150,
-  //   align: "left"
-  // },
   {
     label: "卖出方公司",
     prop: "supplierName",
     minWidth: 180,
     ...renderIconLabelLeft("supplierNo", "supplierName", "卖出方公司编码:")
   },
-  // {
-  //   label: "买方公司编码",
-  //   prop: "companyNo",
-  //   width: 150
-  // },
   {
     label: "买入方公司名称",
     prop: "companyName",

+ 8 - 10
src/views/purchase/purchPay/detail.vue

@@ -46,23 +46,21 @@ const { run: approval } = useAsync({
 });
 
 function refresh() {
-  requesetDetail();
+  requestDetail();
   formRef.value && formRef.value.refresh();
 }
 
-const requesetDetail = () => detail(httpDetail({ DzNo: id.value }));
+const requestDetail = () => detail(httpDetail({ DzNo: id.value }));
 const handleCreate = data => create(httpAdd(data));
+const handleApproval = (data) => approval(httpStatus({...data, dzNo: id.value }))
 
-function handleApproval(data) {
-  const params = {
-    ...data,
-    dzNo: id.value
-  };
+// function handleApproval(data) {
+//   const params = {...data, dzNo: id.value };
+//   approval(httpStatus(params));
+// }
 
-  approval(httpStatus(params));
-}
 
-if (isDetail.value) requesetDetail();
+if (isDetail.value) requestDetail();
 </script>
 
 <template>

+ 0 - 0
src/views/purchase/purchPay/config/采购付款.md → src/views/purchase/purchPay/采购付款.md


+ 1 - 1
src/views/supply/ticketReturn/index.vue

@@ -79,7 +79,7 @@ async function handleDownload() {
       :events="events"
       :contentConfig="contentConfig"
       :search-config="searchConfig"
-      :get-content-ref="(ref:any) => pageContentRef = ref"
+      :get-content-ref="(ref: any) => pageContentRef = ref"
     >
       <template #content_header>
         <ElButton