value
2023-08-30 33e4ee0ff4b02f4d6eef7f0e5260ed9fa745597a
Merge remote-tracking branch 'origin/master'
已修改2个文件
103 ■■■■■ 文件已修改
src/views/laboratory/measure/Add.vue 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/measure/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/measure/Add.vue
@@ -5,26 +5,30 @@
        </el-col>
        <el-col>
            <el-form :model="planAddInfo" style="padding-left: 150px;">
                <el-form-item>
                <el-col>
                    <el-col :span="6" style="display: flex;justify-content: space-around;">
                        <span>负责人:</span>
                        <el-select v-model="planAddInfo.measurePerson" placeholder="请选择负责人">
                            <el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                        <el-form-item label="负责人:" :rules="[{ required: true, message: '请选择负责人', trigger: 'change' }]">
                            <el-select v-model="planAddInfo.measurePerson" placeholder="请选择负责人">
                                <el-option v-for="item in userList" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" style="display: flex;justify-content: space-around;">
                        <span>计划时间:</span>
                        <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期">
                        </el-date-picker>
                        <el-form-item label="计划时间:" :rules="[{ required: true, message: '请选择计划时间', trigger: 'change' }]">
                            <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="至"
                                start-placeholder="开始日期" end-placeholder="结束日期">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5"></el-col>
                    <el-col :span="5" style="display: flex;justify-content: space-around;">
                        <span>计量单位:</span>
                        <el-input style="width: 150px;" v-model="planAddInfo.unit" placeholder=""></el-input>
                        <el-form-item label="计量单位:">
                            <el-input style="width: 150px;" v-model="planAddInfo.unit" placeholder=""></el-input>
                        </el-form-item>
                    </el-col>
                </el-form-item>
                </el-col>
            </el-form>
        </el-col>
        <el-col>
@@ -47,7 +51,8 @@
                <el-table-column prop="equipmentPointName" label="仪器设备" min-width="150">
                    <template slot-scope="scope">
                        <span v-show="!codePointesTableStatus">{{ scope.row.equipmentPointName }}</span>
                        <el-select @change="insListChange(scope.row.equipmentPointName,scope)" v-model="scope.row.equipmentPointName" placeholder="请选择仪器设备">
                        <el-select @change="insListChange(scope.row.equipmentPointName, scope)"
                            v-model="scope.row.equipmentPointName" placeholder="请选择仪器设备">
                            <el-option v-for="item in insList" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
@@ -95,6 +100,7 @@
    getListUserAndListIns, addPlanAndMeasure
} from '@/api/laboratory/measure'
import { dateFormat } from "../../../utils/dateUtil";
import { MessageBox, Message } from 'element-ui'
export default {
    data() {
        return {
@@ -125,7 +131,7 @@
            }],
            userList: [],
            insList: [],
            instrumentList:[],
            instrumentList: [],
            // 码点表格的状态:数据展示false/新增输入true
            codePointesTableStatus: false,
        }
@@ -136,7 +142,7 @@
        res.data.userList.forEach(element => {
            this.userList.push({ label: element.name, value: element.id })
        });
        this.instrumentList=res.data.instrumentList
        this.instrumentList = res.data.instrumentList
        res.data.instrumentList.forEach(item => {
            this.insList.push({ label: item.equipmentName, value: item.id })
        })
