Newer
Older
smartKitchenFront / src / views / sales / shop.vue
liuyangyingjie on 26 Oct 2022 5 KB first commit
<template>
  <div class="product_container">
    <div class="productFun">
      <div class="productInput">
        项目名称
        <div class="inputBox" style="width: 120px">
          <el-input
            placeholder="请输入项目名称"
            v-model="selectInfo.itemName"
            clearable
            class="product-input"
          >
          </el-input>
        </div>
        项目预算
        <div class="inputBox" style="width: 144px">
          <el-input
            placeholder="请输入项目预期"
            v-model="selectInfo.itemBudget"
            clearable
            class="product-input"
          >
          </el-input>
        </div>
        预计工期
        <div class="inputBox" style="width: 144px">
          <el-input
            placeholder="请选择项目日期"
            v-model="selectInfo.itemDuration"
            clearable
            class="product-input"
          >
          </el-input>
        </div>
      </div>
      <div class="productBtn">
        <el-button type="primary" icon="el-icon-search" class="btnItem"
        @click="selectData"  >查询</el-button
        >
        <el-button type="primary" icon="el-icon-refresh-right" class="btnItem"
          @click="reset">重置</el-button
        >  
      </div>
    </div>
    <el-table
      :data="tableData.rows"
      :row-class-name="tableRowClassName"
      :header-cell-style="{
        'text-align': 'center',
        background: '  #2483b3',
        color: 'white',
      }"
      :row-style="{ 'text-align': 'center' }"
      style="width: 100%"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="index" label="序号"> </el-table-column>
      <el-table-column prop="busOppoId" label="商机编号"> </el-table-column>
      <el-table-column prop="itemName" label="项目名称"> </el-table-column>
      <el-table-column prop="itemBudget" label="预期工期"> </el-table-column>
      <el-table-column prop="itemManager" label="商机负责人"> </el-table-column>
      <el-table-column prop="phone" label="联系方式"> </el-table-column>
      <el-table-column prop="status" label="商机状态"> </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button @click="showInfo(scope.row)" type="text" size="small"
            >详情</el-button
          >
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >商机转订单</el-button
          >
       
          <!-- <el-button type="text" size="small">编辑</el-button> -->
        </template>
      </el-table-column>
    </el-table>
    <group-page :limit ="limit" :total="total" :offset="offset" :count="tableData.total" @setOffset="setOffset"  @setLimit ="setLimit"   v-model="isFristPage"/>
    <!-- 新增弹框 -->
   
    <!-- <brand-add-dialog  :isShowInfo="isShowAdd"
      @close="closeAdd"></brand-add-dialog> -->
      <shop-info-dialog  :isShowInfo="isShowInfo" @close="closeInfo" :dataInfo="rowInfo"/>
      <slaes-change-order-dialog :isShowInfo="isShowAdd"  @close="closeAdd"  :busOppoId="busOppoId"></slaes-change-order-dialog>
  </div>
</template>
  
  <script>
//组件
import ShopInfoDialog from '../../components/mycomponent/dialog/salesDialog/shopInfoDialog.vue';
import SlaesChangeOrderDialog from '../../components/mycomponent/dialog/salesDialog/slaesChangeOrderDialog.vue';
import GroupPage from "../../components/mycomponent/groupPage.vue";

//逻辑
import { listPage} from "../../api/sales/shop"
import { listMixin,elDataDialog } from '../../utils/myUtils/mixins/listPage'
import { tableRowClassName } from "../../utils/myUtils/changeTableTr";
export default {
  mixins:[listMixin,elDataDialog],
  components: {
    ShopInfoDialog,
    SlaesChangeOrderDialog,
    GroupPage
  },
  data() {
    return {
      isShowAdd: false, //显示新增功能
       isShowInfo: false, //显示新增功能
       selectInfo:{
        itemName:'',
        itemBudget:'',
        itemDuration:''
      },
      busOppoId:''
    };
  },
  methods: {
    tableRowClassName: tableRowClassName,
    closeAdd() {
      this.isShowAdd = false;
    },
   
    handleClick(row){
      // console.log(row);
      this.isShowAdd = true
     this .busOppoId = row.busOppoId
    },
    getListPage(limit,offset){
      listPage(`limit=${limit}&offset=${offset}`,this.queryInfo).then(res => {
      // 得到相关数据
      res.rows.forEach((item,index)=>{
        item.index =(index+1)+((offset-1)*10)
      })
      this.tableData = res 
     })
    },
    reset(){
      this.selectInfo = {   
        itemName:'',
        itemBudget:'',
        itemDuration:''
      }
    },
  },
};
</script>
  
  <style lang="scss" scoped>
.product_container {
  position: relative;
  width: 100%;
  min-height: 700px;
  overflow: auto;
  height: 823px;
  .productData {
    width: 100%;
    display: flex;
    justify-content: center;
    .middle {
      margin: 0 30px;
    }
  }
  .productFun {
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
    .productInput {
      display: flex;
      align-items: center;
      .inputBox {
        margin: 0 50px 0 10px;
      }
    }
    .productBtn {
      .btnItem {
        margin-right: 10px;
        border-radius: 5px;
        // height: 32px;
        // width: 84px;
        font-size: 16px;
      }
      
    }
  }
  .footer {
    display: flex;
    justify-content: space-between;
    color: #6666;
    margin: 30px 10px;
  }
}
</style>