<template>
  <div>
    <el-form-item label="行项目编号" prop="purchaseNo">
      <el-input
        v-model.trim="searchForm.purchaseNo"
        placeholder="行项目编号"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="物资编号" prop="purchaseCode">
      <el-input
        v-model.trim="searchForm.purchaseCode"
        placeholder="物资编号"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="物资名称" prop="purchaseName">
      <el-input
        v-model.trim="searchForm.purchaseName"
        placeholder="物资名称"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="一级专业分类" prop="purchaseClassificationParent">
      <el-input
        v-model.trim="searchForm.purchaseClassificationParent"
        placeholder="一级专业分类"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="二级专业分类" prop="purchaseClassification">
      <el-input
        v-model.trim="searchForm.purchaseClassification"
        placeholder="二级专业分类"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <!--<el-form-item label="计量单位" prop="purchaseUnit">
      <el-select
        v-model="searchForm.purchaseUnit"
        placeholder="计量单位"
      >
        <el-option
          v-for="item in purchaseUnitList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>-->
    <!--    <el-form-item label="预算净单价(元)" prop="purchaseBudget">-->
    <!--      <el-input-->
    <!--        v-model.trim="searchForm.purchaseBudget"-->
    <!--        placeholder="预算净单价"-->
    <!--        @keyup.enter.native="search.onSearch"-->
    <!--      />-->
    <!--    </el-form-item>-->
    <!--    <el-form-item label="预算净总价(元)" prop="purchaseTotalBudget">-->
    <!--      <el-input-->
    <!--        v-model.trim="searchForm.purchaseTotalBudget"-->
    <!--        placeholder="预算净总价"-->
    <!--        @keyup.enter.native="search.onSearch"-->
    <!--      />-->
    <!--    </el-form-item>-->
    <el-form-item label="采购单位" prop="purchaseDepartName">
      <el-input
        v-model.trim="searchForm.purchaseDepartName"
        placeholder="采购单位"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="所属板块" prop="belongBk">
      <el-select
        v-model="searchForm.belongBk"
        placeholder="所属板块"
      >
        <el-option
          v-for="item in belong_bkList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
    <el-form-item label="计划创建时间" prop="createDate">
      <el-date-picker
        v-model="searchForm.createDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'createTimeStart', 'createTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="采购单编号" prop="tenderNo">
      <el-input
        v-model.trim="searchForm.tenderNo"
        placeholder="采购单编号"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="采购方式" prop="tenderMethod">
      <el-select
        v-model="searchForm.tenderMethod"
        placeholder="采购方式"
      >
        <el-option
          v-for="item in tender_methodList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
    <el-form-item label="公开/邀请" prop="tenderType">
      <el-select
        v-model="searchForm.tenderType"
        placeholder="公开/邀请"
      >
        <el-option
          v-for="item in tenderTypeList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
    <el-form-item label="计划打包员" prop="planDetailPackUser">
      <el-input
        v-model.trim="searchForm.planDetailPackUser"
        placeholder="计划打包员"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="打包提交时间" prop="packSubmitDate">
      <el-date-picker
        v-model="searchForm.packSubmitDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'packSubmitStartTime', 'packSubmitEndTime');
          }
        "
      />
    </el-form-item>
    <el-form-item label="打包完成时间">
      <el-date-picker
        v-model="searchForm.packAuditPassDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'packAuditPassStartTime', 'packAuditPassEndTime');
          }
        "
      />
    </el-form-item>
    <el-form-item label="采购员" prop="sourcingUserRealName">
      <el-input
        v-model.trim="searchForm.sourcingUserRealName"
        placeholder="采购员"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <!--    <el-form-item label="报价截止时间" prop="quoteEndDate">
      <el-date-picker
        v-model="searchForm.quoteEndDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'quoteEndTimeStart', 'quoteEndTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="报价有效期" prop="quoteValidityDate">
      <el-date-picker
        v-model="searchForm.quoteValidityDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'quoteValidityStart', 'quoteValidityEnd');
          }
        "
      />
    </el-form-item>-->
    <el-form-item label="询价方式" prop="quoteMethod">
      <el-select
        v-model="searchForm.quoteMethod"
        placeholder="询价方式"
      >
        <el-option
          v-for="item in protproject_quoteMethodList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
    <el-form-item label="采购单分配时间" prop="packAssignDate">
      <el-date-picker
        v-model="searchForm.packAssignDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'packAssignTimeStart', 'packAssignTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="公告提交时间" prop="projectSubmitDate">
      <el-date-picker
        v-model="searchForm.projectSubmitDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'projectSubmitTimeStart', 'projectSubmitTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="公告审批完成时间" prop="publishDate">
      <el-date-picker
        v-model="searchForm.publishDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'publishTimeStart', 'publishTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="供应商sap编码" prop="partnerNo">
      <el-input
        v-model.trim="searchForm.partnerNo"
        placeholder="供应商sap编码"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="中选结果提交时间" prop="winningSubmitTime">
      <el-date-picker
        v-model="searchForm.winningSubmitTime"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'winningSubmitDateStart', 'winningSubmitDateEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="中选审批完成时间" prop="winningPassDate">
      <el-date-picker
        v-model="searchForm.winningPassDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'winningPassTimeStart', 'winningPassTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="订单编号" prop="orderCode">
      <el-input
        v-model.trim="searchForm.orderCode"
        placeholder="订单编号"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="sap订单编号" prop="ebeln">
      <el-input
        v-model.trim="searchForm.ebeln"
        placeholder="sap订单编号"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <el-form-item label="订单名称" prop="orderName">
      <el-input
        v-model.trim="searchForm.orderName"
        placeholder="订单名称"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>
    <!--<el-form-item label="订单净总额(元)" prop="orderTotalMoney">
      <el-input
        v-model.trim="searchForm.orderTotalMoney"

        placeholder="订单净总额"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>-->
    <el-form-item label="订单生成时间" prop="orderCreateDate">
      <el-date-picker
        v-model="searchForm.orderCreateDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'orderCreateTimeStart', 'orderCreateTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="订单生效时间" prop="activeDate">
      <el-date-picker
        v-model="searchForm.activeDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'activeTimeStart', 'activeTimeEnd');
          }
        "
      />
    </el-form-item>
    <el-form-item label="订单状态" prop="orderStatus">
      <el-select
        v-model="searchForm.orderStatus"
        placeholder="订单状态"
      >
        <el-option
          v-for="item in procurementOrderOrderStatusList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
    <el-form-item label="行项目状态" prop="dataStatus">
      <el-select
        v-model="searchForm.dataStatus"
        placeholder="行项目状态"
      >
        <el-option
          v-for="item in plan_data_statusList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
    <!--<el-form-item label="打包完成时效" prop="durationDate">
      <el-input
        v-model.trim="searchForm.durationDate"
        placeholder="打包完成时效"
        @keyup.enter.native="search.onSearch"
      />
    </el-form-item>-->
    <el-form-item label="计划上报审批时间" prop="approvalDate">
      <el-date-picker
        v-model="searchForm.approvalDate"
        type="daterange"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        @change="
          (val) => {
            handleCreateTime(val, 'approvalStartTime', 'approvalEndTime');
          }
        "
      />
    </el-form-item>
    <el-form-item label="框架协议" prop="planType">
      <el-select
        v-model="searchForm.planType"
        placeholder="框架协议"
      >
        <el-option
          v-for="item in isFramePlanList"
          :key="item.typecode"
          :label="item.typename"
          :value="item.typecode"
        />
      </el-select>
    </el-form-item>
  </div>
</template>

<script>
import { statisticalMixins } from '../../mixins/statisticalMixins'// 字典信息
export default {
  name: 'RowProjectDetailReportSearchComp',
  mixins: [statisticalMixins],
  props: {
    search: {
      type: Object,
      default: function() {
        return {}
      }
    },
    searchForm: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
    }
  },
  methods: {
    // 处理搜索时间格式
    handleCreateTime(val, start, end) {
      if (val) {
        this.searchForm[start] = this.$Moment(val[0]).format(this.momentDate) // 开始时间
        this.searchForm[end] = this.$Moment(val[1]).format(this.momentDate) // 结束时间
      }
    }
  }
}
</script>

<style lang="less" scoped>
</style>
