yangfeng
2023-07-19 4898b385886794bf0663ec2d883ea808b78ae522
src/views/sales/refundForm/index.vue
@@ -21,6 +21,7 @@
<script>
import AddRefundFormDialog from "@/views/sales/refundForm/AddRefundFormDialog"
import { getSalesRefundList } from "@/api/sales/refundForm"
export default {
  name: "RefundForm",
@@ -62,23 +63,12 @@
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            refundOrderNo: "TKD20220118-44",
            customName: "万科物料发展有限公司",
            refundDate: "2022-01-18",
            account: "人民币账户",
            whetherInvoicing: "未开",
            paymentMethod: "现金",
            salesHead: "系统管理员",
            modifyTime: "202-01-18 13:11:05",
            priceTax: "¥12.00"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "退款单编号", prop: "refundOrderNo" },
          { label: "客户名称", prop: "customName", min: 120 },
@@ -97,6 +87,34 @@
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getSalesRefundList()
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item
                }
              })
              this.tableList.tableInfomation = list || []
            } else {
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true