@@ -161,21 +167,28 @@
            })
        },
        async add() {
            console.log(111111);
            if (this.planAddInfo.measurePerson == null || this.planAddInfo.measurePerson == ''||this.planAddInfo.planDate[0]==null||this.planAddInfo.planDate[0]=='') {
                Message({
                    message: "负责人和计划日期不能为空!",
                    type: 'warning',
                    duration: 2 * 1000
                })
                return false
            }
            this.planAddInfo.startTime = dateFormat(this.planAddInfo.planDate[0])
            this.planAddInfo.endTime = dateFormat(this.planAddInfo.planDate[1])
            console.log(this.planAddInfo);
            this.planAddInfo.planDate = null
            this.codePointsTable.forEach(item => {
                if(item.endDate!=null&&item.endDate!=''){
                if (item.endDate != null && item.endDate != '') {
                    item.endDate = dateFormat(item.endDate)
                }
            })
            console.log(this.codePointsTable);
            console.log(this.codePointsTable);
            let data = {}
            this.codePointsTable.length>0?data = { measureList: this.codePointsTable, plan: this.planAddInfo }:data = {plan: this.planAddInfo }
            this.codePointsTable.length > 0 ? data = { measureList: this.codePointsTable, plan: this.planAddInfo } : data = { plan: this.planAddInfo }
            let add = await addPlanAndMeasure(data)
            this.planAddInfo={
            this.planAddInfo = {
                plannedOrderNumber: '',
                measurePerson: '',
                planDate: "",
@@ -183,17 +196,17 @@
                createPerson: '',
                createTime: ''
            }
            this.codePointsTable=[]
            this.codePointsTable = []
            return add.data
        },
        insListChange(i,s){
        insListChange(i, s) {
            console.log(i);
            console.log(s.$index);
            let ins= this.instrumentList.filter(item=>{
                return item.id==i
            let ins = this.instrumentList.filter(item => {
                return item.id == i
            })[0]
            this.codePointsTable[s.$index].measuringRange=ins.measuringRange
            this.codePointsTable[s.$index].termValidity=ins.termValidity+'月'
            this.codePointsTable[s.$index].measuringRange = ins.measuringRange
            this.codePointsTable[s.$index].termValidity = ins.termValidity + '月'
        }
    }
}
src/views/laboratory/measure/index.vue
@@ -118,9 +118,12 @@
        </div>
      </div>
      <div>
        <el-button v-if="selectInfoBtn" @click="combackLookPlan" style="position: fixed;top: 43px;right: 14px; z-index: 1000;" type="primary" icon="el-icon-refresh-left" size="mini" plain >返回</el-button>
        <div v-if="addBtn" style="display: flex;justify-content: center;width: 10%;position: fixed;top: 43px;right: 14px; z-index: 1000;">
          <el-button @click="addTop = -82;addBtn=false" size="mini" style="width: 60px;" >返回</el-button>
        <el-button v-if="selectInfoBtn" @click="combackLookPlan"
          style="position: fixed;top: 43px;right: 14px; z-index: 1000;" type="primary" icon="el-icon-refresh-left"
          size="mini" plain>返回</el-button>
        <div v-if="addBtn"
          style="display: flex;justify-content: center;width: 10%;position: fixed;top: 43px;right: 14px; z-index: 1000;">
          <el-button @click="addTop = -82; addBtn = false" size="mini" style="width: 60px;">返回</el-button>
          <el-button size="mini" @click="measureAdd" style="width: 60px;" type="primary">保存</el-button>
        </div>
      </div>
@@ -378,13 +381,19 @@
      this.measureUpInfo.remarks = scope.row.remarks
      this.measureUpInfo.termValidity = scope.row.termValidity
    },
    measureAdd() {
    async measureAdd() {
      let res = await this.$refs.add.add()
      if (!res) {
        return
      }
      this.addTop = -82
        this.$message({
          message: '操作成功!',
          type: 'success'
        });
        this.lookVisible = false
      this.$message({
        message: '操作成功!',
        type: 'success'
      });
      this.lookVisible = false
      this.addBtn = false
      this.limitGetPlanMeasureInstrument()
    },
    async handleSizeChangePlan(num) {
      this.pageSizePlan = num
@@ -399,7 +408,7 @@
      this.addTop = 2
      this.lookVisible = true
      this.$parent.mainShowAdd()
      this.addBtn=true
      this.addBtn = true
    },
    async limitGetPlanMeasureInstrument() {
      let param = {
@@ -418,7 +427,7 @@
      this.getPlanAndInfoAndIns(id)
      this.lookVisible = true
      this.mymodelTop = 2
      this.selectInfoBtn=true
      this.selectInfoBtn = true
      this.$parent.triggerMainBtnPlan()
    },
    async getPlanAndInfoAndIns(id) {
@@ -440,7 +449,7 @@
    combackLookPlan() {
      this.lookVisible = false
      this.mymodelTop = -1000
      this.selectInfoBtn=false
      this.selectInfoBtn = false
    },
    blurSearch() {
      if (this.radioValue === 1) {
@@ -576,5 +585,4 @@
      margin: 10px 0;
    }
  }
}
</style>
}</style>