<template>
  <div>
    <el-form>
      <el-row :gutter="20" class="el-row" type="flex">
        <el-col :span="24" class="el-col">
          <el-form-item label="单据类型名称" label-width="120px">
            <el-input
              style="width: 90%"
              size="small"
              clearable
              splaceholder="请输入内容"
              :disabled="!isAdd"
              v-model.trim="inputQuery.name"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="el-row" type="flex">
        <el-col :span="24" class="el-col">
          <el-form-item label="单据类型代码" label-width="120px">
            <el-input
              style="width: 90%"
              :disabled="!isAdd"
              clearable
              size="small"
              splaceholder="请输入内容"
              v-model.trim="inputQuery.action"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="20" class="el-row" type="flex">
        <el-col :span="24" class="el-col">
          <el-form-item label="第三方系统:" label-width="120px">
            <el-select v-model="inputQuery.thirdSys" placeholder="请选择第三方系统" clearable="true" style="width: 90%">
              <el-option
                v-for="item in thirdSys"
                :key="item.value"
                :label="item.thirdName"

                :value="item.thirdId">
                <span style="float: left">{{ item.thirdName }}</span>
                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>


      <el-row :gutter="20" class="el-row" type="flex">
        <el-col :span="24" class="el-col">
          <el-form-item label-width="120px" label="备注:">
            <el-input
              style="width: 90%"
              size="small"
              type="textarea"
              :rows="3"
              splaceholder="请输入内容"
              v-model="inputQuery.remark"
            ></el-input>
          </el-form-item>

        </el-col>

      </el-row>
    </el-form>
  </div>
</template>

<script>

import {
  getBasicThirdSys,
} from "@/api/thrsys/basicThirdSys";

export default {
  name: "inputQuery",
  props: {
    inputQuery: {
      type: Object,
      required: true,
    },
  },

  data() {
    return {
      filterQuery: {
        enabled: true,
        isBuType: true,
      },
      thirdSys: [],
      isAdd: false,
      value: "",
    }
  },
  methods: {
    getList() {
      getBasicThirdSys(this.filterQuery)
        .then((response) => {
          this.thirdSys = response.data.list || [];
        })
        .catch(() => {
          this.loading = false;
          this.list = [];
        });
    },

  },

  created() {
    if (this.inputQuery.action == "") {
      this.isAdd = true;
    }
    this.getList();
  },
};
</script>

<style scoped>
.itemTag {
  float: left;
  text-align: left;
  margin-top: 10px;
  width: 100px;
}

.text {
  font-size: 13px;
  font-family: "Microsoft YaHei";
}

</style>
