yangfeng
2023-07-19 23d80c1b64f23ede237ab8e89ebc2ee2aaf43f26
src/views/sales/salesDetails/index.vue
@@ -21,6 +21,7 @@
<script>
import AddSalesDetailsDialog from "@/views/sales/salesDetails/AddSalesDetailsDialog"
import { getSalesDetailsList } from "@/api/sales/salesDetails"
export default {
  name: "SalesDetails",
@@ -77,34 +78,17 @@
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            orderNumber: "XSHT265",
            customName: "55555",
            signDate: "2023-06-25",
            salesHead: "系统管理员",
            outboundStatus: "未出库",
            receiveTotalAmount: "8000.00",
            total: "8000.00",
            amountReceivable: "8000.00",
            invoicedAmount: "8000.00",
            uninvoicedAmount: "8000.00",
            productName: "自动打印机",
            number: "1.00",
            taxUnitPrice: "8000.00",
            unOutoundNo: "1.00",
            priceTax: "8000.00"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "订单编号", prop: "orderNumber" },
          { label: "客户名称", prop: "customName" },
          { label: "签约日期", prop: "signDate" },
          { label: "销售负责人", prop: "salesHead" },
          { label: "订单编号", prop: "number" },
          { label: "客户名称", prop: "clientId" },
          { label: "签约日期", prop: "signTime" },
          { label: "销售负责人", prop: "memberId" },
          { label: "出库状态", prop: "outboundStatus" },
          { label: "已收总额", prop: "receiveTotalAmount", price: true },
          { label: "合计", prop: "total", price: true },
@@ -124,54 +108,46 @@
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getSalesDetailsList()
        .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
      this.editConfig.title = "新建"
      this.editConfig.infomation = {
        customName: "",
        orderNumber: "XSHT521",
        salesOpportunity: "",
        selSourceOrder: "",
        signDate: "",
        salesHead: "",
        deliveryDate: "",
        wechatOrderStatus: "",
        consignee: "",
        consigneeContactInfo: "",
        shippingAddress: "",
        termsTreaty: "",
        notes: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
      this.editConfig.infomation = {}
    },
    // 编辑
    handleClick(row) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = {
        customName: "",
        orderNumber: "XSHT521",
        salesOpportunity: "",
        selSourceOrder: "",
        signDate: "",
        salesHead: "",
        deliveryDate: "",
        wechatOrderStatus: "",
        consignee: "",
        consigneeContactInfo: "",
        shippingAddress: "",
        termsTreaty: "",
        notes: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
      this.editConfig.infomation = { ...row }
    }
  }
}