zhuo
2025-03-29 d233572a40431aa56e665553a87df80c973ca5b2
Merge remote-tracking branch 'origin/dev' into dev
已修改7个文件
已添加1个文件
438 ■■■■■ 文件已修改
src/api/business/productOrder.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/statisticalCharts/dataAnalysis.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/management.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/materialOrder/customsInspection.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/components/addInspectionDia.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/index.vue 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/statisticalCharts/inspectionItemWarning/index.vue 281 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/productOrder.js
@@ -122,3 +122,11 @@
    data: query
  })
}
// ä¿®æ”¹æ ·å“åž‹å·
export function updateSampleModel(query) {
  return request({
    url: '/insOrder/updateSampleModel',
    method: 'post',
    data: query
  })
}
src/api/statisticalCharts/dataAnalysis.js
@@ -71,3 +71,19 @@
    data: query,
  });
}
//查询预警列表
export function selectDeviationWarningPage(query) {
  return request({
    url: "/insProductDeviationWarning/selectDeviationWarningPage",
    method: "get",
    params: query,
  });
}
//查询预警列表
export function selectDeviationWarning(query) {
  return request({
    url: "/insProductDeviationWarning/selectDeviationWarning",
    method: "get",
    params: query,
  });
}
src/views/CNAS/resourceDemand/device/component/management.vue
@@ -1,7 +1,7 @@
<!-- è®¾å¤‡å·¥å…·æ˜Žç»† -->
<template>
    <div class="role_manage">
    <div class="search">
    <div class="search" v-show="!showData">
      <div>
        <el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
          <el-form-item label="状态" prop="deviceStatus" class="form-item">
@@ -444,11 +444,9 @@
            labelPosition: 'right',
            dialogVisible: false,
            dialogVisible2: false,
            addPower: false,
            showData: false, // æ•°é‡‡é…ç½®é¡µé¢
            tableList: [],
            addDia: true,
            addPower: true,
            //设备类型列表
            equipmentList: [],
            // è´Ÿè´£äººåˆ—表
src/views/business/materialOrder/customsInspection.vue
@@ -356,10 +356,9 @@
      </span>
    </el-dialog>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
               :show-close="false" :visible.sync="bsm3Dia"
               title="区间值填写" width="800px">
      <el-table :data="editTable" height="80vh" style="width: 100%">
      <el-table :data="editTable" height="80vh" style="width: 100%" :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
        <!-- inspectionItemList -->
        <el-table-column label="检验项" prop="inspectionItemList" width="180">
        </el-table-column>
src/views/business/productOrder/components/addInspectionDia.vue
@@ -27,9 +27,9 @@
                      size="small"></el-input>
          </template>
        </el-table-column>
        <el-table-column align="center" label="检验标准" min-width="100" prop="standardMethodListId">
        <el-table-column align="center" label="检验标准" min-width="100" prop="standardMethodName">
          <template slot-scope="scope">
            <el-input v-model="scope.row.standardMethodListId" clearable disabled placeholder="不填写则系统自动生成"
            <el-input v-model="scope.row.standardMethodName" clearable disabled placeholder="不填写则系统自动生成"
                      size="small"></el-input>
          </template>
        </el-table-column>
