spring
2025-02-17 00edab233e6268cdd2bd0fdb5627d3fbd85b04e7
Merge remote-tracking branch 'origin/dev' into dev-licp

# Conflicts:
# src/components/Table/lims-table.vue
已修改6个文件
已重命名4个文件
464 ■■■■■ 文件已修改
src/api/structural/laboratory.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/structural/laboratoryScope.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capability/index.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capabilityComponents/bindSupplierDensityDialog.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/laboratory/index.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/premises/index.vue 365 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/structural/laboratory.js
@@ -4,7 +4,7 @@
export function getCertificationDetail(query) {
  return request({
    url: '/certification/getCertificationDetail',
    method: 'post',
    method: 'get',
    params: query
  })
}
@@ -13,7 +13,7 @@
  return request({
    url: '/certification/addCertificationDetail',
    method: 'post',
    params: query
    data: query
  })
}
// åˆ é™¤èµ„质明细列表
src/api/structural/laboratoryScope.js
@@ -1,9 +1,17 @@
import request from '@/utils/request'
// èŽ·å–åœºæ‰€æžšä¸¾å€¼
// èŽ·å–å®žéªŒå®¤åç§°
export function obtainItemParameterList() {
  return request({
    url: '/laboratoryScope/obtainItemParameterList',
    method: 'get'
  })
}
// æŸ¥è¯¢å®žéªŒå®¤ç®¡ç†åˆ—表
export function selectItemParameter(query) {
  return request({
    url: '/laboratoryScope/selectItemParameter',
    method: 'get',
    params: query
  })
}
src/main.js
@@ -51,6 +51,7 @@
Vue.prototype.HaveJson = (val) => {
  return JSON.parse(JSON.stringify(val))
}
Vue.prototype.javaApi = process.env.VUE_APP_BASE_API
// å…¨å±€ç»„件挂载
Vue.component('DictTag', DictTag)
src/views/structural/capabilityAndLaboratory/capability/index.vue
@@ -46,11 +46,13 @@
<!--      æ£€éªŒé¡¹ç›®å‚数表格-->
      <div class="table" v-if="radio===0">
        <lims-table :tableData="tableData" :column="column"
                    @pagination="pagination"
                    :page="page" :tableLoading="tableLoading"></lims-table>
      </div>
<!--      æ£€éªŒå¯¹è±¡è¡¨æ ¼-->
      <div class="table" v-if="radio===1">
        <lims-table :tableData="testObjectTableData" :column="testObjectColumn"
                    @pagination="pagination"
                    :page="testObjectPage" :tableLoading="tableLoading"></lims-table>
      </div>
    </div>
