licp
2024-12-20 551e8f6756abbb1277566dd1225a14422c774d6f
完成标准物质领用迁移
已修改2个文件
295 ■■■■■ 文件已修改
src/assets/api/controller.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a6-standard-material-requisition.vue 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -69,6 +69,7 @@
    foreignRegister,
    feCalibrationSchedule,
    feStandardSubstance,
    feStandardSubstanceRecord,
  }
}
@@ -912,3 +913,11 @@
  removeStandardSubstance:'/feStandardSubstance/removeStandardSubstance',//删除标准物质清单
  exportOfStandardSubstanceList: '/feStandardSubstance/exportOfStandardSubstanceList', // 标准物质清单 导出
}
// 6.5标准物质清单-领用借用归还
const feStandardSubstanceRecord = {
  getSubstanceRecord:'/feStandardSubstanceRecord/getSubstanceRecord',// 标准物质清单领用查询
  borrowSubstance:'/feStandardSubstanceRecord/borrowSubstance',//标准物质清单借用
  returnSubstance:'/feStandardSubstanceRecord/returnSubstance',//标准物质清单归还
  getPageSubstanceRecord: '/feStandardSubstanceRecord/getPageSubstanceRecord', // 分页查询
}
src/components/view/a6-standard-material-requisition.vue
@@ -1,147 +1,187 @@
<style scoped>
  .title {
    height: 60px;
    line-height: 60px;
  }
  .search {
    background-color: #fff;
    height: 80px;
    display: flex;
    align-items: center;
  }
  .search_thing {
    display: flex;
    align-items: center;
    height: 50px;
  }
  .search_label {
    width: 120px;
    font-size: 14px;
    text-align: right;
  }
  .search_input {
    width: calc(100% - 120px);
  }
  .table {
    margin-top: 10px;
    background-color: #fff;
    width: calc(100% - 40px);
    height: calc(100% - 60px - 80px - 10px - 40px);
    padding: 20px;
  }
</style>
<template>
  <div class="below-standard-main">
    <div style="width: 100%;height: 100%;">
      <div>
        <el-row class="title">
          <el-col :span="12" style="padding-left: 20px;text-align: left;">标准物质领用</el-col>
          <el-col :span="12" style="text-align: right;">
                        <el-button size="medium" type="primary" @click="$refs['ValueTable'].openAddDia('新增接口')" v-if="addPower">新 增</el-button>
            <el-button size="medium" @click="$refs['ValueTable'].openDownDia()">导 出</el-button>
                    </el-col>
        </el-row>
  <div>
    <div>
      <div class="view-title">
        <span>标准物质领用</span>
      </div>
      <div class="search">
        <div class="search_thing">
          <div class="search_label">名称:</div>
          <div class="search_input">
              <el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.model"
                        @keyup.enter.native="refreshTable()"></el-input></div>
        </div>
        <div class="search_thing">
          <div class="search_label">管理编码:</div>
          <div class="search_input">
            <el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.sample"
              @keyup.enter.native="refreshTable()"></el-input>
          </div>
        </div>
        <div class="search_thing">
          <div class="search_label">状态:</div>
          <div class="search_input">
            <el-select size="small" v-model="componentData.entity.state" style="width: 100%;" @change="refreshTable()">
                            <el-option v-for="(a, i) in stateList" :key="i" :label="a.label" :value="a.value"></el-option>
                        </el-select>
          </div>
        </div>
        <div class="search_thing" style="padding-left: 30px;">
          <el-button size="small" @click="refresh()">重 置</el-button>
          <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
        </div>
      <div class="search-background">
        <span class="search-group">
          <span style="width: 180px">标准物质名称:</span>
          <el-input v-model="searchForm.name" clearable size="small"></el-input>
        </span>
        <span class="search-group">
          <span style="width: 120px">规格型号:</span>
          <el-input v-model="searchForm.model" clearable size="small"></el-input>
        </span>
        <span class="search-group">
          <el-button size="medium"  @click="resetSearchForm">重 置</el-button>
          <el-button size="medium" type="primary" @click="searchList">查 询</el-button>
        </span>
      </div>
      <div class="table">
          <ValueTable ref="ValueTable" :url="$api.unPass.pageInsUnPass" :componentData="componentData"
          :key="upIndex" />
        <div>
          <TableCard :showForm="false" :showTitle="false">
            <template v-slot:table>
              <ZTTable
                :column="tableColumn"
                :height="'calc(100vh - 23em)'"
                :table-data="tableData"
                :table-loading="tableLoading"
                style="padding: 0 15px;margin-bottom: 16px">
              </ZTTable>
            </template>
          </TableCard>
          <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
                         :total="total" layout="->,total, sizes, prev, pager, next, jumper"
                         @size-change="handleSizeChange"
                         @current-change="handleCurrentChange">
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import ValueTable from '../tool/value-table.vue'
  import {
    convertToHtml
  } from 'mammoth';