src/views/business/productOrder/index.vue
@@ -294,9 +294,28 @@
      @closePrintDialog="closePrintDialog"></print-dialog>
    <!--添加遗漏检验项弹框-->
    <add-inspection-dia v-if="addInspectionDia" ref="addInspectionDia"></add-inspection-dia>
    <!--    <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"-->
    <!--                :sonLaboratory="sonLaboratory" :state="state"-->
    <!--                :typeSource="typeSource" @goback="goback" @refreshView="refreshView"/>-->
    <!--修改样品型号弹框-->
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :visible.sync="dialogVisible" title="修改样品型号" width="80%">
      <el-table ref="sampleTable" :data="sampleList" border highlight-current-row
                :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
                max-height="400px" tooltip-effect="dark">
        <el-table-column align="center" label="序号" type="index" width="65"></el-table-column>
        <el-table-column align="center" label="样品名称" min-width="100" prop="sample"> </el-table-column>
        <el-table-column align="center" label="样品编号" min-width="100" prop="sampleCode"></el-table-column>
        <el-table-column align="center" label="样品型号" min-width="60" prop="model">
          <template slot-scope="scope">
            <el-input v-model="scope.row.model" clearable placeholder="不填写则系统自动生成"
                      size="small"></el-input>
          </template>
        </el-table-column>
        <el-table-column align="center" label="检验标准" min-width="100" prop="standardMethodName"></el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button :loading="submitListLoad" type="primary" @click="submitList">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -307,11 +326,11 @@
