Newer
Older
smartKitchenFront / src / views / server / operation.vue
liuyangyingjie on 26 Oct 2022 4 KB first commit
<template>
  <div class="product_container">
    <div class="productFun">
      <div class="productInput">
        服务名称
        <div class="inputBox" style="width: 120px">
          <el-input
            placeholder="请输入服务名称"
            v-model="input"
            clearable
            class="product-input"
          >
          </el-input>
        </div>
      </div>
      <div class="productBtn">
         <el-button type="primary" icon="el-icon-search" class="btnItem"
          >查询</el-button
        >
        
        <el-button
          type="success"
          icon="el-icon-circle-plus-outline"
          class="btnItem bggreen"
          @click="addCategory"
          >新增</el-button
        >
        <el-button type="danger" icon="el-icon-delete-solid" class="btnItem bgred"
          >删除</el-button
        >
        
      </div>
    </div>
    <el-table
      :data="tableData"
      :row-class-name="tableRowClassName"
      :header-cell-style="{
        'text-align': 'center',
        background: '  #2483b3',
        color: 'white',
      }"
      :row-style="{ 'text-align': 'center' }"
      style="width: 100%"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="date" label="服务运营编号"> </el-table-column>
      <el-table-column prop="name" label="服务名称"> </el-table-column>
      <el-table-column prop="address" label="服务收费(元)"> </el-table-column>
      <el-table-column prop="address" label="服务优惠"> </el-table-column>
      <el-table-column prop="address" label="时间"> </el-table-column>
      
      <el-table-column label="操作">
        <template slot-scope="scope">
         
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >编辑</el-button
          >
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >删除</el-button
          >
          <!-- <el-button type="text" size="small">编辑</el-button> -->
        </template>
      </el-table-column>
    </el-table>
    <div class="footer">
      <div>共6条记录 第1/6页</div>
      <div>
        <el-pagination
          background
          layout="  prev, pager, next,sizes, jumper"
          :page-size="10"
          :total="100"
        >
        </el-pagination>
      </div>
      <!-- <div>页码</div> -->
    </div>
    <!-- 新增弹框 -->
   
    <!-- <brand-add-dialog ></brand-add-dialog> -->
    <operation-add-dialog  :isShowInfo="isShowAdd"
      @close="closeAdd"></operation-add-dialog>
  </div>
</template>
  
  <script>
//组件
// import BrandAddDialog from '../../components/mycomponent/dialog/brandAddDialog.vue';
import OperationAddDialog from '../../components/mycomponent/dialog/server/operationAddDialog.vue';

//逻辑
import { tableRowClassName } from "../../utils/myUtils/changeTableTr";
export default {
  components: {
    OperationAddDialog,
  },
  data() {
    return {
      isShowAdd: false, //显示新增功能
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      value: "",
    };
  },
  methods: {
    tableRowClassName: tableRowClassName,
    closeAdd() {
      this.isShowAdd = false;
    },
    addCategory() {
      this.isShowAdd = true;
    },
  },
};
</script>
  
  <style lang="scss" scoped>
.product_container {
  position: relative;
  width: 100%;
  min-height: 700px;
  overflow: auto;
  .productData {
    width: 100%;
    display: flex;
    justify-content: center;
    .middle {
      margin: 0 30px;
    }
  }
  .productFun {
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
    .productInput {
      display: flex;
      align-items: center;
      .inputBox {
        margin: 0 50px 0 10px;
      }
    }
    .productBtn {
      .btnItem {
        margin-right: 10px;
        border-radius: 5px;
        // height: 32px;
        // width: 84px;
        font-size: 16px;
      }
      
    }
  }
  .footer {
    display: flex;
    justify-content: space-between;
    color: #6666;
    margin: 30px 10px;
  }
}
</style>