Fixiaobai
2023-09-24 49f3321fa839e0ff5fb4d2de75756096a6db7b92
src/components/view/raw-ins.vue
@@ -82,74 +82,36 @@
      <el-row>
        <el-col :span="12" style="line-height: 32px;">原材料检验</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button
            type="primary"
            icon="el-icon-plus"
            style="background: #004EA2;"
            @click="goDetail(null)"
            >新增</el-button
          >
               <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"
                  @click="goDetail(null)">新增</el-button>
          <el-button icon="el-icon-download">导出</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="choose">
      <span>来料日期:</span>
      <el-date-picker
        v-model="search.formTime"
        size="small"
        placeholder="请输入"
        style="width: 13vw;margin-right: 5px;"
        clearable
        value-format="yyyy-MM-dd"
      ></el-date-picker>
         <el-date-picker v-model="search.formTime" size="small" placeholder="请输入" style="width: 13vw;margin-right: 5px;"
            clearable value-format="yyyy-MM-dd"></el-date-picker>
      <span>原材料编码:</span>
      <el-input
        v-model="search.code"
        placeholder="请输入"
        size="small"
        style="width: 13vw;margin-right: 5px;"
        clearable
      ></el-input>
         <el-input v-model="search.code" placeholder="请输入" size="small" style="width: 13vw;margin-right: 5px;"
            clearable></el-input>
      <span>检测状态:</span>
      <el-select
        v-model="search.insState"
        size="small"
        placeholder="请选择"
        style="width: 13vw;margin-right: 5px;"
      >
         <el-select v-model="search.insState" size="small" placeholder="请选择" style="width: 13vw;margin-right: 5px;">
        <el-option label="全部" :value="2"></el-option>
        <el-option label="未检测" :value="0"></el-option>
        <el-option label="已检测" :value="1"></el-option>
      </el-select>
      <span>原材料名称:</span>
      <el-input
        v-model="search.name"
        size="small"
        placeholder="请输入"
        style="width: 13vw;margin-right: 5px;"
        clearable
      ></el-input>
         <el-input v-model="search.name" size="small" placeholder="请输入" style="width: 13vw;margin-right: 5px;"
            clearable></el-input>
      <el-button size="mini" @click="clean()"><span>重 置</span></el-button>
      <el-button
        size="mini"
        type="primary"
        style="background: #004EA2;"
        @click="selectRawInspectsList()"
        ><span>查 询</span></el-button
      >
         <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectRawInspectsList()"><span>查
               询</span></el-button>
    </div>
    <div class="thing">
      <el-table
        :data="tableData"
        border
        style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
        max-height="calc(100% - 50px)"
        @selection-change="handleSelectionChange"
        default-expand-all
        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
        row-key="id"
      >
         <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
            max-height="calc(100% - 50px)" @selection-change="handleSelectionChange" default-expand-all
            :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" row-key="id">
        <el-table-column type="selection" width="50"> </el-table-column>
        <el-table-column type="index" label="序号" width="70">
        </el-table-column>
@@ -165,45 +127,27 @@
        <el-table-column prop="createTime" label="检验日期"> </el-table-column>
        <el-table-column prop="createTime" label="检测状态" width="100">
          <template slot-scope="scope">
            <span style="color: #34BD66;" v-if="scope.row.ins_state == 1"
              >已检测</span
            >
            <span style="color: #E84738;" v-else-if="scope.row.ins_state == 0"
              >未检测</span
            >
                  <span style="color: #34BD66;" v-if="scope.row.ins_state == 1">已检测</span>
                  <span style="color: #E84738;" v-else-if="scope.row.ins_state == 0">未检测</span>
          </template>
        </el-table-column>
        <el-table-column prop="judge_state" label="合格状态" width="100">
          <template slot-scope="scope">
            <span style="color: #34BD66;" v-if="scope.row.judge_state == 1"
              >合格</span
            >
            <span style="color: #E84738;" v-else-if="scope.row.judge_state == 0"
              >不合格</span
            >
                  <span style="color: #34BD66;" v-if="scope.row.judge_state == 1">合格</span>
                  <span style="color: #E84738;" v-else-if="scope.row.judge_state == 0">不合格</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <span class="table_do" @click="changeShowDetail(scope.row)"
              >查看</span
            >
                  <span class="table_do" @click="changeShowDetail(scope.row)">查看</span>
            <span class="table_do">打印</span>
          </template>
        </el-table-column>
      </el-table>
      <el-col
        style="height: 50px;display: flex;align-items: center;justify-content: right;"
      >
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="1"
          :page-sizes="[10, 15, 20, 30, 50]"
          :page-size="search.co"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
         <el-col style="height: 50px;display: flex;align-items: center;justify-content: right;">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1"
               :page-sizes="[10, 15, 20, 30, 50]" :page-size="search.co" layout="total, sizes, prev, pager, next, jumper"
               :total="total">
        </el-pagination>
      </el-col>
    </div>
@@ -245,7 +189,9 @@
    },
    selectRawInspectsList() {
      this.$axios
        .get(this.$api.url.selectRawInspectsList, { params: this.search })
               .get(this.$api.url.selectRawInspectsList, {
                  params: this.search
               })
        .then(res => {
          this.tableData = res.data.row;
          this.total = res.data.total;
@@ -262,7 +208,9 @@
      };
      this.selectRawInspectsList();
    },
    changeShowDetail({ id }) {
         changeShowDetail({
            id
         }) {
      this.goDetail(id);
      // console.log(id)
      // const res = await this.$axios.post(this.$api.url.selectRawInspectsListById,{params:{id}})