import AddInspectionDia from "@/views/business/productOrder/components/addInspectionDia.vue";
import limsTable from "@/components/Table/lims-table.vue";
import {
  checkUpdate, delInsOrder,
  checkUpdate, delInsOrder, getSampleByOrderId,
  rawAllInsOrderExport,
  selectInsOrderParameter, selectNoProducts, selectOrderManDay,
  updateInspected,
  updateOrderEntrustCode, updateStatus, upInsOrder, upPlanUser2
  updateOrderEntrustCode, updateSampleModel, updateStatus, upInsOrder, upPlanUser2
} from "@/api/business/productOrder";
import { selectUserCondition } from "@/api/performance/class";
import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
@@ -349,7 +368,13 @@
          dataType: "link",
          linkMethod: "selectAllByOne",
        },
        { label: '样品型号', prop: 'sampleModel' },
        {
          label: "样品型号",
          prop: "sampleModel",
          width: "160px",
          dataType: "link",
          linkMethod: "editSampleModel",
        },
        { label: '样品数量', prop: 'sampleNum' },
        { label: '检验人', prop: 'testingName' },
        {
@@ -736,7 +761,10 @@
      multipleSelection: [],
      sonLaboratoryList: [],
      printDialog: false,
      addInspectionDia: false
      addInspectionDia: false,
      dialogVisible: false,
      submitListLoad: false,
      sampleList: []
    }
  },
  watch: {
@@ -941,7 +969,7 @@
      this.dataDialogVisible = false;
      this.upLoad = false;
    },
    // è¯¦æƒ…
    // ç‚¹å‡»æ ·å“åç§°
    selectAllByOne(row) {
      this.$router.push({
        path: "/productOrder/add", query: {
@@ -952,6 +980,32 @@
        }
      });
    },
    // ä¿®æ”¹æ ·å“åž‹å·
    editSampleModel (row) {
      if (this.tabIndex !== 1) {
        return
      }
      this.dialogVisible = true
      this.getDataList(row)
    },
    getDataList(row) {
      this.dialogVisible = true
      getSampleByOrderId({insOrderId: row.id}).then(res => {
        this.sampleList = res.data
      })
    },
    // æäº¤æ ·å“åž‹å·ä¿®æ”¹
    submitList () {
      this.submitListLoad = true
      updateSampleModel(this.sampleList).then(res => {
        this.submitListLoad = false
        this.dialogVisible = false
        this.$message.success('修改成功')
        this.refreshTable()
      }).catch(err => {
        this.submitListLoad = false
      })
    },
    // æ•°æ®æŸ¥çœ‹
    handleDataLook(row) {
      this.dataDialogVisible = true;
src/views/statisticalCharts/inspectionItemWarning/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,281 @@
<template>
  <div class="app-container">
    <div>
      <lims-table :tableData="tableData" :column="column"
                  :height="'calc(100vh - 500px)'" @pagination="pagination"
                  :rowClick="rowClick"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <div>
      <el-row>
        <el-col :span="24">
          <div class="inspection-card">
            <div class="title">检验项偏差预警数据详情</div>
            <Echarts ref="chart"
                     :chartStyle="chartStyle"
                     :grid="grid"
                     :options="echartsOptions"
                     :series="echartsSeries"
                     :tooltip="tooltip"
                     :xAxis="xAxis"
                     :yAxis="yAxis"
                     style="height: 40vh;"></Echarts>
          </div>
        </el-col>
      </el-row>
    </div>
    <el-dialog :visible.sync="viewDia" title="查看详情" width="1100px">
      <lims-table :tableData="tableData1" :column="column1"
                  height="570"
                  :tableLoading="tableLoading1"></lims-table>
    </el-dialog>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import {selectDeviationWarning, selectDeviationWarningPage} from "@/api/statisticalCharts/dataAnalysis";
import Echarts from "@/components/echarts/echarts.vue";
export default {
  name: '',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {Echarts, limsTable},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      viewDia: false,
      queryParams: {},
      tableData: [],
      tableLoading: false,
      column: [
        { label: '样品编号', prop: 'sampleCode',width: 150 },
        { label: '样品名称', prop: 'sampleName',width: 150 },
        { label: '型号', prop: 'sampleModel' },
        { label: '供应商名称', prop: 'supplierName',width: 150 },
        { label: '检验项名称', prop: 'inspectionItemName',width: 150 },
        { label: '供应商名称', prop: 'supplierName',width: 150 },
        {
          label: "偏差值",
          prop: "deviationValue",
          width: 150,
          dataType: "tag",
          formatType: (params) => {
            return 'danger'
          },
        },
        { label: '检测时间', prop: 'detectionTime',width: 160 },
        {
          dataType: 'action',
          label: '操作',
          operation: [
            {
              name: '查看',
              type: 'text',
              clickFun: (row) => {
                this.openDia(row);
              },
            }
          ]
        }
      ],
      page: {
        total: 0,
        size: 20,
        current: 1
      },
      tableData1: [],
      tableLoading1: false,
      column1: [
        { label: '样品编号', prop: 'sampleCode'},
        { label: '供应商名称', prop: 'supplierName'},
        { label: '供应商名称', prop: 'supplierName'},
        {
          label: "检测值",
          prop: "testValue",
          width: 150,
          dataType: "tag",
          formatType: (params) => {
            if (this.tableData1.find((m) => m.testValue == params).isIssue == 1) {
              return 'danger'
            } else {
              return 'success'
            }
          },
        },
        { label: '检测时间', prop: 'detectionTime',width: 160 },
      ],
      chartStyle: {
        width: '100%',
        height: '96%' // è®¾ç½®å›¾è¡¨å®¹å™¨çš„高度
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      tooltip: {},
      echartsOptions: {},
      echartsSeries: [
        {
          name: '偏差值',
          type: 'line',
          smooth: true,
          tooltip: {
            valueFormatter: function (value) {
              return value;
            }
          },
          label: {
            show: true,
            position: 'top',
            formatter: function (value) {
              return value.value;
            },
            distance: 14
          },
          data: [],
          markArea: {},
          markPoint: {}
        },
      ],
      xAxis: [
        {
          type: 'category',
          data: [],
          boundaryGap: false,
          axisLabel: {
            interval: 0, // å¼ºåˆ¶æ˜¾ç¤ºæ‰€æœ‰æ ‡ç­¾
            rotate: 0,   // ä¸æ—‹è½¬ï¼ˆå¯ä»¥æ ¹æ®éœ€è¦è°ƒæ•´ï¼‰
            formatter: function (value) {
              // æ¯éš”一定长度添加换行符
              const maxLength = 9; // æ¯æ®µæœ€å¤§å­—符数
              let result = '';
              for (let i = 0; i < value.length; i += maxLength) {
                result += value.substring(i, i + maxLength) + '\n';
              }
              return result.trim(); // åŽ»æŽ‰æœ«å°¾å¤šä½™çš„æ¢è¡Œç¬¦
            },
            margin: 10, // æ ‡ç­¾ä¸Žè½´çº¿çš„距离
          },
        }
      ],
      yAxis: [{
        type: 'value',
        axisLabel: {
          formatter: '{value}'
        }
      }],
    };
  },
  mounted() {
    this.refreshTable()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表信息
    refreshTable() {
      this.tableLoading = true
      selectDeviationWarningPage({ ...this.page}).then(res => {
        this.tableLoading = false
        this.tableData = res.data.records
        this.page.total = res.data.total
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // æŸ¥è¯¢æŠ˜çº¿å›¾ä¿¡æ¯
    rowClick (row) {
      selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => {
        console.log('res---', res)
        if (res.data === null) {
          this.$message.warning('暂无数据')
          return
        }
        let lineData = []
        let xAxis = []
        let markAreas = []; // å­˜å‚¨ markArea çš„æ•°ç»„
        let markPoints = [];
        res.data.forEach((item, index) => {
          lineData.push(item.testValue)
          xAxis.push(item.sampleCode)
          // å¦‚æžœ isIssue ä¸º 1,则在此索引处添加一个 markArea
          if (item.isIssue == 1) {
            const startColumn = index > 0 ? xAxis[index - 1] : xAxis[index]; // èµ·ç‚¹ï¼šå‰ä¸€åˆ—或当前列
            const endColumn = xAxis[index]; // ç»ˆç‚¹ï¼šå½“前列
            markAreas.push([
              {
                xAxis: startColumn, // ä»Žå‰ä¸€åˆ—开始
              },
              {
                xAxis: endColumn, // åˆ°å½“前列结束
              }
            ]);
            markPoints.push({
              name: '问题点',
              coord: [item.sampleCode, item.testValue],
              value: item.testValue,
              itemStyle: {
                color: 'rgba(255, 173, 177, 0.8)'
              },
              label: {
                show: true,
                formatter: function(params) {
                  return params.value; // è‡ªå®šä¹‰æ ‡ç­¾å†…容
                },
                color: 'black', // æ ‡ç­¾æ–‡å­—颜色
                fontSize: 12,
                distance: 5, // è°ƒæ•´æ ‡ç­¾ä¸Žæ°”泡的距离
                padding: [0,0],
                backgroundColor: 'rgba(255, 173, 177, 0.8)', // æ ‡ç­¾èƒŒæ™¯è‰²åŠé€æ˜Žåº¦
                borderRadius: 4
              }
            });
          }
        })
        this.xAxis[0].data = xAxis
        this.echartsSeries[0].data = lineData
        // æ›´æ–° markArea é…ç½®
        this.echartsSeries[0].markArea = {
          itemStyle: {
            color: 'rgba(255, 173, 177, 0.4)' // è®¾ç½®èƒŒæ™¯é¢œè‰²
          },
          data: markAreas // åŠ¨æ€ç”Ÿæˆçš„ markArea æ•°æ®
        };
        this.echartsSeries[0].markPoint = {
          data: markPoints
        };
      })
    },
    // é‡ç½®
    refresh() {
      // this.resetForm('entity')
      this.refreshTable()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.refreshTable()
    },
    openDia (row) {
      this.viewDia = true
      this.tableLoading1 = true
      selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => {
        this.tableLoading1 = false
        this.tableData1 = res.data
      }).catch(() => {
        this.tableLoading1 = false
      })
    },
  }
};
</script>
<style scoped>
.inspection-card{
  width: 100%;
  margin-top: 10px;
}
</style>
src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue
@@ -103,6 +103,15 @@
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="editForm.inspectionItemType == 1">
            <el-form-item label="设备绑定:" prop="deviceId">
              <el-select v-model="editForm.deviceId" clearable placeholder="请选择" size="small" style="width: 100%" multiple>
                <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="检验值类型:" prop="inspectionValueType">
              <el-select v-model="editForm.inspectionValueType" clearable placeholder="请选择" size="small" style="width: 100%">
@@ -110,8 +119,6 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="特殊标识:" prop="bsm">
              <el-select v-model="editForm.bsm" clearable placeholder="请选择" size="small" style="width: 100%">
@@ -119,6 +126,8 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="原始记录模板:" prop="templateId">
              <el-select v-model="editForm.templateId" clearable placeholder="请选择" size="small" style="width: 100%">
@@ -126,20 +135,18 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="检验项分类:" prop="inspectionItemClass">
              <el-input v-model="editForm.inspectionItemClass" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="检验项分类EN:" prop="inspectionItemClassEn">
              <el-input v-model="editForm.inspectionItemClassEn" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="试验方法:" prop="method">
              <el-select v-model="editForm.method" clearable multiple placeholder="请选择" size="small" style="width: 100%">
@@ -147,6 +154,8 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="条件:" prop="radiusList">
              <el-select v-model="editForm.radiusList" allow-create default-first-option filterable multiple
@@ -157,8 +166,6 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="收费标准(元/次):" prop="rates">
              <el-input v-model="editForm.rates" clearable size="small"></el-input>
@@ -191,6 +198,7 @@
  upItemParameter
} from "@/api/structural/capability";
import {selectStandardMethods} from "@/api/structural/standardMethod";
import {search} from "@/api/business/inspectionTask";
export default {
  name: "EditForm",
@@ -227,6 +235,7 @@
        method: '', // è¯•验方法
        radiusList: [], // æ¡ä»¶
        rates: '', // æ¡ä»¶
        deviceId: [], // è®¾å¤‡
      },
      sampleList: [], // æ£€éªŒå¯¹è±¡ä¸‹æ‹‰æ¡†
      laboratoryList: [], // åœºæ‰€ä¸‹æ‹‰æ¡†
