Newer
Older
smartKitchenFront / src / components / mycomponent / dialog / productBindDialog.vue
<!--产品列表绑定服务弹窗-->
<template>
  <el-dialog title="绑定服务" width="900px" :visible.sync="isShowInfo" append-to-body @close="close">
    <div class="product-inputBox">
      <div class="input-item">
        产品型号:
        <el-input v-model="dataInfo.productCode" disabled style="width:200px" />
      </div>
      <div class="input-item">
        产品名称:
        <el-input v-model="dataInfo.productName" disabled style="width:200px" />
      </div>
    </div>
    <div class="product-bindTable">
      <div class="bindBtn">
        <el-button type="primary" @click="bindServeClick">
          添加服务
        </el-button>
      </div>
      <el-table ref="tb" :data="tableData" border class="el-tab" style="width: 100%;">
        <el-table-column type="index" label="序号" width="60px" />
        <el-table-column prop="serviceCode" label="服务编号">
          <template slot-scope="{row,$index}">
            <el-select v-model="brandName" clearable placeholder="请选择">
              <el-option
                v-for="item in serviceList"
                :key="item.brandCode"
                :label="item.brandName"
                :value="item.brandName"
              />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="typeCode" label="服务类型" />
        <el-table-column prop="description" label="服务描述" />
        <el-table-column prop="serviceTime" label="服务时间" />
        <el-table-column prop="remark" label="备注" />
      </el-table>
    </div>
    <div class="btnBox">
      <el-button type="primary" class="save" @click="save">
        保存
      </el-button>
      <el-button type="info" class="close" @click="close">
        取消
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
import { M_list } from '../../../api/server/Management'

export default {
  props: {
    dataInfo: {
      type: Object,
      dataInfo: {}
    }
  },
  data() {
    return {
      tableData: [],
      isShowInfo: true,
      serviceList: [],
      brandName: ''
    }
  },
  mounted() {
    M_list().then(res => {
      console.log(res)
    })
  },
  methods: {
    close() {
      this.$emit('close')
    },
    bindServeClick() {
      const obj = {}
      obj.serviceCode = '',
      obj.typeCode = '',
      obj.description = '',
      obj.serviceTime = '',
      obj.remark = ''
      this.tableData.push(obj)
    }
  }
}
</script>

<style lang='scss' scoped>
.product-inputBox {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.product-bindTable {
  display: flex;
  flex-direction: column;
  align-items: flex-end;

  .bindBtn {
    margin-bottom: 10px;
  }
}

.btnBox {
  padding: 30px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-evenly;

  .save,
  .close {
    width: 100px;
  }

}
</style>