zouyu
2023-09-06 154d53ca0f4c9a3f1a8433ae4d458f65a81341dc
	modified:   .env.development
modified: src/views/experiment/planAssignments/plan.vue
modified: src/views/inspectionManagement/commissionInspection/addCommision.vue
modified: src/views/inspectionManagement/commissionInspection/index.vue
modified: src/views/inspectionManagement/reportForInspection/index.vue
modified: src/views/laboratory/ledger/index.vue
modified: src/views/standardLibrary/index.vue
已修改7个文件
167 ■■■■ 文件已修改
.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/planAssignments/plan.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/commissionInspection/addCommision.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/commissionInspection/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/reportForInspection/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/ledger/index.vue 143 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/standardLibrary/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
VUE_APP_BASE_API =  'http://localhost:1234/'
VUE_APP_BASE_API =  'http://192.168.218.96:1234/'
src/views/experiment/planAssignments/plan.vue
@@ -160,7 +160,7 @@
                    <el-col :span="7">{{upData.internal}}</el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col :span="5" style="font-size: 14px;text-align: right;">检验状态:</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">检验结果:</el-col>
                    <el-col :span="7">
                        <el-tag type="success" v-if="upData.testState==1">合格</el-tag>
                        <el-tag type="danger" v-else-if="upData.testState==0">不合格</el-tag>
src/views/inspectionManagement/commissionInspection/addCommision.vue
@@ -122,7 +122,7 @@
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="报告数:">
                                        <el-input style="width: 200px;" v-model="infoForm.num" placeholder="请输入报告数" autocomplete="off"
                                        <el-input type="number" min="0" style="width: 200px;" v-model="infoForm.num" placeholder="请输入报告数" autocomplete="off"
                                            size="small" />
                                    </el-form-item>
                                </el-col>
@@ -158,7 +158,7 @@
                                <el-form-item label="样品名称:">
                                    <el-select v-model="addPointerForm.sampleName" size="small" placeholder="请选择样品名称"
                                        @change="upMaterialName">
                                        <el-option v-for="options in sampleoptions" :value="options.key" :label="options.value"></el-option>
                                        <el-option v-for="(options,index) in sampleoptions" :key="index" :value="options.key" :label="options.value"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
src/views/inspectionManagement/commissionInspection/index.vue
@@ -73,7 +73,7 @@
                            <el-table-column prop="contacts" label="委托编制人" min-width="8%" />
                            <el-table-column prop="inspection_status" label="状态" min-width="8%">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.inspection_status === 0">
                                    <div v-if="scope.row.inspection_status === 2">
                                        <span style="color: green;">已报检</span>
                                    </div>
                                    <div v-else>
@@ -209,11 +209,11 @@
                        value: null
                    },
                    {
                        label: '已检验',
                        value: 0
                        label: '已报检',
                        value: 2
                    },
                    {
                        label: '待检验',
                        label: '未报检',
                        value: 1
                    }
                ],
src/views/inspectionManagement/reportForInspection/index.vue
@@ -413,8 +413,7 @@
                    "unit": val.unit,
                    "version": this.addInspectionForm.version
                    }
                    // this.createReport(obj);
                    console.log("obj---",obj);
                    this.createReport(obj);
                    this.addReportDialog = false;
                }
                }));
src/views/laboratory/ledger/index.vue
@@ -26,7 +26,7 @@
        <div class="table-header">
          <div class="search-bar">
            <el-row :gutter="20">
              <el-col :span="15">
              <el-col :span="8">
                <el-form ref="form" :inline="true" :model="searchData">
                  <el-form-item>
                    <el-input v-model="searchData.keyword" placeholder="请输入编号/设备名称/型号规格">
@@ -36,13 +36,11 @@
                  <el-form-item>
                    <el-button type="primary" @click="filterTableData">查询</el-button>
                    <el-button type="primary" plain @click="resetBtn">重置</el-button>
                    <!-- <el-button type="text">高级搜索<i class="el-icon-arrow-down el-icon--right" /></el-button> -->
                  </el-form-item>
                </el-form>
              </el-col>
              <el-col :span="9">
              <el-col :span="16">
                <el-radio-group v-model="radioValue" @change="getConditionTable">
                  <!-- <el-radio-button label="0">全部</el-radio-button> -->
                  <el-radio-button v-for="item in conditionsOptions" :key="item.value" :label="item.value">
                    {{ item.label }}
                  </el-radio-button>
@@ -174,11 +172,9 @@
        </div>
        <el-tabs v-model="activeTabsName">
          <el-tab-pane label="设备码点" name="codePoints">
            <el-button v-show="!codePointesTableStatus" :style="{ marginBottom: '18px' }"
              @click="addCodePoints">新增设备码点</el-button>
            <div v-show="codePointesTableStatus" :style="{ marginBottom: '18px' }" class="btns">
            <div :style="{ marginBottom: '18px' }" class="btns">
              <el-button @click="addNewCodePoints">添加</el-button>
              <el-button @click="saveCodePoins">保存</el-button>
              <el-button v-show="codePointesTableStatus" @click="saveCodePoins">保存</el-button>
              <el-button @click="closeCodePoins">取消</el-button>
            </div>