import ZTTable from '../caorui/ZTTable/index.vue';
import TableCard from '../caorui/TableCard/index.vue';
export default {
  components: {
    ValueTable,
    TableCard,
    ZTTable,
  },
  data() {
    return {
        componentData: {
          entity: {
            sample: null,
            model: null,
            orderBy: {
              field: 'id',
              order: 'asc'
            }
          },
          isIndex: true,
          showSelect: false,
          select: false,
          do: [
          {
                            id: '',
                            font: '归还',
                            type: 'text',
                            method: 'handleBack',
                            // disabFun: (row, index) => {
                            //     return row.userId == null || row.insState == 3 || row.insState == 5
                            // }
                        },
          ],
          tagField: [],
          selectField: [],
          requiredAdd: ['model','sample',],
          requiredUp: []
      searchForm: {
        name: '',
        factoryManufacturer: '',
      },
      tableColumn: [
        {
          label: '标准物质名称',
          prop: 'name',
          minWidth: '120'
        },
        entityCopy: {},
        upIndex: 0,
        stateList: [],
        addPower:true,
      }
        {
          label: '规格型号',
          prop: 'model',
          minWidth: '100'
        },
        {
          label: '出厂编号',
          prop: 'factoryNum',
          minWidth: '100'
        },
        {
          label: '数量',
          prop: 'factoryNum',
          minWidth: '100'
        },
        {
          label: '领用人',
          prop: 'borrowUser',
          minWidth: '100'
        },
        {
          label: '领用日期',
          prop: 'borrowDate',
          minWidth: '100'
        },
        {
          label: '归还人',
          prop: 'returnIntegrity',
          minWidth: '100'
        },
        {
          label: '归还日期',
          prop: 'returnDate',
          minWidth: '100'
        },
        {
          label: '归还时状态',
          prop: 'returnIntegrity',
          minWidth: '100'
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
      },
      total: 0,
      formDia: false,
      borrowDia: false,
      returnDia: false,
    }
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity)
    this.getPower()
    this.searchList()
  },
  methods :{
    refreshTable() {
        this.$refs['ValueTable'].selectList()
      },
    refresh() {
        this.componentData.entity = this.HaveJson(this.entityCopy)
        this.upIndex++
      },
    // 权限分配
    getPower(radio) {
      let power = JSON.parse(sessionStorage.getItem('power'))
    // 查询列表
    searchList () {
      const entity = this.searchForm
      const page = this.page
      this.tableLoading = true
      this.$axios.post(this.$api.feStandardSubstanceRecord.getPageSubstanceRecord, { ...entity, ...page }, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.total = res.data.total
      }).catch(err => {
        this.tableLoading = false
      })
    },
    handleBack(row){}
    // 重置查询条件
    resetSearchForm () {
      this.searchForm.name = '';
      this.searchForm.model = '';
      this.searchList()
    },
    // 分页
    handleSizeChange(val) {
      this.page.size = val;
      this.searchList();
    },
    handleCurrentChange(val) {
      this.page.current = val;
      this.searchList();
    },
  }
}
</script>
<style scoped>
.view-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-left: 20px;
}
.search-background {
  width: 100%;
  height: 80px;
  line-height: 80px;
  background-color: #ffffff;
  display: flex;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.table {
  margin-top: 20px;
  background-color: #ffffff;
  padding-top: 20px;
}
</style>