<template>
  <div class="mc-wrap">
    <div class="container-box">
    <div class="car-line">
      <div style="padding-top:20px;"></div>
      <div class="task_list">  
          <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
      </div>
      <div class="task_list">  
          <el-table   
                  class="com-table" 
                  ref="multipleTable" 
                  :data="itemList"  
                  tooltip-effect="dark"   
                  size="small"  
                  border 
                  style="width: 100%" 
                  height="350px" 
                  v-loading="toDoLoading"  
                  :cell-style="{ background: '#fff' }"
                >
              <el-table-column type="index" width="50" align="center" label="序号"></el-table-column>
              <el-table-column label="工单编号" prop="itemId" align="center" width="150px"></el-table-column>
              <el-table-column label="工单名称" prop="itemName"></el-table-column>
              <el-table-column label="任务编号" prop="woNo" align="center" width="150px"></el-table-column>
              <el-table-column label="工单状态" align="center" width="80px">
                <template slot-scope="scope">
                    {{parserItemStatus(scope.row.itemStatus)}}
                </template>
              </el-table-column>
              <el-table-column label="创建人"   prop="createLoginName"  align="center" width="120px"></el-table-column>
              <el-table-column label="创建时间" prop="createTime" align="center" width="140px"></el-table-column>
              <el-table-column label="操作" align="center" width="100px">
                <template slot-scope="scope">
                    <el-button type="text" size="small" @click="viewItem(scope.row.itemId)">查看</el-button>
                </template>
              </el-table-column>
          </el-table>
      </div>
    </div>

    <itemDialog :dialogVisible="dialogVisible" :itemId="curItemId" @closeWin="closeWin"></itemDialog>

    </div>
  </div>
</template>
<script>
import mySearch from "@/components/search";
//import itemDialog from "./deal/itemDialog";
import itemDialog from "./deal/itemDialog";

export default {
  components: {mySearch,itemDialog},
  data() {
    return {
      itemList:[],
      toDoLoading:false,
      dialogVisible:false,
      curItemId:'',
      searchList: [
        {type: "input",	tit: "工单名称",	value: "",	width: "20%"},
        {type: "input",	tit: "产品名称",	value: "",	width: "20%"},
        {type: "input",	tit: "业务类型",	value: "",	width: "20%"},
        {type: "input",	tit: "企业名称",	value: "",	width: "20%"},
        //{type: "input",	tit: "创建人",	value: "",	width: "15%"},
        {
          type: "sel",
          tit: "工单状态",
          value: "",
          width: "20%",
          options: [
            { dataCode: "2", dataName: "办理中" },
            { dataCode: "1", dataName: "已归档" },
          ],
        },
      ],
    };
  },
  methods: {
    handleClick(){

    },
    
    loadItemList(params){

      let userInfo = window.sessionStorage.userInfo;
      if(null === userInfo){
            this.$message({ showClose: true, message: "数据异常",type: 'error'});
            return 
      }
      userInfo = JSON.parse(userInfo);
      let loginNoStr = userInfo.loginNoStr;  
      params.createLogin = loginNoStr
      this.toDoLoading = true;
      this.$http({
        url: "/market/tvImport/queryImportItem",
        method: "post",
        headers: {
          "Content-Type": "application/json",
          page: '{"pageNo":"' + 1 + '","pageSize":"10"}'
        },
        data:params
      }).then((res) => {
        this.itemList = res.data.data
        this.toDoLoading = false;
      });
    },

    viewItem(itemId){
      this.curItemId = itemId
      this.dialogVisible = true
    },
    closeWin(){
      this.dialogVisible = false
    },
  
    searchInfo(v) {
      let searchParams = {};
      v[0] ? (searchParams.itemName = v[0]) : "";
      v[1] ? (searchParams.productName = v[1]) : "";
      v[2] ? (searchParams.busiType = v[2]) : "";
      v[3] ? (searchParams.parterName = v[3]) : "";
      //v[4] ? (searchParams.createLoginName = v[4]) : "";    
      v[4] ? (searchParams.itemStatus = v[4]) : "";     
      this.loadItemList(searchParams);
    },

    parserItemStatus(status){
        if(status==='1'){
          return "已归档"
        }else if(status==='2'){
          return "办理中"
        }
    },
    
  },
  mounted() {
    this.loadItemList({})
  },
  created() {

  },
};
</script>

<style lang="scss" scoped>
.mc-wrap {
  box-sizing: border-box !important;
  margin: 0;
  height: calc(100vh - 120px);
  overflow: hidden;
  width: 100%;
  padding-right: 15px;

  .container-box {
    width: 100%;
    height: calc(100% - 40px);
    margin-top: 20px;
    overflow-y: scroll;
    padding: 0 0 0 15px;
  }

  .tit {
    height: 30px;
    background: #fff;
    line-height: 35px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
  }
}

.mc-top {
  display: flex;
  width: 100%;
}

.mc-wrap .mc-top-left {
  width: 100%;
  margin-right: 15px;
}

.car-line-knowledge {
  min-height: 250px;
  max-height: 250px;
  background: #fff;
  //   margin: 10px 0 0 0;
  margin-left: 10px;
  overflow-y: auto;

  .car-box {
    padding: 0 20px;
    line-height: 44px;
    height: 44px;
    color: #333;
    border-bottom: 1px solid #c1abfc;

    span {
      cursor: pointer;
      margin-right: 20px;
    }

    span:first-child {
      cursor: auto;
    }

    span:last-child {
      float: right;
      margin-right: 0;
    }
  }
}

