yangfeng
2023-07-21 fde4963aaa85d4f02a58ed8d5cc58396604537ae
src/views/sales/masterOrder/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 AddMasterOrderDialog from "@/views/sales/masterOrder/AddMasterOrderDialog"
import { getMasterOrderList } from "@/api/sales/masterOrder"
import { getMasterOrderList, getDelMasterOrder } from "@/api/sales/masterOrder"
export default {
  name: "MasterOrder",
@@ -74,9 +75,9 @@
        tableInfomation: [],
        tableColumn: [
          { label: "单据编号", prop: "number", min: 100 }, // 单据编号
          { label: "客户名称", prop: "client_id", min: 120 }, // 客户名称
          { label: "服务开始时间", prop: "start_time", min: 90 }, // 服务开始时间
          { label: "服务截止时间", prop: "end_time" }, // 服务截止时间
          { label: "客户名称", prop: "client_name", min: 120 }, // 客户名称
          { label: "服务开始时间", prop: "start_time", isTime: true }, // 服务开始时间
          { label: "服务截止时间", prop: "end_time", isTime: true }, // 服务截止时间
          { label: "合同金额", prop: "money" }, // 合同金额
          { label: "负责人", prop: "member_id" } // 负责人
          // { label: "审批状态", prop: "approvalStatus" } // 审批状态
@@ -98,7 +99,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 || []
@@ -128,6 +130,29 @@
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelMasterOrder({ id: id })
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getUserList()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
    },
    getSelectArray(val) {
      console.log(val)
    }
  }
}