@@ -188,29 +184,26 @@
              <el-table-column type="index" label="序号" min-width="90" />
              <el-table-column prop="equipmentPoint" label="码点编码" min-width="150">
                <template slot-scope="scope">
                  <span v-show="!codePointesTableStatus">{{ scope.row.equipmentPoint }}</span>
                  <el-input v-show="codePointesTableStatus" v-model="scope.row.equipmentPoint" />
                  <el-input v-if="codePointesTableStatus && scope.row.isInput" v-model="scope.row.equipmentPoint" />
                  <span v-else>{{ scope.row.equipmentPoint }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="equipmentPointName" label="码点名称" min-width="150">
                <template slot-scope="scope">
                  <span v-show="!codePointesTableStatus">{{ scope.row.equipmentPointName }}</span>
                  <el-input v-show="codePointesTableStatus" v-model="scope.row.equipmentPointName" />
                  <el-input v-if="codePointesTableStatus && scope.row.isInput" v-model="scope.row.equipmentPointName" />
                  <span v-else>{{ scope.row.equipmentPointName }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="unit" label="单位" min-width="150">
                <template slot-scope="scope">
                  <span v-show="!codePointesTableStatus">{{ scope.row.unit }}</span>
                  <el-input v-show="codePointesTableStatus" v-model="scope.row.unit" />
                  <el-input v-if="codePointesTableStatus && scope.row.isInput" v-model="scope.row.unit" />
                  <span v-else>{{ scope.row.unit }}</span>
                </template>
              </el-table-column>
              <!-- <el-table-column prop="name" label="更新人" min-width="100" />
              <el-table-column prop="updateTime" label="更新日期" min-width="120" /> -->
              <el-table-column prop="descriptiveness" label="描述" min-width="200">
                <template slot-scope="scope">
                  <span v-show="!codePointesTableStatus">{{ scope.row.descriptiveness }}</span>
                  <el-input v-show="codePointesTableStatus" v-model="scope.row.descriptiveness" />
                  <el-input v-if="codePointesTableStatus && scope.row.isInput" v-model="scope.row.descriptiveness" />
                  <span v-else>{{ scope.row.descriptiveness }}</span>
                </template>
              </el-table-column>
@@ -273,7 +266,7 @@
            <el-col :span="11">
              <el-form-item label="状态:" prop="conditions"
                :rules="[{ required: true, message: '请选择仪器设备状态', trigger: 'blur' }]" label-width="80">
                <el-select v-model="equipmentform.conditions" clearable filterable :allow-create="true"
                <el-select v-model="equipmentform.conditions" clearable :allow-create="true"
                  placeholder="请选择仪器设备状态" style="width:100%">
                  <el-option v-for="item in conditionsOptions" :key="item.value" :label="item.label"
                    :value="item.value" />
@@ -328,7 +321,7 @@
            </el-col>
            <el-col :span="11">
              <el-form-item label="保管人:" label-width="80">
                <el-select v-model="equipmentform.userId" clearable filterable :allow-create="true" placeholder="请选择保管人"
                <el-select v-model="equipmentform.userId" clearable :allow-create="true" placeholder="请选择保管人"
                  style="width:100%">
                  <el-option v-for="item in userOpetions" :key="item.id" :label="item.label" :value="item.value" />
                </el-select>
@@ -566,6 +559,7 @@
      // 码点表格
      codePointsTable: [
        {
          'isInput':false,
          'unit': '',
          'descriptiveness': '',
          'equipmentPoint': '',
@@ -674,7 +668,6 @@
    },
    // 显示仪器详情
    async openDetail(row) {
      // console.log(row)
      this.detailDrawer = true
      const { data } = await getInstrumentDetail({ InstrumentId: row.id })
      this.equipmentDetail = data
@@ -720,15 +713,13 @@
    addCodePoints() {
      // 添加新码点,清空原数组
      this.codePointesTableStatus = true
      this.codePointsTable = undefined
    },
    // 新增设备码点
    addNewCodePoints() {
      //
      if (!this.codePointsTable) {
        this.codePointsTable = []
      }
      console.log(this.equipmentDetail.id);
      this.codePointesTableStatus = true;
      const newObj = {}
      newObj.isInput = true,
      newObj.name = '' // 当前用户的名称
      newObj.updateTime = '' // 获取当前时间
      newObj.equipmentPoint = ''
@@ -736,25 +727,21 @@
      newObj.descriptiveness = ''
      newObj.unit = ''
      newObj.instrumentId = this.equipmentDetail.id
      this.codePointsTable.push(newObj)
      this.codePointsTable.unshift(newObj)
    },
    // 保存提交新增设备码点
    async saveCodePoins() {
      console.log(this.codePointsTable)
      if (!this.codePointsTable) {
        this.codePointsTable = []
      if (this.codePointsTable.length === 0) {
        return this.$message.error('请点击添加按钮添加数据')
      }
      if (this.codePointsTable.length === 0) return this.$message.error('请点击添加按钮添加数据')
      try {
        for (const item of this.codePointsTable) {
          const { code, data, message } = await addEquipmentPoint(item)
          console.log(data)
          if (code !== 200) throw new Error(message)
          this.$message.success('添加成功')
        }
      } catch (error) {
      let data = this.codePointsTable.filter(item => {
        return item.instrumentId != null;
      })
      await addEquipmentPoint(data).then(()=>{
        this.$message.success('添加成功')
      }).catch(error=>{
        this.$message.error(error.message)
      }
      })
      await this.closeCodePoins()
    },
    // 取消新增设备码点
@@ -775,42 +762,39 @@
    },
    // 点击新增仪器设备或当存在仪器详情时是修改仪器设备信息
    async addNewEquipment() {
      let v = this.submitForm('addNewEquipment')
      if (!v) {
        return
      }
      if (Array.isArray(this.equipmentform.classifyId)) {
        this.equipmentform.classifyId = this.equipmentform.classifyId.pop()
      }
      if (!this.equipmentDetail.id) {
        // 格式化日期
        this.equipmentform.arrivalDate = parseTime(this.equipmentform.arrivalDate, '{y}-{m}-{d}')
        this.equipmentform.acceptanceDate = parseTime(this.equipmentform.acceptanceDate, '{y}-{m}-{d}')
        // this.equipmentform.termValidity = parseTime(this.equipmentform?.termValidity, '{y}-{m}-{d}')
        try {
          const res = await addInstrument(this.equipmentform)
          console.log(res)
        } catch (error) {
          this.$message.error('添加失败')
      this.$refs["addNewEquipment"].validate(async(valid)=>{
        if(valid){
          if (Array.isArray(this.equipmentform.classifyId)) {
            this.equipmentform.classifyId = this.equipmentform.classifyId.pop()
          }
          if (!this.equipmentDetail.id) {
            // 格式化日期
            this.equipmentform.arrivalDate = parseTime(this.equipmentform.arrivalDate, '{y}-{m}-{d}')
            this.equipmentform.acceptanceDate = parseTime(this.equipmentform.acceptanceDate, '{y}-{m}-{d}')
            // this.equipmentform.termValidity = parseTime(this.equipmentform?.termValidity, '{y}-{m}-{d}')
            await addInstrument(this.equipmentform).then(()=>{
              this.$message.success('添加成功')
            }).catch(error=>{
              this.$message.error(error.message);
            })
            let d = this.nodeclicked;
            this.nodeClickHandler(d);
            this.addDrawerVisible = false
            this.equipmentform = {}
            return
          }
          console.log('修改仪器参数', this.equipmentform)
          await changeInstrument(this.equipmentform).then(()=>{
            this.$message.success('修改成功')
            let d = this.nodeclicked;
            this.nodeClickHandler(d);
            this.addDrawerVisible = false
            this.detailDrawer = false
          }).catch(error=>{
            this.$message.error(error.message);
          })
        }
        this.$message.success('添加成功')
        let d = this.nodeclicked;
        this.nodeClickHandler(d);
        this.addDrawerVisible = false
        this.equipmentform = {}
        return
      }
      console.log('修改仪器参数', this.equipmentform)
      try {
        const res = await changeInstrument(this.equipmentform)
        this.$message.success('修改成功')
        let d = this.nodeclicked;
        this.nodeClickHandler(d);
        this.addDrawerVisible = false
        this.detailDrawer = false
      } catch (error) {
        this.$message.error('添加失败')
      }
      });
    },
    cancelAddEq() {
      this.resetForm('addDrawer')
@@ -907,6 +891,8 @@
    },
    resetBtn() {
      this.searchData.keyword = ''
      this.radioValue = 0;
      this.isOut = false;
      this.equipmentTable = this.oldtableData
    },
    getConditionTable() {
@@ -1080,7 +1066,10 @@
    display: flex;
    justify-content: space-between;
    padding: 15px 24px 12px 24px;
    .serve-btn{
      position: relative;
      left: 92%;
    }
    .search-bar {
      .el-radio-button.is-active {
        color: #409EFF !important;
src/views/standardLibrary/index.vue
@@ -139,6 +139,11 @@
        watch: {
            filterText(val) {
                this.$refs.tree.filter(val);
            },
            addTreeFormVisible(newVal){
                if(newVal === false){
                    this.clear();
                }
            }
        },
        created() {