snow 6 天之前
父節點
當前提交
f20b020515

+ 6 - 2
src/api/purchase/orderPay/index.ts

@@ -1,12 +1,16 @@
 import { http } from "/@/utils/http";
 import { loadEnv } from "@build/index";
 const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL, VITE_WORKORDER_REAL } = loadEnv();
-const userAPi = VITE_PROXY_DOMAIN_REAL;
-const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+// const userAPi = VITE_PROXY_DOMAIN_REAL;
 
 
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
 const newApi = VITE_WORKORDER_REAL
 
+export const httpAccountList = (data: object): any => {
+  return http.request("post", `http://rep.report.caixiao365.com/admin/accountInv/list`, { data });
+};
+
 //对账付款申请列表
 export const httpList = (data: object): any => {
   return http.request("post", `${newApi}/cxinv/stage/list`, { data });

+ 3 - 0
src/components/PageContent/src/hooks/use-request.ts

@@ -87,6 +87,7 @@ export function useRequest(props: PageContentProps) {
       code,
       message,
       logout,
+      responsecode: contentConfig.responseCode || 0,
       handler: () => {
         const _list = Array.isArray(data) ? data : data.list;
 
@@ -122,10 +123,12 @@ export function useRequest(props: PageContentProps) {
       ...params
     });
 
+
     responseHandle({
       code,
       message,
       logout,
+      responsecode: contentConfig.responseCode || 0,
       handler: () => {
         const _list = Array.isArray(data) ? data : data.list;
 

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

@@ -13,6 +13,7 @@ import PageContent from "./page-content";
  * @param treeProps
  */
 export interface ContentConfig {
+  responseCode?: number;
   spanMethod?: any;
   pagination?: any;
   title: string;

+ 3 - 1
src/utils/responseHandle.ts

@@ -4,17 +4,19 @@ export function responseHandle({
   code,
   message,
   logout,
+  responsecode = 0,
   handler,
   error
 }: {
   code: number;
   message: string;
+  responsecode?: number;
   logout: any;
   handler: () => void;
   error?: () => void;
 }) {
   const c = Number(code);
-  if (c === 0) {
+  if (c === responsecode) {
     handler();
   } else if (c > 100 && c < 140) {
     logout();

+ 70 - 0
src/views/system/managerSetting/component/choose-form.vue

@@ -0,0 +1,70 @@
+<script setup lang="ts">
+import { ref, unref } from "vue";
+// import ReconciliationForm from "/@/components/ReconciliationForm";
+import Descriptions from "../../descriptions/index.vue";
+import { ElForm, ElMessage } from "element-plus";
+import { createRules } from "../config/_rules";
+import ChooseModal from "./choose-modal.vue";
+
+const emit = defineEmits(["create"]);
+
+const formRef = ref<InstanceType<typeof ElForm> | null>(null);
+const chooseModalRef = ref<InstanceType<typeof ChooseModal> | null>(null);
+const reconciliationRef = ref<InstanceType<typeof ReconciliationForm> | null>(
+  null
+);
+
+const formData = ref({ payNo: "", pay_fee: "" });
+
+const handleChoose = () => chooseModalRef.value.onDisplay();
+
+function handleCreate() {
+  const { detail } = reconciliationRef.value;
+  if (Number(formData.value.pay_fee) > Number(detail?.wpay_fee)) {
+    return ElMessage.error("付款金额不能超过未付款金额");
+  }
+
+  formRef.value.validate(isValid => isValid && emit("create", unref(formData)));
+}
+</script>
+
+<template>
+  <div w-full>
+    <ElForm ref="formRef" :model="formData" :rules="createRules">
+      <ElFormItem label="订单对账" prop="payNo">
+        <!-- <ReconciliationForm
+          ref="reconciliationRef"
+          isPurchPay
+          :id="formData.payNo"
+          :readonly="!!formData.payNo"
+          @choose="handleChoose"
+        /> -->
+
+        <Descriptions 
+          ref="reconciliationRef"
+          isPurchPay
+          :payNo="formData.payNo"
+          :readonly="!!formData.payNo"
+          request
+          choose
+          @choose="handleChoose"
+        />
+      </ElFormItem>
+
+      <ElFormItem label="付款金额" prop="pay_fee">
+        <ElInput v-model="formData.pay_fee" placeholder="请输入付款金额" />
+      </ElFormItem>
+
+      <ElFormItem>
+        <div class="flex w-full justify-end">
+          <ElButton type="primary" @click="handleCreate">保存</ElButton>
+        </div>
+      </ElFormItem>
+    </ElForm>
+
+    <ChooseModal
+      ref="chooseModalRef"
+      @choose="payNo => (formData.payNo = payNo)"
+    />
+  </div>
+</template>

+ 103 - 0
src/views/system/managerSetting/component/choose-modal.vue

@@ -0,0 +1,103 @@
+<script setup lang="ts">
+import { ref, unref, reactive } from "vue";
+import { ElMessage, ElTable } from "element-plus";
+import { useResponseHandle } from "/@/hooks";
+import { httpOldList as httpList } from "/@/api/purchase/orderRecord";
+import { useCompany } from "/@/hooks/core/useCompany";
+import { useVModel } from "@vueuse/core";
+
+
+import { UnitInput } from "/@/components/Input"
+
+
+const emit = defineEmits(["choose"]);
+const props = defineProps<{ visible: boolean }>()
+
+const visible = useVModel(props, 'visible')
+const paymentList = ref<Array<Record<string, string>>>([]);
+const selects = ref<Array<Record<string, string>>>([]);
+
+const { currentCompany } = useCompany();
+
+const pagination = reactive({
+  total: 0,
+  size: 15,
+  page: 1,
+  background: true
+});
+
+const formData = ref<Record<string, any>>({
+  inv_fee: 0,
+  return_inv_fee: 0,
+  cost_fee: 0,
+  return_cost_fee: 0
+});
+
+const tableRef = ref<InstanceType<typeof ElTable>>(null);
+const currentKey = ref("payNo");
+const loading = ref(false);
+const responseHandle = useResponseHandle();
+
+//初始化订单对账列表
+async function requestPaymentList() {
+  const { size, page } = pagination;
+  loading.value = true;
+
+  const { currentValue, timer, ...otherParams } = formData.value;
+
+  const { code, message, data } = await httpList({
+    status: "2",
+    // is_comon: "0",
+    noRela: true,
+    pay_type: "2",
+    pay_status: "0",
+    [currentKey.value]: currentValue,
+    startTime: timer[0],
+    endTime: timer[1],
+    ...otherParams,
+    supplierNo: currentCompany.value.companyNo,
+    page,
+    size
+  });
+
+  responseHandle({
+    code, message,
+    handler: () => {
+      pagination.total = data.count;
+      paymentList.value = data.list;
+    }
+  });
+  loading.value = false;
+}
+</script>
+
+<template>
+  <el-dialog top="10vh" :close-on-click-modal="false" v-model="visible" title="添加项目经理补录" center width="1040px"
+    @open="() => requestPaymentList()">
+    <el-form label-width="100px">
+      <el-form-item label="开票金额">
+        <UnitInput v-model="formData.inv_fee" placeholder="开票金额" unit="元" />
+      </el-form-item>
+
+      <el-form-item label="退票金额">
+        <UnitInput v-model="formData.return_inv_fee" placeholder="退票金额" unit="元" />
+      </el-form-item>
+
+      <el-form-item label="开票成本金额">
+        <UnitInput v-model="formData.cost_fee" placeholder="开票成本金额" unit="元" />
+      </el-form-item>
+
+      <el-form-item label="退票成本金额">
+        <UnitInput v-model="formData.return_cost_fee" placeholder="退票成本金额" unit="元" />
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-table__header) {
+  .el-checkbox {
+    display: none;
+  }
+}
+</style>

+ 63 - 0
src/views/system/managerSetting/config/_details.ts

@@ -0,0 +1,63 @@
+export const columns = [
+  {
+    label: "对账编码",
+    prop: "payNo",
+    minWidth: 160,
+    align: "left"
+  },
+  {
+    label: "供应商编码",
+    prop: "supplierNo",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "供应商名称",
+    prop: "supplierName",
+    minWidth: 180,
+    align: "left"
+  },
+  {
+    label: "业务公司编码",
+    prop: "companyNo",
+    minWidth: 150
+  },
+  {
+    label: "业务公司名称",
+    prop: "companyName",
+    minWidth: 180
+  },
+  {
+    label: "付款状态",
+    prop: "pay_status",
+    minWidth: 100
+  },
+  {
+    label: "总额款",
+    prop: "total_fee",
+    minWidth: 110,
+    align: "total_fee"
+  },
+  {
+    label: "付款标签金额",
+    prop: "pay_tag_fee",
+    minWidth: 110,
+    align: "left"
+  },
+  {
+    label: "已付款金额",
+    prop: "apay_fee",
+    minWidth: 110,
+    align: "left"
+  },
+  {
+    label: "申请人",
+    prop: "apply_name",
+    minWidth: 90
+  },
+  {
+    label: "申请时间",
+    prop: "addtime",
+    minWidth: 120
+  }
+];

+ 61 - 0
src/views/system/managerSetting/config/_options.ts

@@ -0,0 +1,61 @@
+export const statusOptions = [
+  {
+    value: "1",
+    label: "业务公司业务审核"
+  },
+  {
+    value: "2",
+    label: "业务公司财务审核"
+  },
+  {
+    value: "3",
+    label: "待付款回执"
+  },
+  {
+    value: "4",
+    label: "付款成功"
+  },
+  {
+    value: "5",
+    label: "付款已退"
+  },
+  {
+    value: "6",
+    label: "业务公司业务驳回"
+  },
+  {
+    value: "7",
+    label: "业务公司财务驳回"
+  }
+];
+
+export const paymentStatusOptions = [
+  {
+    label: "待系统查票",
+    value: "1"
+  },
+  {
+    label: "业务公司业务审核",
+    value: "2"
+  },
+  {
+    label: "验证失败",
+    value: "3"
+  },
+  {
+    label: "待业务公司认证",
+    value: "4"
+  },
+  {
+    label: "业务公司驳回",
+    value: "5"
+  },
+  {
+    label: "认证成功",
+    value: "6"
+  },
+  {
+    label: "认证失败",
+    value: "7"
+  }
+];

+ 12 - 0
src/views/system/managerSetting/config/_rules.ts

@@ -0,0 +1,12 @@
+import { FormRules } from "element-plus";
+
+export const createRules: FormRules = {
+  pay_fee: [{ required: true, trigger: "change", message: "请输入付款金额" }],
+  payNo: [
+    {
+      required: true,
+      trigger: "change",
+      message: "请选择付款订单"
+    }
+  ]
+};

+ 76 - 0
src/views/system/managerSetting/config/content.config.ts

@@ -0,0 +1,76 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpAccountList } from "/@/api/purchase/orderPay";
+
+import dayjs from "dayjs";
+import { h } from "vue";
+import { ElTag } from "element-plus";
+import { hasAccountOptions, orderTypeCgOptions, sendPurchPayStatusOptions } from "/@/utils/status";
+import { renderIconLabelLeft, renderProp } from "/@/utils/columnRenderHelper";
+
+const columns = [
+  {
+    type: "selection",
+    width: 40,
+    align: "center",
+    hide: ({ checkList }) => !checkList.includes("勾选列")
+  },
+  {
+    label: "序号",
+    type: "index",
+    minWidth: 60,
+    align: "left",
+    hide: ({ checkList }) => !checkList.includes("序号列")
+  },
+
+  {
+    label: "业务经理",
+    prop: "uname",
+    width: 150,
+    align: "left"
+  },
+  {
+    label: "开票金额",
+    prop: "inv_fee",
+    minWidth: 150
+  },
+  {
+    label: "开票金额(退)",
+    prop: "return_inv_fee",
+    minWidth: 130
+  },
+  {
+    label: "成本金额",
+    prop: "cost_fee",
+    minWidth: 110,
+    align: "left"
+  },
+  {
+    label: "成本金额(退)",
+    prop: "return_cost_fee",
+    minWidth: 110
+  },
+  {
+    label: "操作",
+    fixed: "right",
+    width: 100,
+    slot: "operation"
+  }
+];
+
+const contentConfig: ContentConfig = {
+  title: "采购付款",
+  columns,
+  deleteProp: "dzNo",
+  showDelete: ({ dstatus }) => Number(dstatus) !== 3,
+  superUserNoAction: true,
+  listNoRelation: true,
+  companyProp: 'supplierNo',
+  responseCode: 1,
+  apis: {
+    httpList: (data) => httpAccountList(data)
+    // httpAdd: true,
+    // httpDelete
+  }
+};
+
+export default contentConfig;

+ 46 - 0
src/views/system/managerSetting/config/search.config.ts

@@ -0,0 +1,46 @@
+import { FormConfig } from "/@/components/PageSearch";
+import { orderTypeCgOptions, sendPurchPayStatusOptions } from "/@/utils/status";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "timer",
+      type: "date_picker",
+      otherOptions: {
+        type: "daterange",
+        startProp: "startTime",
+        endProp: "endTime",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期"
+      }
+    },
+    // {
+    //   field: "companyNo",
+    //   type: "input",
+    //   placeholder: "买方公司编码"
+    // },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "审核状态",
+      options: sendPurchPayStatusOptions
+    },
+    {
+      field: "companyNo",
+      type: "business-query",
+      placeholder: '业务公司'
+    },
+    {
+      field: "dzNo",
+      type: "input",
+      placeholder: "对账付款编码"
+    },
+    {
+      field: "payNo",
+      type: "input",
+      placeholder: "对账编码"
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 0 - 0
src/views/system/managerSetting/config/采购付款.md


+ 133 - 0
src/views/system/managerSetting/detail.vue

@@ -0,0 +1,133 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import { useRouter } from "vue-router";
+import { useDetail } from "/@/hooks/core/useDetail";
+import { useAsync } from "/@/hooks/core/useAsync";
+import ChooseForm from "./component/choose-form.vue";
+import { useUserInfo } from "/@/hooks/core/useUser";
+import { usePermission } from "/@/hooks/core/usePermission";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+// import ReconciliationForm from "/@/components/ReconciliationForm";
+
+import Descrptions from "../descriptions/index.vue";
+import { httpOldDetail as httpDetail, httpOldAdd as httpAdd,  httpOldStatus as httpStatus } from "/@/api/purchase/orderPay";
+
+import {
+  DefaultApprovalNode,
+  ReceiptApprovalNode
+} from "/@/components/ApprovalNode";
+
+import { sendPurchpayColumns } from "/@/utils/details/_purchase";
+
+const { push } = useRouter();
+const pageName = "supSendOrderPayDetail";
+
+// { code: "020", name: "买方公司财务审核" },
+// { code: "039", name: "买方公司业务审核" }
+const { hasPermissionWithCode } = usePermission(pageName);
+
+const formRef = ref<InstanceType<typeof Descrptions> | null>(null);
+
+const { isSuperUser } = useUserInfo();
+
+const { id, isDetail, title, collapses } = useDetail({
+  baseName: "发货运单付款",
+  collapseLen: 5
+});
+
+const { run: detail, data } = useAsync<Record<string, string>>({
+  initalData: {}
+});
+
+const { run: create } = useAsync({
+  // success: () => push("/supplierOrder/supSendOrderPay")
+  success: () => push("/supplierOrder/supplierOrderCollection?tab=supSendOrderPay_collection")
+});
+
+const { run: approval } = useAsync({
+  success: () => refresh()
+});
+
+function refresh() {
+  requestDetail();
+  formRef.value && formRef.value.refresh();
+}
+
+const requestDetail = () => detail(httpDetail({ DzNo: id.value }));
+const handleCreate = data => create(httpAdd(data));
+
+function handleApproval(data) {
+  const params = { ...data, dzNo: id.value };
+  approval(httpStatus(params));
+}
+
+if (isDetail.value) requestDetail();
+</script>
+
+<template>
+  <div class="padding__container bg-white">
+    <ElTabs>
+      <ElTabPane :label="title">
+        <ElCollapse v-model="collapses">
+          <ElCollapseItem name="1" :title="title">
+            <BasicDescriptions
+              v-if="isDetail"
+              :columns="sendPurchpayColumns"
+              :data="data"
+            />
+            
+            <ChooseForm v-else @create="handleCreate" />
+          </ElCollapseItem>
+
+          <div v-if="isDetail">
+            <ElCollapseItem name="2" title="对账详情">
+              <Descrptions ref="formRef" request readonly :payNo="data.payNo" />
+            </ElCollapseItem>
+
+            <!-- 审批节点 -->
+            <template v-if="!isSuperUser">
+              <ElCollapseItem
+                name="3"
+                title="业务公司业务审核"
+                v-if="
+                  String(data.status) === '1' && hasPermissionWithCode('039')
+                "
+              >
+                <DefaultApprovalNode
+                  approve-value="2"
+                  reject-value="6"
+                  @approval="handleApproval"
+                />
+              </ElCollapseItem>
+
+              <ElCollapseItem
+                name="4"
+                title="业务公司财务审核"
+                v-if="
+                  String(data.status) === '2' && hasPermissionWithCode('020')
+                "
+              >
+                <DefaultApprovalNode
+                  approve-value="3"
+                  reject-value="7"
+                  @approval="handleApproval"
+                />
+              </ElCollapseItem>
+
+              <ElCollapseItem
+                name="5"
+                title="上传回执"
+                v-if="String(data.status) === '3' && hasPermissionWithCode('049')"
+              >
+                <ReceiptApprovalNode
+                  approve-value="4"
+                  @approval="handleApproval"
+                />
+              </ElCollapseItem>
+            </template>
+          </div>
+        </ElCollapse>
+      </ElTabPane>
+    </ElTabs>
+  </div>
+</template>

+ 42 - 0
src/views/system/managerSetting/index.vue

@@ -0,0 +1,42 @@
+<script setup lang="ts">
+import { ref } from "vue"
+import { useRouter } from "vue-router";
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+
+import ChooseModal from "./component/choose-modal.vue"
+
+const PageName = "managerSetting";
+const baseUrl = "/supplierOrder/supSendOrderPayDetail";
+
+const { push } = useRouter();
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+
+const visible = ref(false)
+
+const events: PageEvents = {
+  content: {
+    preview: ({ dzNo }) => push(`${baseUrl}?id=${dzNo}`),
+    create: () => push(baseUrl)
+  }
+};
+</script>
+
+<template>
+  <PageAuth :pageName="PageName">
+    <PageContainer :hooks="hooks" :events="events" :contentConfig="contentConfig" :search-config="searchConfig">
+      <template #content_table_header>
+        <div class="w-full flex justify-end">
+          <el-button size="small" type="primary" @click="visible = true">创建</el-button>
+        </div>
+      </template>
+    </PageContainer>
+
+    <ChooseModal v-model:visible="visible" />
+  </PageAuth>
+</template>