فهرست منبع

退款管理: 到款登记

lxf 2 سال پیش
والد
کامیت
b0c679a77f
1فایلهای تغییر یافته به همراه128 افزوده شده و 4 حذف شده
  1. 128 4
      src/views/purchaseManage/purchasePayment/refund/index.vue

+ 128 - 4
src/views/purchaseManage/purchasePayment/refund/index.vue

@@ -23,18 +23,33 @@
         </template>
       </byTable>
     </div>
+
+    <el-dialog title="到款登记" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #receiptAmount>
+          <div style="width: 100%">
+            <el-input-number v-model="formData.data.receiptAmount" placeholder="请输入到款金额" :min="0" :precision="2" :controls="false" style="width: 100%" />
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
-// import byForm from "@/components/byForm/index";
+import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
-// import { ElMessage, ElMessageBox } from "element-plus";
+import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const refundStatus = ref([]);
+const accountList = ref([]);
 const status = ref([
   {
     label: "草稿",
@@ -191,6 +206,18 @@ const getDict = () => {
         });
       }
     });
+  proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    accountList.value = res.rows.map((item) => {
+      return {
+        bankName: item.name,
+        accountOpening: item.accountOpening,
+        openingBank: item.openingBank,
+        interbankNumber: item.interbankNumber,
+        label: item.alias,
+        value: item.id,
+      };
+    });
+  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -210,12 +237,109 @@ const applyForRefund = () => {
     path: "/platform_manage/process/processApproval",
     query: {
       flowKey: "refund_flow",
-      flowName: '退款申请'
+      flowName: "退款申请",
     },
   });
 };
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      label: "应退款信息",
+    },
+    {
+      type: "input",
+      prop: "supplyName",
+      label: "供应商",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "amount",
+      label: "应退金额",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      label: "退款信息",
+    },
+    {
+      type: "select",
+      label: "到款账户",
+      prop: "receiptAccountManagementId",
+      data: accountList.value,
+      itemWidth: 50,
+    },
+
+    {
+      type: "slot",
+      prop: "receiptAmount",
+      slotName: "receiptAmount",
+      label: "到款金额",
+    },
+    {
+      type: "input",
+      prop: "receiptName",
+      label: "对方户名",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "receiptOpeningBank",
+      label: "对方开户银行",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "receiptAccountOpening",
+      label: "对方银行账号",
+      itemType: "text",
+    },
+  ];
+});
+const rules = ref({
+  receiptAccountManagementId: [{ required: true, message: "请选择到款账户", trigger: "change" }],
+  receiptAmount: [{ required: true, message: "请输入到款金额", trigger: "blur" }],
+});
+const formData = reactive({
+  data: {},
+});
 const receiptRegistration = (row) => {
-  console.log(row);
+  formData.data = {
+    supplyName: row.supplyName,
+    amount: row.amount,
+    id: row.id,
+  };
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/refund/receipt/registration", formData.data).then(
+      () => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
 };
 </script>