Fixiaobai
2023-09-25 22b45a79b2ceab7625e0fe248458c398cc26110d
src/components/view/technical.vue
@@ -1,138 +1,47 @@
<style scoped>
  .technical{
    height: 100%;
    width: 100%;
  }
  .technical .title .el-button {
    height: 32px;
    border: 1px solid rgba(190, 190, 190, 0.44);
    box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
    padding: 0 12px;
  }
  .technical .title {
    margin-bottom: 10px;
    padding: 0 20px;
  }
/* 搜索头部样式 */
.search-header{
  background: #fff;
  padding: 24px 32px;
}
.search-header .el-form-item{
  margin: 0px;
  font-size: 14px;
}
.search-header .el-form-item:nth-child(1){
  margin-right: 48px;
}
.search-header .el-form-item:nth-child(2){
  margin-right: 24px;
}
/* 重置和查询两个按钮样式 */
.search-header .el-form-item .el-button{
width: 65px;
height: 32px;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
padding: 0;
font-size: 14px;
}
.search-header .el-form-item .el-button:nth-child(2){
/* Rectangle 77 */
background: rgb(0, 78, 162);
color: #fff;
}
/* 输入框的样式 */
.search-header .el-form-item .el-input >>>.el-input__inner{
width: 224px;
height: 32px ;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
}
/* 技术文件表格样式 */
.technical-table{
  margin-top: 11px;
  height: calc(100% - 140px);
  background: #fff;
  padding: 23px 21px ;
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* .technical-table .el-table{
  overflow-y:scroll;
} */
.technical-table .table-box {
  flex: 1;
  overflow-y: scroll;
}
.technical-table .el-pagination{
  margin-top: 23px;
  display: flex;
  justify-content: end;
}
.formtitle{
  display: block;
  margin-bottom: 24px;
  font-size: 16px;
}
.detail-model >>>.el-form-item__label{
  color: rgb(51, 51, 51);
}
.detail-model >>>.el-input__inner{
width: 224px;
height: 32px;
box-sizing: border-box;
background: rgb(238, 238, 238);
border: 1px solid rgb(221, 221, 221);
border-radius:4px;
}
</style>
<template>
  <div class="technical">
    <div class="title">
      <el-row>
        <el-col :span="12">技术文件</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button  icon="el-icon-plus">生成项目书</el-button>
          <el-button icon="el-icon-plus">生成项目书</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="search-header">
      <el-form v-model="searchData" :inline="true">
        <el-form-item label="订单号:">
          <el-input v-model="searchData.id"></el-input>
          <el-input v-model="searchData.id" ></el-input>
        </el-form-item>
        <el-form-item label="下单日期:">
          <el-date-picker
            v-model="searchData.date"
            value-format="yyyy-MM-dd"
            type="date"
            style="width: 10vw;"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="产品名称:" style="margin-right: 24px;">
          <el-input v-model="searchData.name" ></el-input>
        </el-form-item>
        <el-form-item label="编制状态:" >
          <el-select v-model="searchData.type" size="small" placeholder="全部" style="width: 10vw;">
              <el-option label="待编制" :value="0"></el-option>
                     <el-option label="已编制" :value="1"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
                <el-button  plain @click="resetBtn">重 置</el-button>
                <el-button  @click="searchTechnical">查 询</el-button>
              <el-button plain @click="resetBtn" style="margin-left: 12px;">重 置</el-button>
              <el-button @click="searchTechnical">查 询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="technical-table">
      <div class="table-box">
        <el-table
          border style="width: 100%"
          border
          height="calc(90vh - 250px)"
          :data="technicalTable"
          >
          <el-table-column
@@ -140,73 +49,62 @@
          width="78">
        </el-table-column>
          <el-table-column
            prop="id"
            label="订单号"
            width="124">
            prop="order_number"
            label="订单号">
          </el-table-column>
          <el-table-column
            prop="saleman"
            label="业务员">
          </el-table-column>
          <el-table-column
            prop="proname"
            label="工程名称"
            width="160">
            label="客户名称">
          </el-table-column>
          <el-table-column
            prop="code"
            label="产品编码"
            width="168"
            >
          </el-table-column>
          <el-table-column
            prop="type"
            label="产品大类"
            width="128">
            prop="name"
            label="产品名称">
          </el-table-column>
          <el-table-column
            prop="specifications"
            label="规格型号"
            width="170">
            label="规格型号">
          </el-table-column>
          <el-table-column
            prop="unit"
            label="单位"
            width="100">
            label="单位">
          </el-table-column>
          <el-table-column
            prop="number"
            label="数量"
            width="118"
            >
            label="数量">
          </el-table-column>
          <el-table-column
            prop="username"
            label="下单人"
            width="114">
            prop="下单日期"
            label="下单日期">
          </el-table-column>
          <el-table-column
            prop="createTime"
            label="下单日期"
            width="153"
            >
            prop="交货日期"
            label="交货日期">
          </el-table-column>
          <el-table-column
            prop="deliveryTime"
            label="交货日期"
            width="137">
            prop="note"
            label="备注">
          </el-table-column>
          <el-table-column
            prop="state"
            label="状态"
            width="85"
            >
            <template slot-scope="scope">
              {{scope.state==1?'待编制':'已编制'}}
              <span  :style="{'color': scope.row.type==0 ? 'red':'green'}">
                {{scope.row.type==0?'待编制':'已编制'}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
              label="操作"
              width="194">
              <template slot-scope="scope">
                <el-button type="text" size="small" @click="showDetails(scope.row)">查看详情</el-button>
                <el-button type="text" size="small">编辑附件</el-button>
                <!-- <el-button type="text" size="small" @click="showDetails(scope.row)">查看详情</el-button>
                <el-button type="text" size="small">编辑附件</el-button> -->
                <el-button v-if="scope.row.type===0" type="text" size="small" @click="authorizedstrength(scope.row)">编制</el-button>
              </template>
            </el-table-column>
      </el-table>
@@ -216,9 +114,9 @@
    <el-pagination
       @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageParams.pageNo"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="pageParams.pageSize"
      :current-page="pageParams.pageSize"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="pageParams.countSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pageParams.total">
    </el-pagination>
@@ -339,59 +237,17 @@
    return {
       searchData:{
        id:'',
        date:''
        date:'',
        name:'',
        condition:'',
       },
       technicalTable: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }
       ],
       compiledata:{},
       technicalTable: [],
       showDetail: false,
       selectedRow: {},
       pageParams:{
        pageNo:1,
        pageSize:10,
        pageSize:1,
        countSize:10,
        total:0
       }
    }
