yangfeng
2023-07-25 05d33b5bb924e52b9e6185a1006b31a53370d350
src/views/sales/salesDetails/index.vue
@@ -7,9 +7,10 @@
    </div>
    <TableCommonView ref="tableListRef" :show-summary="showSummary" :table-list="tableList">
      <template slot="tableButton">
        <el-table-column label="操作" width="60">
        <el-table-column label="操作" width="90">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
          </template>
        </el-table-column>
      </template>
@@ -21,7 +22,7 @@
<script>
import AddSalesDetailsDialog from "@/views/sales/salesDetails/AddSalesDetailsDialog"
import { getSalesDetailsList } from "@/api/sales/salesDetails"
import { getSalesDetailsList, getDelSalesDetails } from "@/api/sales/salesDetails"
export default {
  name: "SalesDetails",
@@ -86,8 +87,8 @@
        tableInfomation: [],
        tableColumn: [
          { label: "订单编号", prop: "number" },
          { label: "客户名称", prop: "clientId" },
          { label: "签约日期", prop: "signTime" },
          { label: "客户名称", prop: "client_name" },
          { label: "签约日期", prop: "signTime", isTime: true, width: 150 },
          { label: "销售负责人", prop: "memberId" },
          { label: "出库状态", prop: "outboundStatus" },
          { label: "已收总额", prop: "receiveTotalAmount", price: true },
@@ -96,7 +97,7 @@
          { label: "已开票金额", prop: "invoicedAmount", price: true },
          { label: "未开票金额", prop: "uninvoicedAmount", price: true },
          { label: "产品名称", prop: "productName" },
          { label: "数量", prop: "number" },
          { label: "数量", prop: "number1" },
          { label: "含税单价", prop: "taxUnitPrice", price: true },
          { label: "未出库数量", prop: "unOutoundNo" },
          { label: "价税合计", prop: "priceTax", price: true }
@@ -118,7 +119,8 @@
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item
                  ...item,
                  client_name: item.client.name
                }
              })
              this.tableList.tableInfomation = list || []
@@ -148,6 +150,29 @@
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelSalesDetails({ id: id })
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
    },
    getSelectArray(val) {
      console.log(val)
    }
  }
}