Fixiaobai
2023-08-21 710fd8e475c383e16d0df64395efe8b31eec451d
	new file:   src/api/experiment/passRateStatistics.js
modified: src/api/laboratory/measure.js
modified: src/layout/components/Sidebar/Logo.vue
modified: src/views/experiment/passRateStatistics/index.vue
modified: src/views/laboratory/measure/index.vue
已修改4个文件
已添加1个文件
204 ■■■■ 文件已修改
src/api/experiment/passRateStatistics.js 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/laboratory/measure.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/Logo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/passRateStatistics/index.vue 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/measure/index.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/experiment/passRateStatistics.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
import request from '@/utils/request'
export function getSupplierList(params) {
    return request({
      url: '/qualificationRate/getSupplierList',
      method: 'get',
      params
    })
  }
  /**
   * æ ·å“åˆæ ¼çއ
   * @param {} params
   * @returns
   */
  export function getTestSampleStatistics(params) {
    return request({
      url: '/qualificationRate/getTestSampleStatistics',
      method: 'get',
      params
    })
  }
  /**
   * ä¾›åº”商合格率
   * @param {} params
   * @returns
   */
  export function getSupplierNoPassStatistics(params) {
    return request({
      url: '/qualificationRate/getSupplierNoPassStatistics',
      method: 'get',
      params
    })
  }
  /**
   * é¡¹ç›®åˆæ ¼çއ
   * @param {} params
   * @returns
   */
  export function getNoPassProjectStatistics(params) {
    return request({
      url: '/qualificationRate/getNoPassProjectStatistics',
      method: 'get',
      params
    })
  }
src/api/laboratory/measure.js
@@ -52,3 +52,11 @@
    data
  })
}
//修改计量
export function updateMetricalInformationInfo(data) {
  return request({
    url: '/metrical-information/updateMetricalInformationInfo',
    method: 'post',
    data
  })
}
src/layout/components/Sidebar/Logo.vue
@@ -46,7 +46,7 @@
  width: 100%;
  height: 50px;
  line-height: 50px;
  background: #fff;
  background: #f8f8f8;
  text-align: center;
  overflow: hidden;
src/views/experiment/passRateStatistics/index.vue
@@ -3,26 +3,21 @@
    <div class="top-bar">
      <el-form ref="form" :inline="true" :rules="rules" :model="searchData" label-position="top">
              <el-form-item label="检测日期:" class="sermargin" prop="date">
                <el-date-picker
                  v-model="searchData.date"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
          <el-date-picker v-model="searchData.date" type="daterange" range-separator="至" start-placeholder="开始日期"
                  end-placeholder="结束日期">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="检验类型:" class="sermargin" prop="type">
                <el-select v-model="searchData.type" placeholder="全部">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="物料分组:">
                <el-button type="primary" icon="el-icon-plus" class="chooseMaterialBtn" >选择物料分组</el-button>
        <el-form-item label="供应商:">
          <el-select v-model="searchData.supplier" placeholder="全部">
            <el-option v-for="item in supplier" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
              </el-form-item>
              <div class="rightBtn">
                <el-form-item>
@@ -35,7 +30,7 @@
    <div class="top-bar-copy"></div>
    <div class="chart-content">
      <div class="qualified-wrapper">
        <div style="margin-left: 20px;padding:20px 0px;font-size:18px">检测批次合格率统计</div>
        <div style="margin-left: 20px;padding:20px 0px;font-size:18px">检测样品合格率统计</div>
        <div class="qualified" ref="qualified"></div>
      </div>
      <div class="unqualified">
@@ -47,7 +42,8 @@
          <div class="secondBox_header">
            <div style="font-size:18px">不合格项目统计</div>
            <el-radio-group v-model="type">
              <el-radio-button v-for="item in radiooptions" :key="item.value" :label="item.value" >{{ item.label }}</el-radio-button>
              <el-radio-button v-for="item in radiooptions" :key="item.value" :label="item.value">{{ item.label
              }}</el-radio-button>
            </el-radio-group>
          </div>
          <div class="secondBox" ref="unqualified_project"></div>