@@ -262,7 +271,8 @@
          { required: true, message: '请选择原始记录模板', trigger: 'change' }
        ]
      },
      operationType: ''
      operationType: '',
      equipOptions: []
    }
  },
  // æ–¹æ³•集合
@@ -270,6 +280,7 @@
    openDia (type, row) {
      this.operationType = type
      this.editFormDia = true
      this.getEquipOptions() // èŽ·å–æ‰€æœ‰è®¾å¤‡
      this.obtainItemParameterList() // åœºæ‰€ç±»åž‹
      this.getStandardTemplate() // åŽŸå§‹è®°å½•æ¨¡æ¿ä¸‹æ‹‰æ¡†
      this.getSelectStandardMethods() // è¯•验方法
@@ -305,8 +316,9 @@
      } else {
        this.editForm = this.HaveJson(row)
        this.editForm.sample = JSON.parse(this.editForm.sample)
        this.editForm.radiusList = JSON.parse(this.editForm.radiusList)
        this.editForm.radiusList = this.editForm.radiusList && JSON.parse(this.editForm.radiusList)
        this.editForm.method = JSON.parse(this.editForm.method)
        this.$set(this.editForm, 'deviceId', this.editForm.deviceIds && this.editForm.deviceIds.split(","))
      }
    },
    // æäº¤ç¼–辑
@@ -321,6 +333,11 @@
            obj.radiusList = JSON.stringify(obj.radiusList)
          } else {
            obj.radiusList = null
          }
          if (obj.deviceId?.length > 0) {
            obj.deviceIds = obj.deviceId.join(',')
          } else {
            obj.deviceIds = null
          }
          if(obj.id){
            // ä¿®æ”¹
@@ -425,6 +442,21 @@
        this.templateIdList = data
      })
    },
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
    getEquipOptions() {
      this.equipOptions = [];
      search({ status: 0 }).then((res) => {
        if (res.code === 200 && res.data) {
          this.equipOptions = res.data.map((m) => {
            m.value = m.managementNumber;
            m.label = m.deviceName;
            return m;
          });
        }
      }).catch((error) => {
        console.error(error);
      });
    },
  },
}
</script>