@@ -110,16 +112,16 @@
</template>
<script>
import BindPartDialog from "@/components/capability/bindPartDialog.vue"
import BindSupplierDensityDialog from "@/components/capability/bindSupplierDensityDialog.vue"
import BindPartDialog from "@/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue"
import BindSupplierDensityDialog from "@/views/structural/capabilityAndLaboratory/capabilityComponents/bindSupplierDensityDialog.vue"
import {
  addProduct,
  delItemParameter, delProduct, delTestObject, selectItemParameterList, selectProductListByObjectId,
  selectTestObjectList, upProduct,
} from "@/api/structural/capability";
import limsTable from "@/components/Table/lims-table.vue";
import EditForm from "@/components/capability/EditForm.vue";
import testObjectEditForm from "@/components/capability/testObjectEditForm.vue";
import EditForm from "@/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue";
import testObjectEditForm from "@/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue";
import {getToken} from "@/utils/auth";
export default {
@@ -129,6 +131,7 @@
      uploadAction: process.env.VUE_APP_BASE_API + '/capacityScope/importExcel',
      uploadAction1: process.env.VUE_APP_BASE_API + '/capacityScope/importEquipData',
      tableData: [],
      tableLoading: false,
      column: [
        {label: '检验项', prop: 'inspectionItem'},
        {label: '检验项EN', prop: 'inspectionItemEn'},
@@ -280,7 +283,6 @@
        size:10,
        current:0
      },
      tableLoading: false,
      addOrUpdate: '',
      tree: null,
      loading: true,
@@ -334,7 +336,8 @@
      productPage: {
        total:0,
        size:10,
        current:0
        current:0,
        layout: 'total, prev, pager, next'
      },
      productableLoading: false,
      productEditDia: false,
@@ -461,6 +464,10 @@
      this.resetForm('itemParameterForm')
      this.refreshTable()
    },
    pagination (page) {
      this.page.size = page.pageNum.limit
      this.refreshTable()
    },
    // æ£€éªŒé¡¹ç›®å‚数新增
    openAdd() {
      if (this.radio === 0) {
src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue
src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue
ÎļþÃû´Ó src/components/capability/bindPartDialog.vue ÐÞ¸Ä
@@ -99,7 +99,8 @@
      page: {
        total:0,
        size:10,
        current:1
        current:1,
        layout: 'total, prev, pager, next'
      },
      bindPartComponent: {
        entity: {
src/views/structural/capabilityAndLaboratory/capabilityComponents/bindSupplierDensityDialog.vue
ÎļþÃû´Ó src/components/capability/bindSupplierDensityDialog.vue ÐÞ¸Ä
@@ -89,7 +89,8 @@
      page: {
        total:0,
        size:10,
        current:1
        current:1,
        layout: 'total, prev, pager, next'
      },
      tableLoading: false,
      searchUrl: '', // æŸ¥è¯¢
src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue
src/views/structural/capabilityAndLaboratory/laboratory/index.vue
@@ -32,13 +32,14 @@
    <div v-if="radio===0">
      <lims-table :tableData="tableData" :column="column"
                  :isSelection="true" :handleSelectionChange="handleSelectionChange"
                  @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <div class="table" v-if="radio===1" v-loading="pageLoading" @scroll="scrollFn">
      <el-row :gutter="16">
        <el-col :span="6" v-for="(m,i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" style="margin-bottom: 16px;">
        <el-col :span="8" v-for="(m,i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="8" :xl="6" style="margin-bottom: 16px;">
          <div class="table-item">
            <el-image style="width: 102px;height: 102px;margin-right: 20px;border-radius: 16px;" :src="process.env.VUE_APP_BASE_API+'/img/'+m.imageUrl">
            <el-image style="width: 102px;height: 102px;margin-right: 20px;border-radius: 16px;" :src="javaApi +'/img/'+m.imageUrl">
              <div slot="error" class="image-error" style="width: 100px;
                height: 100px;
                border-radius: 16px;
@@ -184,7 +185,7 @@
      page: {
        total:0,
        size:10,
        current:0
        current:1
      },
      tableLoading: false,
      qualificationsList:[],
@@ -214,18 +215,19 @@
  },
  methods: {
    selectorSwitch(radio) {
      if(radio === '1'){
      if(radio === 1){
        this.list = [];
        this.refreshTable();
      }
    },
    refreshTable() {
      if (this.radio === '0') {
        getCertificationDetail({...this.page,...this.queryParams,}).then(res => {
      if (this.radio === 0) {
        this.tableLoading = true;
        getCertificationDetail({...this.page,...this.queryParams}).then(res => {
          this.tableLoading = false
          if (res.code === 200) {
            this.tableData = res.data
            this.page.total = res.total
            this.tableData = res.data.records
            this.page.total = res.data.total
          }
        }).catch(err => {
          this.tableLoading = false
@@ -240,15 +242,13 @@
          window.addEventListener("scroll", this.throttle(this.scrollFn, 20000));
        }
        getCertificationDetail({
          page: {
            current: this.currentPage,
            size: this.pageSize
          },
          entity: this.queryParams
          current: this.currentPage,
          size: this.pageSize,
          ...this.queryParams
        }).then(res => {
          if(res.code===200){
            this.total = res.data.body.total
            let list = res.data.body.records;
            this.total = res.data.total
            let list = res.data.records;
            if(list.length===0){
              this.finishLoding = true;
            }else{
@@ -271,14 +271,25 @@
    },
    // é‡ç½®
    refresh() {
      this.queryParams.name = ''
      this.page.size = 10
      this.page.current = 1
      this.refreshTable()
      if(this.radio === 0){
        this.queryParams.name = ''
        this.page.size = 10
        this.page.current = 1
        this.refreshTable()
      } else {
        this.finishLoding = false;
        this.currentPage= 1;
        this.list=[];
        this.refreshTable()
      }
    },
    // è¡¨æ ¼å¤šé€‰
    handleSelectionChange (selection) {
      this.selection = selection;
    },
    pagination (page) {
      this.page.size = page.pageNum.limit
      this.refreshTable()
    },
    // èµ„质明细批量删除
    handleDel(){
@@ -405,4 +416,14 @@
  line-height: 40px;
  margin-bottom: 10px;
}
.table-item{
  border-radius: 8px 8px 8px 8px;
  box-shadow: 4px 4px 8px 0px rgba(51,51,51,0.04);
  border: 1px solid #EEEEEE;
  box-sizing: border-box;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
</style>
src/views/structural/premises/index.vue
@@ -1,13 +1,362 @@
<script>
export default {
  name: "index"
}
</script>
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
          <el-form-item label="实验室名称" prop="laboratoryName">
            <el-input size="small" placeholder="请输入" clearable v-model="queryParams.laboratoryName"
                      @keyup.enter.native="refreshTable"></el-input>
          </el-form-item>
          <el-form-item label="实验室编码" prop="laboratoryNumber">
            <el-input size="small" placeholder="请输入" clearable v-model="queryParams.laboratoryNumber"
                      @keyup.enter.native="refreshTable"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 è¯¢</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 ç½®</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="small" type="primary" @click="openAdd" icon="el-icon-plus">新增</el-button>
      </div>
    </div>
    <div class="table">
<!--      <ValueTable ref="ValueTable" :url="$api.laboratoryScope.selectItemParameter"-->
<!--                  :upUrl="$api.laboratoryScope.upParameter" :delUrl="$api.laboratoryScope.delParameter"-->
<!--                  :componentData="componentData" :key="upIndex" />-->
      <lims-table :tableData="tableData" :column="column"
                  @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <el-dialog title="印章管理" :visible.sync="fileVisible" width="60vw">
      <div class="btns">
        <el-button size="medium" type="primary" @click="openUpload">更新印章</el-button>
      </div>
<!--      <ValueTable ref="ValueTable0" :url="$api.sealScope.selectSeal"-->
<!--                  :componentData="fileComponentData" :key="upIndex" style="height: 400px;" />-->
    </el-dialog>
    <el-dialog title="更新印章" :visible.sync="upFileVisible" width="400px">
      <div class="search_thing" style="margin-bottom: 16px;">
        <div class="search_label" style="width:90px">印章类型:</div>
        <div class="search_input">
          <el-cascader
            v-model="dataForm.type"
            :options="options"
            :show-all-levels="false"
            :props="props"
            placeholder="请选择" size="small"
            style="width:100%"
            collapse-tags
            clearable></el-cascader>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label" style="width:90px">印章图片:</div>
        <div class="search_input">
          <el-upload
            :action="action"
            :headers="headers"
            accept='image/jpg,image/jpeg,image/png'
            :show-file-list="false"
            :on-success="handleSuccess"
            :on-change="beforeUpload"
            ref="upload"
            :on-error="onError"
          >
            <img v-if="dataForm.address" :src="javaApi+'/img/'+dataForm.address" style="width: 110px;height: 110px;" >
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
                <el-button @click="upFileVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="confirmConnect" :loading="loading">ç¡® å®š</el-button>
            </span>
    </el-dialog>
  </div>
</template>
<style scoped lang="scss">
<script>
import limsTable from "@/components/Table/lims-table.vue";
import {selectItemParameter} from "@/api/structural/laboratoryScope";
export default {
  components: {
    limsTable
  },
  computed: {
    headers() {
      return {
        'token': sessionStorage.getItem('token')
      }
    },
    action() {
      return this.javaApi
    }
  },
  data() {
    return {
      queryParams: {
        laboratoryName: '',
        laboratoryNumber: '',
      },
      tableData: [],
      tableLoading: false,
      column: [
        {label: '实验室名称', prop: 'laboratoryName'},
        {label: '场所编码', prop: 'laboratoryNumber'},
        {label: '实验室代号', prop: 'laboratoryCode'},
        {label: '负责人', prop: 'head'},
        {label: '负责人电话', prop: 'phoneNumber'},
        {label: '地址', prop: 'address'},
        {label: '创建人', prop: 'createUserName'},
        {label: '创建时间', prop: 'createTime'},
        {
          dataType: 'action',
          fixed: 'right',
          label: '操作',
          width: '140px',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.editForm(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              clickFun: (row) => {
                this.delete(row);
              },
            },
            {
              name: '印章管理',
              type: 'text',
              clickFun: (row) => {
                this.fileManagement(row);
              },
            },
          ]
        }
      ],
      page: {
        total:0,
        size:10,
        current:1
      },
      componentData: {
        entity: {
          laboratoryName: null,
          laboratoryNumber: null,
          head: null,
          orderBy: {
            field: 'id',
            order: 'asc'
          }
        },
        isIndex: true,
        showSelect: false,
        select: false,
        do: [{
          id: 'update',
          font: '编辑',
          type: 'text',
          method: 'doDiy',
          field: ['createUserName']
        }, {
          id: 'delete',
          font: '删除',
          type: 'text',
          method: 'doDiy'
        }, {
          id: '',
          font: '印章管理',
          type: 'text',
          method: 'fileManagement'
        }],
        tagField: {
          type:{
            select:[]
          }
        },
        selectField: {},
        requiredAdd: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
        requiredUp: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
        needSort: ['laboratoryName', 'createTime'],
      },
      fileComponentData: {
        entity: {
          labId:null,
          orderBy: {
            field: 'id',
            order: 'asc'
          }
        },
        isPage:false,
        init:false,
        isIndex: true,
        showSelect: false,
        select: false,
        do: [],
        tagField: {},
        selectField: {
          type:{
            select:[]
          }
        },
        requiredAdd: [],
        requiredUp: [],
        addUpload:['address'],
      },
      entityCopy: {},
      fileVisible:false,
      upFileVisible:false,
      loading:false,
      dataForm:{
        type:'',
        address:'',
      },
      props: { multiple: false,emitPath:false,},
      options:[
        {
          value:'实验室资质',
          label:'实验室资质',
          children:[]
        },
        {
          value:'委托报告',
          label:'委托报告',
          children:null
        },
        {
          value:'进厂报告',
          label:'进厂报告',
          children:null
        },
      ],
    }
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity)
    this.getCertificationDetail()
  },
  methods: {
    refreshTable() {
      this.tableLoading = true
      selectItemParameter({...this.page, ...this.itemParameterForm}).then(res => {
        this.tableLoading = false
        if (res.code === 200) {
          this.tableData = res.data.records
          this.page.total = res.data.total
        }
      }).catch(err => {
        this.tableLoading = false
      })
    },
    getCertificationDetail(){
      this.$axios.post(this.$api.certification.getCertificationDetail, {
        page: {
          current: -1,
          size: -1,
        },
        entity: {
          name: null,
        }
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) {
          return
        }
        let arr = res.data.body.records.map(m=>{
          m.value = m.name;
          m.label = m.name;
          return m
        })
        this.options[0].children = arr;
        this.fileComponentData.selectField.type.select = arr;
      })
    },
    refresh() {
      this.componentData.entity = this.HaveJson(this.entityCopy)
      this.refreshTable()
    },
    pagination (page) {
      this.page.size = page.pageNum.limit
      this.refreshTable()
    },
    openAdd() {
      this.$refs.ValueTable.openAddDia(this.$api.laboratoryScope.addParameter);
    },
    openUpload(){
      this.dataForm.type = '';
      this.dataForm.address = '';
      this.upFileVisible = true;
    },
    fileManagement(row){
      this.fileVisible = true;
      this.fileComponentData.entity.labId = row.id;
      this.$nextTick(function () {
        this.$refs['ValueTable0'].selectList('page')
      })
    },
    confirmConnect(){
      if(!this.dataForm.type){
        this.$message.error('未上选择印章类型');
        return
      }
      if(!this.dataForm.address){
        this.$message.error('未上传印章');
        return
      }
      this.loading = true;
      this.$axios.post(this.$api.sealScope.addSeal, {
        labId:this.fileComponentData.entity.labId,
        ...this.dataForm
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        this.loading = false;
        if (res.code === 201) {
          return
        }
        this.$refs['ValueTable0'].selectList('page')
        this.upFileVisible = false;
      })
    },
    handleSuccess(response,){
      if (response.code == 200) {
        this.dataForm.address = response.data.url
      }
    },
    beforeUpload(file,type) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        return false;
      } else {
        return true;
      }
    },
    onError(err, file, fileList,type) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
  }
}
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>