.car-line {
  height: 140px;
  background: #fff;
  //   margin: 10px 0 0 0;

  .car-box {
    padding: 0 20px;
    line-height: 40px;
    color: #333;

    span {
      cursor: pointer;
      margin-right: 20px;
    }

    span:first-child {
      cursor: auto;
    }

    span:last-child {
      float: right;
      margin-right: 0;
    }
  }

  .adv-box {
      margin-top: 20px;
      margin-left: 20px;
      margin-right: 20px;
      display: flex;
      flex-wrap: nowrap;
      justify-content: space-between;

      div {
          display: inline-block;
          cursor: pointer;
          .el-card {
              width: 100%;
          }
          i{
              margin-right: 10px;
          }
      }

      .adv-tit {
          width: 28%;
          border: 1px solid transparent;
          border-radius: 5px;
          height: 60px;
          line-height: 60px;
          padding-left: 20px;
          box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
          overflow: hidden;
          em{
              float: right;
              margin-right: 20px;
              font-style: normal;
              color: #0074D9;
          }
      }
      .adv-tit:hover{
          border: 1px solid #CFE8FC;
          background: #CFE8FC;
      }

      .adv-add {
          width: 100px;
      }

  }
}

.mc-wrap .mc-top-right {
  width: calc(20% - 15px);
  background-color: white;
  overflow: hidden;

  .inner-box {
    width: calc(100% + 20px);
    background-color: white;
    overflow-y: scroll;
  }
}

.swiper-pagination {
  position: absolute;
  bottom: 0;
}

.main-box .item {
  float: left;
  width: 50%;
}

.main-box {
  overflow: hidden;
}

#test-n2 #layui-laydate1 {
  width: 100% !important;
}

.mc-wrap .laydate-theme-grid .layui-laydate-content td {
  border: none !important;
  border-radius: 50%;
}

.mc-wrap .layui-laydate-main {
  width: 100% !important;
}

.mc-wrap .layui-laydate-content table {
  width: 100%;
}

.mc-wrap .layui-laydate-static {
  width: 100% !important;
  border: none !important;
  box-shadow: none !important;
}

.mc-wrap .laydate-day-mark::after {
  bottom: 0 !important;
  left: 45% !important;
  top: 50px !important;
}

.mc-wrap .laydate-day-mark {
  overflow: inherit !important;
  overflow: none !important;
}

.mc-wrap .layui-laydate .layui-this {
  background-color: #a3c1e5 !important;
}

#test-n2 {
  width: initial !important;
}

.tasksituation {
  border-bottom: 1px solid #f7f7f7;
}

.mc-wrap .tasksituation > .title {
  font-size: 16px;
  font-weight: 500;
  padding-top: 20px;
  padding-left: 20px;
  color: #333;
}

.mc-wrap .main-box .point {
  color: #ff6060;
  font-size: 30px;
  font-weight: 500;
}

.mc-wrap .main-box .item img {
  width: 100%;
}

.mc-wrap .describe {
  text-align: center;
}

.mc-wrap .describe .title {
  color: #999;
  font-size: 12px;
  padding: 5px 0;
}

.mc-wrap .describe .day {
  color: #0081cc;
  font-size: 16px;
}

.mc-wrap .swiper-pagination-bullet {
  width: 10% !important;
  border-radius: 0;
  height: 5px !important;
}

.mc-wrap .laydate-icon {
  display: none;
}

.mc-wrap .laydate-set-ym {
  text-align: left;
}

.mc-wrap .layui-laydate-header {
  padding: 0;
}

.mc-wrap .layui-laydate-header i {
  display: none !important;
}

.mc-wrap .data-box {
  position: relative;
}

.datetimeBox {
  .el-timeline {
    padding-left: 20px;
  }
}

.mc-wrap .operation {
  padding-right: 20px;
  cursor: pointer;
  margin-top: 10px;
  text-align: right;
}

.mc-wrap .layui-laydate-footer {
  display: none;
}

.mc-wrap .layui-timeline-axis {
  width: 50px !important;
  height: 18px;
  border-radius: 20px;
  top: 3px;
  color: white;
  line-height: 18px;
}

.mc-wrap .layui-timeline-content {
  margin-left: 35px;
}

.mc-wrap .layui-timeline {
  width: 80%;
  margin: 0 auto;
}

.mc-wrap .layui-timeline-item:before {
  left: 9% !important;
  width: 3px;
  background-color: #daeaf2;
  top: 3px;
}

.mc-wrap .layui-timeline-axis:hover {
  color: white !important;
}

.mc-wrap .ztree li a.curSelectedNode {
  border: none !important;
  background-color: white !important;
}

.point-baifen {
  font-size: 14px;
  margin-left: -5%;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(1turn);
  }
}

.info-line {
  width: 100%;
  display: block;
  padding-left: 20px;

  div {
    width: 50%;
    display: inline-block;
    overflow: hidden;
  }

  .mytxt {
    height: 40px;
    padding-left: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: calc(100% - 100px);
    float: left;
  }

  .mytxtinfo {
    line-height: 40px;
    height: auto;
    padding-left: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: calc(100% - 100px);
  }

  span {
    width: 80px;
    display: inline-block;
    text-align: left;
    float: left;

    i {
      color: red;
      display: inline-block;
      padding-right: 5px;
    }
  }

  .el-select,
  .el-input {
    width: calc(100% - 100px);
  }
}

.online {
  width: 100%;

  .el-select {
    width: calc(100% - 100px);
  }

  span {
    vertical-align: top;
  }

  .el-textarea {
    width: calc(100% - 100px);
  }
}

.task_list{
  background-color: white;
  padding:0px 20px 20px 20px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
}
</style>
