Forráskód Böngészése

fix:修改采购/销售模块bug

snow 2 éve
szülő
commit
b6f0690e56

+ 5 - 0
src/api/purchase/ticketReturn/index.ts

@@ -23,3 +23,8 @@ export const httpStatus = (data: object): any => {
 export const httpInfo = (data: object): any => {
   return http.request("post", `${yewuApi}/hpinfo`, { data });
 };
+
+//发票回票删除
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}/invdel`, { data });
+};

+ 4 - 1
src/components/PageContent/src/page-content.tsx

@@ -1,4 +1,4 @@
-import { defineComponent } from "vue";
+import { defineComponent, ref } from "vue";
 import PureTable from "@pureadmin/table";
 import { pageContentProps } from "./types";
 import { TableProBar } from "../../ReTable";
@@ -20,6 +20,7 @@ const PageConent = defineComponent({
   setup(props, { expose, emit, slots }) {
     //根据传入的api决定表格需要的操作
     const action = createOperation(props.contentConfig.apis);
+    const tableRef = ref<InstanceType<typeof PureTable>>(null);
 
     const {
       loading,
@@ -104,6 +105,7 @@ const PageConent = defineComponent({
           border
           align="left"
           defaultExp
+          ref={tableRef}
           showOverflowTooltip
           defaultExpandAll
           table-layout="auto"
@@ -137,6 +139,7 @@ const PageConent = defineComponent({
       return (
         <TableProBar
           title={title}
+          ref={tableRef.value?.getTableRef()}
           dataList={dataList.value}
           onRefresh={onSearch}
           loading={loading.value}

+ 1 - 1
src/utils/details/ticket-return.ts

@@ -44,7 +44,7 @@ export const STATUS_OPTIONS = [
     value: "4"
   },
   {
-    label: "认证成功待确认",
+    label: "回票完成",
     value: "5"
   },
   {

+ 30 - 4
src/views/InvoiceSales/capitalClaim/components/capital-detail/index.vue

@@ -1,17 +1,20 @@
 <script setup lang="ts">
-import { computed, onMounted, ref } from "vue";
+import { computed, onMounted, ref, watchEffect } from "vue";
 import { useRoute, useRouter } from "vue-router";
 import { useResponseHandle } from "/@/hooks";
 import { httpDetail, httpStatus } from "/@/api/InvoiceSales/capitalPool";
+import { httpInfo } from "/@/api/InvoiceSales/capitalClaim";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { approval_process } from "../approval-process";
 import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
+import PaymentReceipt from "../basic-claim/receipt-payment.vue";
 
 const { query } = useRoute();
 const { push } = useRouter();
 const responseHandle = useResponseHandle();
 const capitalDetail = ref<any>({});
-const collapses = ref(["1", "2"]);
+const tradeDetail = ref<any>({});
+const collapses = ref(["1", "2", "3"]);
 
 const logNo = computed(() => query.id);
 
@@ -34,6 +37,24 @@ async function requesetCapitalDetail() {
   });
 }
 
+//资金详情
+async function requesetTradeDetail() {
+  const { data, message, code } = await httpInfo({
+    tradNo: tradeNo.value
+  });
+
+  responseHandle({
+    code,
+    message,
+    handler: () => (tradeDetail.value = data)
+  });
+}
+
+const tradeNo = computed(() => {
+  const { tradNo } = capitalDetail.value;
+  return tradNo;
+});
+
 //资金认证状态
 async function requesetCapitalStatus(otherParams) {
   const { code, message } = await httpStatus({
@@ -55,6 +76,8 @@ function initalData() {
 }
 
 onMounted(() => initalData());
+
+watchEffect(() => tradeNo.value && requesetTradeDetail());
 </script>
 
 <template>
@@ -62,8 +85,11 @@ onMounted(() => initalData());
     <ElTabs>
       <ElTabPane label="详情">
         <ElCollapse v-model="collapses">
-          <!-- 详情 -->
           <ElCollapseItem title="资金详情" name="1">
+            <PaymentReceipt :trade-info="tradeDetail" />
+          </ElCollapseItem>
+          <!-- 详情 -->
+          <ElCollapseItem title="认领资金详情" name="2">
             <BasicDescriptions
               :columns="CAPITAL_COLUMNS"
               :data="capitalDetail"
@@ -73,7 +99,7 @@ onMounted(() => initalData());
 
           <!-- 审核 -->
           <ElCollapseItem
-            name="2"
+            name="3"
             v-if="currentProcess"
             :title="currentProcess.title"
           >

+ 1 - 21
src/views/InvoiceSales/capitalClaim/components/claim-detail/index.vue

@@ -2,9 +2,8 @@
 import { computed, onMounted, ref } from "vue";
 import { useAsync } from "/@/hooks";
 import { useRoute, useRouter } from "vue-router";
-import PaymentReceipt from "../basic-claim/receipt-payment.vue";
 import RelatedOrder from "../basic-claim/related-order.vue";
-import { httpInfo, httpPayAdd } from "/@/api/InvoiceSales/capitalClaim";
+import { httpPayAdd } from "/@/api/InvoiceSales/capitalClaim";
 
 const { query } = useRoute();
 const { push } = useRouter();
@@ -12,23 +11,6 @@ const tradNo = computed(() => query.id as string);
 
 const treadOrderList = ref<Array<Record<string, string>>>([]);
 
-const {
-  data: treadeDetail,
-  run: treadeDetailRun,
-  loading
-} = useAsync<Record<string, string>>({
-  initalData: {}
-});
-
-//获取资金详情
-const requesetTradeDetail = () => {
-  treadeDetailRun(
-    httpInfo({
-      tradNo: tradNo.value
-    })
-  );
-};
-
 const { run: createSaleRun } = useAsync({
   success: () => push("/InvoiceSales/capitalClaim")
 });
@@ -45,7 +27,6 @@ const requesetCreateSalePay = orderArr => {
 
 function initalData() {
   if (!tradNo.value) return;
-  requesetTradeDetail();
 }
 
 //传入id初始化详情
@@ -54,7 +35,6 @@ onMounted(() => initalData());
 
 <template>
   <div>
-    <PaymentReceipt v-loading="loading" :trade-info="treadeDetail" />
     <RelatedOrder
       :trade-order-list="treadOrderList"
       @create-btn-click="requesetCreateSalePay"

+ 32 - 28
src/views/InvoiceSales/capitalClaim/config/content.config.ts

@@ -24,6 +24,24 @@ const columns = [
     prop: "tradNo",
     width: 200
   },
+  {
+    label: "状态",
+    prop: "status",
+    width: 100,
+    cellRenderer: ({ row, props }) =>
+      h(
+        ElTag,
+        {
+          size: props.size
+        },
+        {
+          default: () => {
+            const status = row.logNo ? CAPITAL_STATUS : capital_status;
+            return status.find(s => row.status === s.value)?.label || "--";
+          }
+        }
+      )
+  },
   {
     label: "付款单位账号",
     prop: "trade_account",
@@ -35,38 +53,26 @@ const columns = [
     width: 200
   },
   {
-    label: "付款银行名称",
-    prop: "trade_bank",
-    width: 180
+    label: "交易时间",
+    prop: "trade_time",
+    width: 120,
+    cellRenderer: ({ row }) => dayjs(row.trade_time).format("YYYY-MM-DD")
   },
   {
-    label: "汇款金额",
+    label: "交易金额",
     prop: "total_fee",
     width: 140
   },
+  {
+    label: "交易银行",
+    prop: "trade_bank",
+    width: 180
+  },
   {
     label: "收款单位名称",
     prop: "trade_in",
     width: 120
   },
-  {
-    label: "状态",
-    prop: "status",
-    width: 100,
-    cellRenderer: ({ row, props }) =>
-      h(
-        ElTag,
-        {
-          size: props.size
-        },
-        {
-          default: () => {
-            const status = row.logNo ? CAPITAL_STATUS : capital_status;
-            return status.find(s => row.status === s.value)?.label || "--";
-          }
-        }
-      )
-  },
   {
     label: "未认领",
     prop: "balance",
@@ -78,11 +84,9 @@ const columns = [
     width: 80
   },
   {
-    label: "交易时间",
-    prop: "addTime",
-    width: "100px",
-    formatter: ({ createTime }) =>
-      dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
+    label: "交易用途",
+    prop: "trade_used",
+    width: 120
   },
   {
     label: "操作",
@@ -100,7 +104,7 @@ const contentConfig: ContentConfig = {
   },
   isTree: true,
   rowKey: "id",
-  treeProps: { children: "child" },
+  treeProps: { hasChildren: true, children: "child" },
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"]
 };
 

+ 12 - 13
src/views/InvoiceSales/invoicePool/config/content.config.ts

@@ -23,22 +23,26 @@ const columns = [
     prop: "invNo",
     width: 160
   },
-
   {
-    label: "企业客户编码",
-    prop: "inv_in",
+    label: "业务企业编号",
+    prop: "inv_out",
     width: 160
   },
-  {
-    label: "企业客户名称",
-    prop: "username"
-  },
-
   {
     label: "发票额度",
     prop: "inv_value",
     width: 110
   },
+  {
+    label: "未开票金额",
+    prop: "winv_fee",
+    width: 160
+  },
+  {
+    label: "已开票金额",
+    prop: "ainv_fee",
+    width: 160
+  },
   {
     label: "发票类型",
     cellRenderer({ row }) {
@@ -54,11 +58,6 @@ const columns = [
       );
     }
   },
-  {
-    label: "业务公司编码",
-    prop: "inv_out",
-    width: 160
-  },
   {
     label: "申请人",
     prop: "apply_name",

+ 6 - 2
src/views/InvoiceSales/invoicePool/config/search.config.ts

@@ -6,8 +6,12 @@ const searchFormConfig: FormConfig = {
     {
       field: "invNo",
       type: "input",
-      placeholder: "请输入发票申请编号",
-      options: inv_type_list
+      placeholder: "请输入发票申请编号"
+    },
+    {
+      field: "inv_out",
+      type: "input",
+      placeholder: "业务企业公司"
     },
     {
       field: "timer",

+ 8 - 4
src/views/InvoiceSales/refund/components/approval-process/approval-pending.vue

@@ -1,12 +1,16 @@
 <script setup lang="ts">
-import { ElForm, ElMessage, UploadProps } from "element-plus";
 import { reactive, ref, watchEffect } from "vue";
+import { ElForm, ElMessage, UploadProps } from "element-plus";
 import { httpImageUpload, baseUrl } from "/@/api/other";
 import { useResponseHandle } from "/@/hooks";
 import { useUserStore } from "/@/store/modules/user";
 
 const emit = defineEmits(["changeStatus"]);
 
+const props = defineProps<{
+  hiddenRerturnImg: boolean;
+}>();
+
 const formData = reactive({
   return_img: "",
   status: "",
@@ -32,7 +36,7 @@ const rules = reactive({
   ],
   remark: [
     {
-      required: true,
+      required: !props.hiddenRerturnImg,
       trigger: "change",
       message: "请输入备注"
     }
@@ -76,7 +80,7 @@ const handlePaymentReceipt = () => {
 };
 
 watchEffect(() => {
-  rules.remark[0].required = formData.status === "3";
+  rules.remark[0].required = formData.status === "2";
 });
 </script>
 
@@ -99,7 +103,7 @@ watchEffect(() => {
       <el-input type="textarea" v-model="formData.remark" />
     </el-form-item>
 
-    <el-form-item label="退款回执" prop="return_img">
+    <el-form-item label="退款回执" prop="return_img" v-if="!hiddenRerturnImg">
       <div>
         <el-upload
           class="upload"

+ 5 - 0
src/views/InvoiceSales/refund/detail.vue

@@ -21,6 +21,10 @@ const currentProcess = computed(() => {
   return approval_process[status];
 });
 
+const hiddenRerturnImg = computed(() => {
+  return refundDetail.value.type === "2";
+});
+
 //退款详情
 async function requesetRefundDetail() {
   const { code, message, data } = await httpDetail({
@@ -76,6 +80,7 @@ onMounted(() => initalData());
             :title="currentProcess.title"
           >
             <component
+              :hiddenRerturnImg="hiddenRerturnImg"
               :is="currentProcess.component"
               @change-status="requesetRefundStatus"
             />

+ 56 - 14
src/views/InvoiceSales/sheetOrderPool/config/content.config.ts

@@ -5,6 +5,7 @@ import { h } from "vue";
 import { ElTag } from "element-plus";
 import { TAG_TYPE } from "/@/utils/global";
 import { accAdd } from "/@/utils/calculation";
+import { cat_status, good_source, good_type } from "./search.config";
 
 const USE_STATUS = [
   {
@@ -43,10 +44,20 @@ const columns = [
     prop: "name",
     width: 150
   },
+  {
+    label: "销售员编号",
+    prop: "ownerid",
+    width: 100
+  },
   {
     label: "销售员",
     prop: "ownerName"
   },
+  {
+    label: "客户编号",
+    prop: "customerNo",
+    width: 100
+  },
   {
     label: "客户名称",
     prop: "customerName",
@@ -63,18 +74,13 @@ const columns = [
       })
   },
   {
-    label: "标签类型",
-    prop: "tag_id",
-    width: 100,
-    cellRenderer: ({ row }) =>
-      h(ElTag, null, {
-        default: () =>
-          TAG_TYPE.find(s => s.value === row.tag_id)?.label || "无标签"
-      })
+    label: "部门",
+    prop: "department",
+    width: 100
   },
   {
-    label: "标签名称",
-    prop: "tag_name",
+    label: "平台名称",
+    prop: "platName",
     width: 100
   },
   {
@@ -82,6 +88,16 @@ const columns = [
     prop: "tag_fee",
     width: 100
   },
+  {
+    label: "标签类型",
+    prop: "tag_id",
+    width: 100,
+    cellRenderer: ({ row }) =>
+      h(ElTag, null, {
+        default: () =>
+          TAG_TYPE.find(s => s.value === row.tag_id)?.label || "无标签"
+      })
+  },
   {
     label: "未开票",
     prop: "winv_fee",
@@ -121,15 +137,41 @@ const columns = [
       row.tag_id === "3" ? accAdd(row.apay_fee, row.tag_fee) : row.apay_fee
   },
   {
-    label: "平台名称",
-    prop: "department",
+    label: "商品类型",
+    width: 100,
+    cellRenderer: ({ row }) =>
+      h(ElTag, null, {
+        default: () =>
+          good_type.find(s => s.value === row.qrdType)?.label || "--"
+      })
+  },
+  {
+    label: "订单来源",
+    width: 100,
+    cellRenderer: ({ row }) =>
+      h(ElTag, null, {
+        default: () =>
+          good_source.find(s => s.value === row.qrdSource)?.label || "--"
+      })
+  },
+  {
+    label: "标签id",
+    prop: "tag_id",
     width: 100
   },
   {
-    label: "标签类型",
-    prop: "department",
+    label: "标签添加人",
+    prop: "tag_uname",
     width: 100
   },
+  {
+    label: "类目设置",
+    cellRenderer: ({ row }) =>
+      h(ElTag, null, {
+        default: () =>
+          cat_status.find(s => s.value === row.qrdType)?.label || "--"
+      })
+  },
   {
     label: "操作",
     fixed: "right",

+ 187 - 0
src/views/InvoiceSales/sheetOrderPool/config/search.config.ts

@@ -16,6 +16,104 @@ export const USE_STATUS = [
   }
 ];
 
+export const inv_open_status = [
+  {
+    value: "1",
+    label: "未开票"
+  },
+  {
+    value: "2",
+    label: "部分开票"
+  },
+  {
+    value: "3",
+    label: "已开票"
+  }
+];
+
+export const retrun_status = [
+  {
+    value: "1",
+    label: "未回款"
+  },
+  {
+    value: "2",
+    label: "部分回款"
+  },
+  {
+    value: "3",
+    label: "已回款"
+  }
+];
+
+export const good_type = [
+  {
+    value: "1",
+    label: "库存品"
+  },
+  {
+    value: "2",
+    label: "非库存"
+  },
+  {
+    value: "3",
+    label: "咨询"
+  }
+];
+
+export const good_source = [
+  {
+    value: "1",
+    label: "直接下单"
+  },
+  {
+    value: "2",
+    label: "咨询"
+  },
+  {
+    value: "3",
+    label: "项目"
+  },
+  {
+    value: "4",
+    label: "平台"
+  },
+  {
+    value: "5",
+    label: "有赞"
+  },
+  {
+    value: "6",
+    label: "售后补换货"
+  }
+];
+
+export const seend_type = [
+  {
+    value: "1",
+    label: "未发货"
+  },
+  {
+    value: "2",
+    label: "部分发货"
+  },
+  {
+    value: "3",
+    label: "已发货"
+  }
+];
+
+export const cat_status = [
+  {
+    value: "1",
+    label: "未设置"
+  },
+  {
+    value: "2",
+    label: "已设置"
+  }
+];
+
 const tag_type = TAG_TYPE.slice(2);
 
 const searchFormConfig: FormConfig = {
@@ -39,6 +137,95 @@ const searchFormConfig: FormConfig = {
         endPlaceholder: "销售额最大值"
       }
     },
+    {
+      field: "order_timer",
+      type: "date_picker",
+      otherOptions: {
+        type: "daterange",
+        startPlaceholder: "下单起始时间",
+        endPlaceholder: "下单结束时间"
+      }
+    },
+    {
+      field: "sequenceNo",
+      type: "input",
+      placeholder: "订单编号"
+    },
+    {
+      field: "department",
+      type: "input",
+      placeholder: "部门"
+    },
+    {
+      field: "customer",
+      type: "input",
+      placeholder: "客户名称"
+    },
+    {
+      field: "customerNo",
+      type: "input",
+      placeholder: "客户编号"
+    },
+    {
+      field: "platName",
+      type: "input",
+      placeholder: "平台名称"
+    },
+    {
+      field: "saler",
+      type: "input",
+      placeholder: "销售员"
+    },
+    {
+      field: "salerid",
+      type: "input",
+      placeholder: "销售员id"
+    },
+    {
+      field: "inv_status",
+      type: "select",
+      placeholder: "开票状态",
+      options: inv_open_status
+    },
+    {
+      field: "qrdtype",
+      type: "select",
+      placeholder: "商品类型",
+      options: good_type
+    },
+    {
+      field: "qrdsource",
+      type: "select",
+      placeholder: "订单来源",
+      options: good_source
+    },
+    {
+      field: "pay_status",
+      type: "select",
+      placeholder: "回款状态",
+      options: retrun_status
+    },
+    {
+      field: "sendstatus",
+      type: "select",
+      placeholder: "发货状态",
+      options: seend_type
+    },
+    {
+      field: "tag_id",
+      type: "input",
+      placeholder: "标签id"
+    },
+    {
+      field: "tag_uname",
+      type: "input",
+      placeholder: "标签添加人"
+    },
+    {
+      field: "cat_status",
+      type: "select",
+      placeholder: "是否设置类目"
+    },
     {
       field: "status",
       type: "select",

+ 5 - 2
src/views/InvoiceSales/sheetOrderPool/index.vue

@@ -14,12 +14,15 @@ defineOptions({
 
 const detailDialogRef = ref<InstanceType<typeof DetailDialog>>(null);
 
-function searchCallback({ totalRange }) {
+function searchCallback({ totalRange, order_timer }) {
   const [total_min, total_max] = totalRange;
+  const [start, end] = order_timer;
 
   const result = {
     total_max,
-    total_min
+    total_min,
+    start,
+    end
   };
 
   return {

+ 36 - 36
src/views/purchase/orderRecord/config/content.config.ts

@@ -54,42 +54,42 @@ const columns = [
     minWidth: 180,
     align: "left"
   },
-  {
-    label: "总额款",
-    prop: "total_fee",
-    minWidth: 180,
-    align: "total_fee"
-  },
-  {
-    label: "已付款金额",
-    prop: "apay_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "付款中金额",
-    prop: "pay_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "未付款金额",
-    prop: "wpay_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "已回票金额",
-    prop: "ainv_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "未回票金额",
-    prop: "winv_fee",
-    minWidth: 180,
-    align: "left"
-  },
+  // {
+  //   label: "总额款",
+  //   prop: "total_fee",
+  //   minWidth: 180,
+  //   align: "total_fee"
+  // },
+  // {
+  //   label: "已付款金额",
+  //   prop: "apay_fee",
+  //   minWidth: 180,
+  //   align: "left"
+  // },
+  // {
+  //   label: "付款中金额",
+  //   prop: "pay_fee",
+  //   minWidth: 180,
+  //   align: "left"
+  // },
+  // {
+  //   label: "未付款金额",
+  //   prop: "wpay_fee",
+  //   minWidth: 180,
+  //   align: "left"
+  // },
+  // {
+  //   label: "已回票金额",
+  //   prop: "ainv_fee",
+  //   minWidth: 180,
+  //   align: "left"
+  // },
+  // {
+  //   label: "未回票金额",
+  //   prop: "winv_fee",
+  //   minWidth: 180,
+  //   align: "left"
+  // },
   {
     label: "申请人",
     prop: "apply_name",

+ 0 - 4
src/views/purchase/purchPay/config/content.config.ts

@@ -116,10 +116,6 @@ const contentConfig: ContentConfig = {
     httpList,
     httpDelete
   },
-  tagProps: {
-    type: "1",
-    prop: "dzNo"
-  },
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"]
 };
 

+ 3 - 6
src/views/purchase/ticketReturn/config/content.config.ts

@@ -1,5 +1,5 @@
 import { ContentConfig } from "/@/components/PageContent";
-import { httpList } from "/@/api/purchase/ticketReturn";
+import { httpList, httpDelete } from "/@/api/purchase/ticketReturn";
 
 import dayjs from "dayjs";
 import { h } from "vue";
@@ -100,11 +100,8 @@ const contentConfig: ContentConfig = {
   statusProp: "companyNo",
   columns,
   apis: {
-    httpList
-  },
-  tagProps: {
-    type: "2",
-    prop: "hpNo"
+    httpList,
+    httpDelete
   },
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"]
 };

+ 8 - 4
src/views/purchase/ticketReturn/config/search.config.ts

@@ -10,10 +10,14 @@ const searchFormConfig: FormConfig = {
       options: STATUS_OPTIONS
     },
     {
-      field: "status",
-      type: "select",
-      placeholder: "审核状态",
-      options: STATUS_OPTIONS
+      field: "payNo",
+      type: "input",
+      placeholder: "对账编号"
+    },
+    {
+      field: "hpNo",
+      type: "input",
+      placeholder: "对账申请编号"
     },
     {
       field: "timer",