<template>
  <div class="page-byh-service">
    <block-header title="搜索"/>
    <div class="page-search">
      <el-form size="small" label-suffix=":" :inline="true" label-width="180px" ref="refForm" :model="form"
               class="demo-form-inline">
        <el-form-item prop="coopOrderNo" label="三方订单编号查询">
          <el-input
              style="width: 380px"
              clearable
              v-model.trim="form.coopOrderNo"
              @keyup.enter.native="onSubmit"
              placeholder="三方订单编号"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
          <el-button @click="onReset('refForm')">清空</el-button>
        </el-form-item>
      </el-form>
    </div>

    <block-header title="客户列表"></block-header>
    <div class="block-box" >
      <el-table
          border
          size="mini"
          :highlight-current-row="true"
          :header-row-class-name="headerStyle"
          :data="data" stripe style="width: 100%;">
        <el-table-column align="center" width="140" prop="productName" label="产品名称"></el-table-column>
        <el-table-column align="center" prop="coopOrderNo" label="订单编号"></el-table-column>
        <el-table-column align="center" prop="clientNo" label="客户编号"></el-table-column>
        <el-table-column align="center" prop="clientName" label="姓名"></el-table-column>
        <el-table-column align="center" prop="clientCell" label="手机号"></el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import * as moment from "moment";

export default {
  name: "orderNumberSearch",
  data() {
    return {

      form: {
        coopOrderNo: ""
      },

      visible: false,
      title: "基本信息",
      items: {},

      mcItems: null,
      mcTitle: "",
      ActiveCom: "",
      zyItem:"",
      data: []
    }
  },
  created() {

  },

  methods: {
    /** 表格样式 */
    headerStyle() {
      return "tableHeaderStyle";
    },

    /** 初始化订单列表 **/
    async init() {
      try {
        const params = this.form
        const form = Object.assign({}, params)
        const res = await this.$$post('/outsourcing/tripartiteOrderQuery', {...form})
        if (res.status === 200 && res.data.success) {
            const { result}=res.data
            result.map(item =>{
                this.data=[{...item}];
            })
           
        } else {
          this.$message.error(res.data.message);
        }
      } catch (err) {
        this.$Message.error(err || '系统异常');
        console.log(err, '初始化协议列表错误')
      }
    },
    /** 搜索提交 */
    onSubmit() {
      this.init()
    }

  }
}


</script>

<style scoped>
.link-active, .link-null {
  text-decoration: none;
}

.link-active {
  color: #155bd4;
}

ul, li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-table {
  margin-bottom: 20px;
}

.pages {
  display: flex;
  align-items: center;
  justify-content: center;
}

</style>
