<template>
  <div class="app-container">
    <div>{{ message }}</div>
    <el-table
      :key="contact.tableKey"
      v-loading="contact.listLoading"
      element-loading-text="给我一点时间"
      :data="contact.list"
      border
      fit
      highlight-current-row
      style="width: 100%"
      :row-style="rowStyle"
      :cell-style="cellStyle"
      class="elTable table-fixed"
    >
      <el-table-column label="序号" align="center" type="index" width="50px">
        <template slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>

      <el-table-column label="产品名称" min-width="110px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.pname }}</span>
        </template>
      </el-table-column>
      <el-table-column label="型号" min-width="110px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.model }}</span>
        </template>
      </el-table-column>
      <el-table-column label="规格" min-width="110px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.Specifications }}</span>
        </template>
      </el-table-column>
      <el-table-column label="数量" min-width="110px" align="center">
        <template slot-scope="scope">
          <span v-if="create.dialogStatus == 'see'">{{ scope.row.nums }}</span>
          <el-input
            v-if="
              create.dialogStatus == 'update' || create.dialogStatus == 'create'
            "
            v-model="scope.row.nums"
            style="width: 95%; padding: 10px 0"
          />
        </template>
      </el-table-column>

      <el-table-column label="备注" min-width="280px" align="center">
        <template slot-scope="scope">
          <span v-if="create.dialogStatus == 'see'">{{
            scope.row.remark
          }}</span>
          <el-input
            v-if="
              create.dialogStatus == 'update' || create.dialogStatus == 'create'
            "
            v-model="scope.row.remark"
            type="textarea"
            :autosize="{ minRows: 1.3, maxRows: 4 }"
            style="width: 95%; padding: 10px 0"
          />
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        width="110"
        class-name="small-padding fixed-width"
        fixed="right"
      >
        <template slot-scope="{ row }">
          <el-button class="miniDanger" @click="form_delete2(row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {
  GetDataByName,
  PostDataByName,
  failproccess,
  ExecDataByConfig,
  GetDataByNames,
  checkButtons,
  calculativeWidth,
} from "@/api/common";
import Cookies from "js-cookie";
import { parseTime } from "@/utils/index.js";
import Pagination from "@/components/Pagination";
import { MessageBox } from "element-ui";
export default {
  name: "LittleTable",
  components: { Pagination },
  data() {
    return {
      message: "",
      isRoleEdit: [],
      contact: {
        dialogFormVisible: false,
        dialogStatus: "",
        temp: {
          id: "",
          contactName: "",
          telephone: "",
          address: "",
          remark: "",
        },
        rules: {},
        getdataListParm: {
          name: "getContacts",
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: "Map",
          parammaps: { customerId: "" },
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: false,
      },
    };
  },

  created() {},

  methods: {},
};
</script>
<style lang="scss" scoped>
.search {
  padding-top: 10px;
  clear: both;
}
.table {
  margin-top: 10px;
}
</style>
