lxf 2 жил өмнө
parent
commit
8dc3aad50b

+ 238 - 0
src/components/process/PurchasePayment.vue

@@ -0,0 +1,238 @@
+<template>
+    <div style="width: 100%; padding: 0px 15px">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"></byForm>
+    </div>
+  </template>
+  
+  <script setup>
+  import byForm from "@/components/byForm/index";
+  import { ElMessage, ElMessageBox } from "element-plus";
+  import SelectGoods from "@/components/product/SelectGoods";
+  import useUserStore from "@/store/modules/user";
+  
+  const { proxy } = getCurrentInstance();
+  const supplierList = ref([]);
+  let formData = reactive({
+    data: {
+      supplyId: "",
+      deptName: "",
+      refundName: "",
+      amount: "",
+      remark: "",
+      refundTime: "",
+      refundDetailList: [],
+    },
+  });
+  const submit = ref(null);
+  const formOption = reactive({
+    inline: true,
+    labelWidth: 100,
+    itemWidth: 100,
+    rules: [],
+  });
+  const formConfig = computed(() => {
+    return [
+      {
+        type: "select",
+        label: "供应商",
+        prop: "supplyId",
+        data: supplierList.value,
+        fn: (val) => {
+          changeSupply(val);
+        },
+        disabled: formData.data.id,
+      },
+      {
+        type: "select",
+        label: "发票类型",
+        prop: "type",
+        data: invoiceType.value,
+      },
+      {
+        type: "slot",
+        prop: "money",
+        slotName: "money",
+        label: "开票金额",
+      },
+      {
+        type: "slot",
+        prop: "file",
+        slotName: "file",
+        label: "上传附件",
+      },
+      {
+        type: "slot",
+        prop: "information",
+        slotName: "information",
+        label: "发票信息",
+      },
+    ];
+  });
+  let rules = ref({
+    supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
+    count: [{ required: true, message: "请输入退货数量", trigger: "blur" }],
+    remark: [{ required: true, message: "请输入退货原因", trigger: "blur" }],
+  });
+  const getDict = () => {
+    //   proxy
+    //     .post("/dictTenantData/page", {
+    //       pageNum: 1,
+    //       pageSize: 999,
+    //       dictCode: "invoice_type",
+    //       tenantId: useUserStore().user.tenantId,
+    //     })
+    //     .then((res) => {
+    //       if (res.rows && res.rows.length > 0) {
+    //         invoiceType.value = res.rows.map((item) => {
+    //           return {
+    //             label: item.dictValue,
+    //             value: item.dictKey,
+    //           };
+    //         });
+    //       }
+    //     });
+    proxy.post("/supplierInfo/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        supplierList.value = res.rows.map((item) => {
+          return {
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  };
+  getDict();
+  //   const formOption = reactive({
+  //     inline: true,
+  //     labelWidth: 100,
+  //     itemWidth: 100,
+  //   });
+  //   const formConfig = computed(() => {
+  //     return [
+  //       {
+  //         type: "input",
+  //         prop: "returnDept",
+  //         label: "申请部门",
+  //         itemWidth: 25,
+  //         disabled: true,
+  //         style: {
+  //           "margin-right": "10px",
+  //         },
+  //       },
+  //       {
+  //         type: "input",
+  //         prop: "returnName",
+  //         label: "申请人",
+  //         itemWidth: 25,
+  //         disabled: true,
+  //         style: {
+  //           "margin-right": "10px",
+  //         },
+  //       },
+  //       {
+  //         type: "date",
+  //         prop: "purchaseTime",
+  //         label: "申请时间",
+  //         itemWidth: 25,
+  //         disabled: true,
+  //         style: {
+  //           "margin-right": "10px",
+  //         },
+  //       },
+  //       {
+  //         type: "select",
+  //         prop: "supplyId",
+  //         label: "供应商",
+  //         isLoad: {
+  //           url: "/supplierInfo/page",
+  //           req: {
+  //             pageNum: 1,
+  //             pageSize: 9999,
+  //           },
+  //           labelKey: "name",
+  //           labelVal: "id",
+  //           method: "post",
+  //           resUrl: "rows",
+  //         },
+  //       },
+  //       {
+  //         type: "slot",
+  //         slotName: "details",
+  //         label: "退货明细",
+  //       },
+  //     ];
+  //   });
+  //   const formDom = ref(null);
+  //   const handleSubmit = async () => {
+  //     const vaild = await formDom.value.handleSubmit(() => {}); //拿到内部表单是否验证通过
+  //     if (vaild) {
+  //       if (formData.data.salesReturnDetailList.length > 0) {
+  //         const list = formData.data.salesReturnDetailList;
+  //         for (let i = 0; i < list.length; i++) {
+  //           const e = list[i];
+  //           if (e.count == 0) {
+  //             ElMessage({
+  //               message: "退货数量不能为0!",
+  //               type: "info",
+  //             });
+  //             return false;
+  //           }
+  //         }
+  //         return true;
+  //       }
+  //       ElMessage({
+  //         message: "请添加退货明细!",
+  //         type: "info",
+  //       });
+  //       return false;
+  //     }
+  //   };
+  //   let openProduct = ref(false);
+  //   const handleRemove = (index) => {
+  //     formData.data.salesReturnDetailList.splice(index, 1);
+  //     return ElMessage({
+  //       message: "删除成功!",
+  //       type: "success",
+  //     });
+  //   };
+  //   const pushGoods = (goods) => {
+  //     const arr = goods.map((x) => ({
+  //       goodType: x.goodType,
+  //       productCode: x.code,
+  //       productName: x.name,
+  //       productSpec: x.spec,
+  //       productUnit: x.unit,
+  //       count: 0,
+  //       bussinessId: x.id,
+  //       remark: "",
+  //     }));
+  //     formData.data.salesReturnDetailList =
+  //       formData.data.salesReturnDetailList.concat(arr);
+  //     return ElMessage({
+  //       message: "添加成功!",
+  //       type: "success",
+  //     });
+  //   };
+  
+  //   // 接收父组件的传值
+  //   const props = defineProps({
+  //     queryData: String,
+  //   });
+  
+  //   // 获取用户信息并赋默认值
+  //   const userInfo = useUserStore().user;
+  //   onMounted(() => {
+  //     formData.data.purchaseTime = proxy.parseTime(new Date());
+  //     formData.data.returnDept = userInfo.dept.deptName;
+  //     formData.data.returnName = userInfo.nickName;
+  //   });
+  //   // 向父组件暴露
+  //   defineExpose({
+  //     submitData: formData.data,
+  //     handleSubmit,
+  //   });
+  </script>
+  
+  <style lang="scss" scoped></style>
+  

+ 11 - 0
src/views/process/processApproval/index.vue

@@ -29,6 +29,11 @@
           v-else-if="flowForm.flowKey == 'refund_flow'"
           :queryData="queryData.data"
         ></PurchaseRefund>
+        <PurchasePayment
+          ref="makeDom"
+          v-else-if="flowForm.flowKey == 'pay_flow'"
+          :queryData="queryData.data"
+        ></PurchasePayment>
       </div>
       <div class="bottom">
         <div class="commons-title title">处理意见</div>
@@ -111,6 +116,8 @@ import ReturnGood from "@/components/process/ReturnGood";
 import { ElMessage, ElMessageBox } from "element-plus";
 //退款
 import PurchaseRefund from "@/components/process/PurchaseRefund";
+// 付款
+import PurchasePayment from "@/components/process/PurchasePayment";
 
 const router = useRouter();
 const route = useRoute();
@@ -220,6 +227,10 @@ const skipPage = () => {
     router.replace({
       path: "/purchaseManage/purchasePayment/invoice",
     });
+  } else if (flowForm.flowKey == "pay_flow") {
+    router.replace({
+      path: "/purchaseManage/purchasePayment/payment",
+    });
   }
 };
 let queryData = reactive({

+ 268 - 0
src/views/purchaseManage/purchasePayment/payment/index.vue

@@ -0,0 +1,268 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        :selectConfig="selectConfig"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '发起申请',
+            action: () => purchasePayment(),
+          },
+        ]"
+        @get-list="getList">
+        <!-- <template #amount="{ item }">
+            <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
+              <span style="padding-right: 4px">{{ item.currency }}</span>
+              <span v-if="item.status === '20'">-</span>
+              <span>{{ moneyFormat(item.amount) }}</span>
+            </div>
+          </template> -->
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import useUserStore from "@/store/modules/user";
+// import { ElMessage } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const payStatus = ref([]);
+const fundsPaymentMethod = ref([]);
+const status = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "终止",
+    value: 99,
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    status: "",
+    payStatus: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "审批状态",
+      prop: "status",
+      data: status.value,
+    },
+    {
+      label: "付款状态",
+      prop: "payStatus",
+      data: payStatus.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "供应商",
+        prop: "supplyName",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "申请金额",
+        prop: "amount",
+      },
+    },
+    {
+      attrs: {
+        label: "付款说明",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "付款方式",
+        prop: "payType",
+      },
+      render(type) {
+        let text = "";
+        if (fundsPaymentMethod.value && fundsPaymentMethod.value.length > 0) {
+          let data = fundsPaymentMethod.value.filter((item) => item.value == type);
+          if (data && data.length > 0) {
+            text = data[0].label;
+          }
+        }
+        return text;
+      },
+    },
+    {
+      attrs: {
+        label: "付款账户",
+        prop: "accountManagementId",
+      },
+    },
+    {
+      attrs: {
+        label: "申请人",
+        prop: "userName",
+      },
+    },
+    {
+      attrs: {
+        label: "申请时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "审批状态",
+        prop: "status",
+        width: 140,
+      },
+      render(type) {
+        let text = "";
+        if (status.value && status.value.length > 0) {
+          let data = status.value.filter((item) => item.value == type);
+          if (data && data.length > 0) {
+            text = data[0].label;
+          }
+        }
+        return text;
+      },
+    },
+    {
+      attrs: {
+        label: "付款状态",
+        prop: "payStatus",
+        width: 140,
+      },
+      render(type) {
+        let text = "";
+        if (payStatus.value && payStatus.value.length > 0) {
+          let data = payStatus.value.filter((item) => item.value == type);
+          if (data && data.length > 0) {
+            text = data[0].label;
+          }
+        }
+        return text;
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPrint(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      dictCode: "pay_status",
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        payStatus.value = res.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+      }
+    });
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      dictCode: "funds_payment_method",
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        fundsPaymentMethod.value = res.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+      }
+    });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/pay/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+const purchasePayment = () => {
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "pay_flow",
+      flowName: '付款申请'
+    },
+  });
+}
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>