Selaa lähdekoodia

退款管理 列表页

lxf 2 vuotta sitten
vanhempi
commit
28b4f48096

+ 2 - 2
src/views/finance/fundManage/flow/index.vue

@@ -19,7 +19,7 @@
           <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>
+            <span>{{ moneyFormat(item.amount, 2) }}</span>
           </div>
         </template>
       </byTable>
@@ -29,7 +29,7 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
         <template #transactionTime>
           <div>
-              <el-date-picker v-model="formData.data.transactionTime" type="datetime" placeholder="请选择交易时间" value-format="YYYY-MM-DD HH:mm:ss" />
+            <el-date-picker v-model="formData.data.transactionTime" type="datetime" placeholder="请选择交易时间" value-format="YYYY-MM-DD HH:mm:ss" />
           </div>
         </template>
         <template #money>

+ 0 - 7
src/views/purchaseManage/purchasePayment/invoice/index.vue

@@ -15,13 +15,6 @@
           },
         ]"
         @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>
 

+ 220 - 0
src/views/purchaseManage/purchasePayment/refund/index.vue

@@ -0,0 +1,220 @@
+<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: () => applyForRefund(),
+          },
+        ]"
+        @get-list="getList">
+        <template #amount="{ item }">
+          <div style="color: #409eff">{{ moneyFormat(item.amount, 2) }}</div>
+        </template>
+        <template #sumRefundMoney="{ item }">
+          <div>{{ moneyFormat(item.sumRefundMoney, 2) }}</div>
+        </template>
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+// import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+// import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const refundStatus = 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: "",
+    refundStatus: "",
+    status: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "退款状态",
+      prop: "refundStatus",
+      data: refundStatus.value,
+    },
+    {
+      label: "审批状态",
+      prop: "status",
+      data: status.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "供应商",
+        prop: "supplyName",
+        width: 300,
+      },
+    },
+    {
+      attrs: {
+        label: "应退款金额",
+        slot: "amount",
+      },
+    },
+    {
+      attrs: {
+        label: "已退款金额",
+        slot: "sumRefundMoney",
+      },
+    },
+    {
+      attrs: {
+        label: "申请人",
+        prop: "refundName",
+      },
+    },
+    {
+      attrs: {
+        label: "申请时间",
+        prop: "refundTime",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "审批状态",
+        prop: "status",
+      },
+      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: "refundStatus",
+      },
+      render(type) {
+        let text = "";
+        if (refundStatus.value && refundStatus.value.length > 0) {
+          let data = refundStatus.value.filter((item) => item.value == type);
+          if (data && data.length > 0) {
+            text = data[0].label;
+          }
+        }
+        return text;
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "到款登记",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              receiptRegistration(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      dictCode: "refund_status",
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        refundStatus.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("/refund/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 receiptRegistration = (row) => {
+  console.log(row);
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>