@@ -74,22 +70,29 @@
})
import * as echarts from 'echarts'
import { getSupplierList,getTestSampleStatistics,getSupplierNoPassStatistics,getNoPassProjectStatistics } from '@/api/experiment/passRateStatistics';
import { dateFormat } from '../../../utils/dateUtil'
export default {
  data(){
    return {
      supplier: [],
      searchData:{
        date: [],
        type: 0,
        group: ''
        type: null,
        supplier: null
      },
      options:[
        {
          label: '采购入库',
          label: '原材料',
          value: 0
        },
        {
          label: 'xxxx',
          label: '成品',
          value: 1
        },
        {
          label: '委托品',
          value: 2
        }
      ],
      radiooptions:[
@@ -104,12 +107,15 @@
      ],
      type: 0,
      rules: {
        date: [{required: true, message: '请输入账号', trigger: 'blur'}],
        type: [{required: true, message: '请输入名字', trigger: 'blur'}]
        // date: [{ required: true, message: '请输入账号', trigger: 'blur' }],
        // type: [{ required: true, message: '请输入名字', trigger: 'blur' }]
      }
    }
  },
  mounted() {
    this.getSupplierList()
    this.getTestSampleStatistics()
    this.getSupplierNoPassStatistics()
    const chartDom_qualified = this.$refs.qualified;
    const chartDom_unqualified_provider = this.$refs.unqualified_provider;
    const chartDom_unqualified_project = this.$refs.unqualified_project;
@@ -118,6 +124,9 @@
    const myChart2 = echarts.init(chartDom_unqualified_provider);
    const myChart3 = echarts.init(chartDom_unqualified_project);
    /**
     * æ£€æµ‹åˆæ ¼çŽ‡ç»Ÿè®¡
     */
    const option_qualified = {
      tooltip: {
        trigger: 'axis',
@@ -164,6 +173,9 @@
        }
      ]
    };
    /**
     * ä¾›åº”商
     */
    const option_unqualified1 ={
      tooltip: {
        trigger: 'axis',
@@ -207,6 +219,9 @@
        }
      ]
    };
    /**
     * ä¸åˆæ ¼é¡¹ç›®
     */
    const option_unqualified2 = {
      legend: {
        orient: 'vertical',
@@ -252,6 +267,34 @@
    if(this.type === 1){
      myChart3.setOption(option_unqualified2);
    }
  },
  methods: {
    search() {
      this.getTestSampleStatistics()
    },
    dateHandle(){
      let data=JSON.parse(JSON.stringify(this.searchData))
      if(this.searchData.date.length!=0&&this.searchData.date !=[]){
        data.beginDate=dateFormat(this.searchData.date[0])
        data.endDate=dateFormat(this.searchData.date[1])
      }
      data.date=null
      return data
    },
    async getSupplierList() {
      let res = await getSupplierList()
      res.data.forEach(item => {
        this.supplier.push({ label: item.supplier, value: item.supplier })
      })
    },
    getTestSampleStatistics(){
     let param= this.dateHandle()
     let res =getTestSampleStatistics(param)
    },
    getSupplierNoPassStatistics(){
      let param= this.dateHandle()
      getSupplierNoPassStatistics(param)
    }
  }
}
</script>
@@ -260,6 +303,7 @@
.content-main{
  height:100%;
  width: 100%;
  .top-bar{
    position: absolute;
    width: 99%;
@@ -273,8 +317,10 @@
    justify-content: space-between;
    padding: 5px 24px 0px 24px;
    transition: position 0.3s ease; 
    .el-form{
      width: 100%;
      .chooseMaterialBtn{
        background-color: #fff;
        border-color: rgba(192,196,204,0.5);
@@ -282,9 +328,11 @@
        width: 220px;
      }
    }
    .sermargin{
      margin-right: 60px;
    }
    .rightBtn{
      display:flex;
      justify-content:end;
@@ -293,50 +341,61 @@
      margin-bottom: -10px;
    }
  }
  .top-bar.fixed {
    position: fixed;
    top: 0.45rem;
    left: 0.52rem;
    width:93.8%;
  }
  .top-bar-copy{
    width: 100%;
    height: 12vh;
  }
  .chart-content{
    margin: 0px -15px;
    margin-bottom: 60px;
    .qualified-wrapper{
      // margin-top: 14vh;
      background-color: #fff;
      width: 100%;
      height:50vh;
    }
    .qualified{
      width: 100%;
      height: 400px;
    }
    .unqualified{
      margin-top: 10px;
      height: 50vh;
      display:flex;
      justify-content: space-between;
      .firstBox-wrapper{
        background-color: #fff;
        width:49%;
        .firstBox{
          width: 100%;
          height: 40vh;
        }
      }
      .secondBox-wrapper{
        background-color:#fff;
        width:49%;
        .secondBox_header{
          display:flex;
          justify-content: space-between;
          margin: 20px 20px;
        }
        .secondBox{
          width: 100%;
          height: 40vh;
@@ -344,6 +403,7 @@
      }
    }
  }
  .bottom{
    position: fixed;
    width: 95%;
src/views/laboratory/measure/index.vue
@@ -208,9 +208,10 @@
      <el-form label-position="top" ref="upmeasureForm" :model="measureUpInfo">
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="检定有效期" prop="date" :rules="[{ required: true, message: '请选择检定有效期', trigger: 'change' }]">
              <el-date-picker v-model="measureUpInfo.date" type="daterange" range-separator="至" start-placeholder="开始日期"
                end-placeholder="结束日期" />
              <el-form-item label="检定有效期" prop="date"
                :rules="[{ required: true, message: '请选择检定有效期', trigger: 'change' }]">
                <el-date-picker v-model="measureUpInfo.date" type="date" placeholder="选择日期">
                </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
@@ -247,7 +248,7 @@
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="">
              <el-upload class="upload-demo" action="#" :on-change="handleUpload" :auto-upload="false">
                <el-upload class="upload-demo" action="#" :on-change="handleUploadupdated" :auto-upload="false">
                <el-button size="small" type="primary">点击上传</el-button>
              </el-upload>
            </el-form-item>
@@ -255,7 +256,7 @@
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addMeasure">ç¡® å®š</el-button>
          <el-button type="primary" @click="upMeasure">ç¡® å®š</el-button>
        <el-button @click="dialogVisible=false">取 æ¶ˆ</el-button>
      </span>
@@ -265,7 +266,7 @@
</template>
<script>
import { getPlanPageList, getStandingPageList, getPlanMeasureInstrument, limitGetPlanMeasureRequest } from '@/api/laboratory/measure'
import { getPlanPageList, getStandingPageList, getPlanMeasureInstrument, limitGetPlanMeasureRequest, updateMetricalInformationInfo } from '@/api/laboratory/measure'
import { default as Add } from "./Add.vue";
export default {
  components: {
@@ -276,12 +277,15 @@
      dialogVisible: false,
      tableIndex: null,
      measureUpInfo:{
        id: null,
        code: null,
        result: null,
        date: null,
        uncertainty: null,
        performanceIndex: null,
        remarks: null,
        file: null
        file: null,
        termValidity: null
      },
      result: [{
        label: '合格',
@@ -339,11 +343,31 @@
        this.measureData[this.tableIndex].result=this.resultUp
        
    },
    async upMeasure() {
      let res = await updateMetricalInformationInfo(this.measureUpInfo)
      if (res) {
        this.$message({
          message: '操作成功!',
          type: 'success'
        });
        this.limitGetPlanMeasureInstrument()
        this.dialogVisible = false
      }
    },
    handleUploadupdated() {
    },
    measureUp(scope) {
      console.log(scope);
      this.dialogVisible = true
      this.tableIndex=scope.$index
      this.measureUpInfo.result=scope.row.result
      this.measureUpInfo.code = scope.row.code
      this.measureUpInfo.date = scope.row.endDate
      this.measureUpInfo.id = scope.row.imId
      this.measureUpInfo.uncertainty = scope.row.uncertainty
      this.measureUpInfo.performanceIndex = scope.row.performanceIndex
      this.measureUpInfo.remarks = scope.row.remarks
      this.measureUpInfo.termValidity = scope.row.termValidity
    },
    measureAdd() {
      let add = this.$refs.add.add()
@@ -357,7 +381,6 @@
      }
    },
    async handleSizeChangePlan(num) {
      console.log(num);
      this.pageSizePlan = num
      await this.limitGetPlanMeasureInstrument()
    },
@@ -376,7 +399,6 @@
        currentPage: this.currentPagePlan,
        pageSize: this.pageSizePlan
      }
      console.log(param);
      let res = await limitGetPlanMeasureRequest(param)
      this.totalPlan = res.data.taotal
      this.measureData = res.data.list
@@ -390,7 +412,6 @@
    },
    async getPlanAndInfoAndIns(id) {
      let res = await getPlanMeasureInstrument({ "id": id, "currentPage": this.currentPagePlan, "pageSize": this.pageSize });
      console.log(res);
      for (const key in res.data.list) {
        this.planInfo[key] = res.data.list[key]
      }
@@ -411,7 +432,6 @@
    },
    blurSearch() {
      if (this.radioValue === 1) {
        console.log("计划");
      }
    },
    handleClose() {
@@ -430,7 +450,6 @@
        currentPage: this.currentPage, pageSize: this.pageSize,
        code: this.searchData.code, name: this.searchData.name, unit: this.searchData.measureunit
      }
      console.log(param);
      const res = await getStandingPageList(param)
      this.measureLedgerTable = res.data.records
      this.total = res.data.total
@@ -478,7 +497,6 @@
        currentPage: this.currentPage, pageSize: this.pageSize,
        code: this.searchData.code, name: this.searchData.name, unit: this.searchData.measureunit
      }
      console.log(param);
      const res = await getPlanPageList(param)
      res.data.list.forEach(item => {
        item.palanDate = item.beginTime + " ~ " + item.endTime
@@ -487,7 +505,6 @@
      this.total = res.data.total
    },
    async lookMeasurement(code) {
      console.log(code);
    },
  }
}