@@ -400,33 +256,179 @@
    this.getTechnicalTableData()
  },
  methods: {
      authorizedstrength(row) {
        this.compiledata = row
        this.compile()
      },
      //编制
      compile() {
        console.log();
        this.$axios.post(this.$api.url.compile,{
              id:this.compiledata.id
        }).then( res =>{
        this.$message.success('编制完成')
        this.getTechnicalTableData()
      })
      },
      async showDetails(row){
        this.showDetail = true
        const res = await this.$axios.get(this.$api.url.selectOrderById,{params:{id:row.id}})
        this.selectedRow = res.data
        console.log(this.selectedRow)
      },
      async  getTechnicalTableData() {
        const res = await this.$axios.get(this.$api.url.selectAllOrder,{params:{pageSize:(this.pageParams.pageNo-1),countSize:this.pageParams.pageSize,...this.searchData}})
        const res = await this.$axios.get(this.$api.url.selectAllOrder,{
          params:{
            pageSize:(this.pageParams.pageSize),
            countSize:this.pageParams.countSize,...this.searchData,
            orderCode:this.searchData.id,
            time:this.searchData.date,
            name:this.searchData.name,
            type:this.searchData.type,
          }
        })
        this.technicalTable = res.data.row
        this.pageParams.total = res.data.total
      },
      // 头部条件查询-重置
      resetBtn() {
        this.searchData={}
        this.getTechnicalTableData()
      },
      // 头部条件查询-查询
      searchTechnical() {
        this.getTechnicalTableData()
      },
      handleSizeChange(value){
        this.pageParams.pageSize = value
        this.pageParams.countSize = value
        this.getTechnicalTableData()
      },
      handleCurrentChange(value){
        this.pageParams.pageNo = value
        this.pageParams.pageSize = value
        this.getTechnicalTableData()
      }
    },
}
</script>
<style scoped>
  .technical{
    height: 100%;
    width: 100%;
  }
  .el-form-item__label{
    padding: 0 60px 0;
  }
  .technical .title .el-button {
    height: 32px;
    border: 1px solid rgba(190, 190, 190, 0.44);
    box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
    padding: 0 12px;
  }
  .technical .title {
    margin-bottom: 10px;
    padding: 0 20px;
  }
/* 搜索头部样式 */
.search-header{
  background: #fff;
  padding: 24px 32px;
}
.search-header .el-form-item__label{
  padding: 0 30px 0 0;
}
.search-header .el-form-item{
  margin: 0px;
  font-size: 20px;
}
.search-header .el-form-item:nth-child(1){
  margin-right: 24px;
}
.search-header .el-form-item:nth-child(2){
  margin-right: 24px;
}
/* 重置和查询两个按钮样式 */
.search-header .el-form-item .el-button{
width: 65px;
height: 32px;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
padding: 0;
font-size: 14px;
}
.search-header .el-form-item .el-button:nth-child(2){
/* Rectangle 77 */
background: rgb(0, 78, 162);
color: #fff;
}
/* 输入框的样式 */
.search-header .el-form-item .el-input >>>.el-input__inner{
width: 10vw;
height: 32px ;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
}
/* 技术文件表格样式 */
.technical-table{
  margin-top: 11px;
  /* height: calc(100% - 140px); */
  background: #fff;
  padding: 23px 21px ;
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* .technical-table .el-table{
  overflow-y:scroll;
} */
.technical-table .table-box {
  flex: 1;
  overflow-y: scroll;
}
.technical-table .el-pagination{
  margin-top: 23px;
  display: flex;
  justify-content: end;
}
.formtitle{
  display: block;
  margin-bottom: 24px;
  font-size: 16px;
}
.detail-model >>>.el-form-item__label{
  color: rgb(51, 51, 51);
}
.detail-model >>>.el-input__inner{
width: 224px;
height: 32px;
box-sizing: border-box;
background: rgb(238, 238, 238);
border: 1px solid rgb(221, 221, 221);
border-radius:4px;
}
</style>
<style>
   .technical .title *{
      font-size: 14px;
   }
   .technical .search-header *{
      font-size: 14px;
   }
</style>