yuyu
2023-08-31 e28bc4fced1c347a48326dcfbb944fdbd6e4660a
Merge branch 'master' of http://192.168.110.209:9001/r/lims-before
已修改12个文件
797 ■■■■ 文件已修改
src/api/inspection/commisioninspection.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inspection/rawmaterial.js 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/chart/work/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/inspectionApplication/Viewdetails/index.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/inspectionApplication/index.vue 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/commissionInspection/addCommision.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/reportForInspection/index.vue 347 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/gather/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/measure/Add.vue 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/measure/index.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inspection/commisioninspection.js
@@ -88,3 +88,11 @@
        params
  })
}
export function getSpecificationsName(params){
  return request({
    url: '/link-basic-table/getSpecificationsName',
    method: 'get',
        params
  })
}
src/api/inspection/rawmaterial.js
@@ -9,6 +9,7 @@
  })
}
//新增报检单
export function addInspect(data){
  return request({
    url: '/inspection/addInspect',
@@ -17,10 +18,63 @@
  })
}
//根据检验单id查询检验单详情
export function selectInspectsListById(params){
  return request({
    url: '/inspection/selectInspectsListById',
    method: 'get',
    params
  })
}
//查询所有用户
export function selectUser(params){
  return request({
    url: '/inspection/selectUser',
    method: 'get',
    params
  })
}
//查询所有设备
export function selectEquipment(params){
  return request({
    url: '/inspection/selectEquipment',
    method: 'get',
    params
  })
}
//新增原材料报检
export function addMaterial(data){
  return request({
    url: '/raw-material/add',
    method: 'post',
    data
  })
}
//删除原材料报检
export function deleteMaterial(data){
  return request({
    url: '/raw-material/delete',
    method: 'post',
    data
  })
}
export function getMaterielName(data){
  return request({
    url: '/raw-material/getMaterielName',
    method: 'get',
    data
  })
}
export function getSpecification(params){
  return request({
    url: '/raw-material/specification',
    method: 'get',
    params
  })
}
src/router/index.js
@@ -533,9 +533,11 @@
      let menuFather = baseRouter
      const dataMenuFather = fn3(menuFather)
      role.roleMenuList.forEach((r) => {
        dataMenuFather.push(Routees.filter(item => {
          return item.path === r.menuUrl
        })[0])
        if(r.menuName!='首页'){
          dataMenuFather.push(Routees.filter(item => {
            return item.path === r.menuUrl
          })[0])
        }
      })
      let eqChildren = [];
      role.roleMenuList.forEach((r) => {
src/utils/request.js
@@ -1,4 +1,5 @@
import axios from 'axios'
import router from '../router/index'
import { MessageBox, Message } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
@@ -63,8 +64,7 @@
      })
      sessionStorage.removeItem("user")
      sessionStorage.setItem("flushPage",1)
      this.$router.replace({path: '/login'});
      location.reload()
      router.replace({path: '/login'});
      }
      if(res.code===403){
        Message({
src/views/chart/work/index.vue
@@ -6,8 +6,7 @@
                <el-card>
                  <el-form :rules="rules" ref="formInline" :inline="true"
                  :model="formInline" class="demo-form-inline">
                    <el-form-item prop="date">
                      <p><span>*</span>检测日期:</p>
                    <el-form-item prop="date" label="检测日期:">
                      <el-date-picker
                        v-model="formInline.date"
                        format="yyyy-MM-dd"
@@ -18,8 +17,7 @@
                        end-placeholder="结束日期">
                      </el-date-picker>
                    </el-form-item>
                    <el-form-item prop="type">
                      <p><span>*</span>检验类型:</p>
                    <el-form-item prop="type" label="检验类型:">
                      <el-select v-model="formInline.type" placeholder="采购入库">
                        <el-option label="原材料" value="0"></el-option>
                        <el-option label="成品" value="1"></el-option>
@@ -501,24 +499,14 @@
      z-index: 10;
      .demo-form-inline{
        margin: 0px 10px;
        p{
          margin: 0;
          font-size: 16px;
          font-weight: bold;
          span{
            font-size: 16px;
            font-weight: bold;
            color: red;
          }
        }
        .buttons{
          margin: 40px 0px 0px 50%;
          margin-left: 10%;
        }
      }
    }
    .work-center{
      margin: 0px 0px 150px 10px;
      padding: 18vh 0px 5px 0px;
      padding: 13vh 0px 5px 0px;
      .el-card{
        margin: 5px 0px;
        height:500px;
src/views/experiment/inspectionApplication/Viewdetails/index.vue
@@ -185,12 +185,7 @@
        this.ZERENren = res.data
        console.log(this.ZERENren);
      },
      //设备
    //   getDevices() {
    //             get(this.$url.chooseinstum).then(res => {
    //                 this.devices = res.data
    //             })
    //         },
    async chooseinstum(){
        const res =  await chooseinstum()
        this.getDevices = res.data
src/views/experiment/inspectionApplication/index.vue
@@ -50,8 +50,7 @@
                        </div>
                    </div>
                    <div class="table-box">
                        <el-table ref="inspectionTable" style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
                            max-height="calc(100% - 50px)" :cell-style="{textAlign: 'center'}"
                        <el-table ref="inspectionTable" style="width: 100%;overflow-y: auto;max-height: 600px;" :height="600" :cell-style="{textAlign: 'center'}"
                            :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
                            :data="inspectionTable">
                            <el-table-column type="selection" min-width="30px" />
@@ -63,9 +62,9 @@
                                    <div v-if="scope.row.type === 2"><span>成品检验</span></div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="formTime" label="来料日期" min-width="80px" />
                            <el-table-column prop="supplier" label="供应商名称" min-width="150px" />
                            <el-table-column prop="mcode" label="原材料编码" min-width="150px" />
                            <el-table-column prop="formTime" label="来料日期" min-width="90px" />
                            <el-table-column prop="supplier" label="供应商名称" min-width="150px" show-overflow-tooltip/>
                            <el-table-column prop="mcode" label="原材料编码" min-width="170px"/>
                            <el-table-column prop="name" label="原材料名称" min-width="80px" />
                            <el-table-column prop="specifications" label="规格型号" min-width="160px" />
                            <el-table-column prop="unit" label="单位" min-width="50px" />
@@ -78,7 +77,7 @@
                                </template>
                            </el-table-column>
                            <el-table-column prop="userName" label="登记人" min-width="80px" />
                            <el-table-column prop="checkdate" label="检验日期" min-width="150px" />
                            <el-table-column prop="checkdate" label="检验日期" min-width="160px" />
                            <el-table-column label="操作" min-width="150" fixed="right">
                                <template slot-scope="scope">
                                    <el-button type="text" size="small" @click="handleClick(scope.row)">查看</el-button>
@@ -163,7 +162,7 @@
                                    </el-col>
                                    <el-col :span="10">
                                        <el-form-item label="检验时间:">
                                            <el-date-picker v-model="infoForm.endTime" type="daterange" range-separator="至"
                                            <el-date-picker v-model="infoForm.checkdate" type="daterange" range-separator="至"
                                                start-placeholder="开始日期" end-placeholder="结束日期" style="width: 300px;">
                                            </el-date-picker>
                                        </el-form-item>
@@ -314,36 +313,37 @@
                    </template>
                </el-card>
                <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="id" border
                    height="calc(80vh - 250px)" default-expand-all ref="multipleTable"
                    :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
                    <el-table-column type="selection" label="序号"> </el-table-column>
                    <el-table-column type="index" width="50px" label="序号"></el-table-column>
                    <el-table-column label="项目名称" sortable>
                        <template scope="scope">
                            <el-tag>
                                <div class="firstDiv" :style="`color: ${
                              scope.row.code == '[1]' ? '#16a7ff' : '#58c173'
                            }`">
                                    {{ scope.row.code == "[1]" ? "01" : "02" }}
                                </div>
                                <span style="color: black">{{ scope.row.name }}</span>
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column prop="unit" label="单位" sortable></el-table-column>
                    <el-table-column label="标准值" sortable>
                        <template scope="scope">
                            <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)"
                                v-model="scope.row.required" placeholder="请输入标准值"></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column prop="internal" label="内控值" sortable>
                        <template scope="scope">
                            <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)"
                                v-model="scope.row.internal" placeholder="请输入内控值"></el-input>
                        </template>
                    </el-table-column>
                </el-table>
                        height="calc(80vh - 250px)" default-expand-all ref="multipleTable"
                        @select-all="selectAll" @selection-change="handleSelectionChange"
                        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
                        <!-- <el-table-column type="selection" label="序号"> </el-table-column> -->
                        <el-table-column type="index" width="50px" label="序号"></el-table-column>
                        <el-table-column label="项目名称" sortable>
                            <template scope="scope">
                                <el-tag>
                                    <div class="firstDiv" :style="`color: ${
                      scope.row.code == '[1]' ? '#16a7ff' : '#58c173'
                    }`">
                                        {{ scope.row.code == "[1]" ? "01" : "02" }}
                                    </div>
                                    <span style="color: black">{{ scope.row.name }}</span>
                                </el-tag>
                            </template>
                        </el-table-column>
                        <el-table-column prop="unit" label="单位" sortable></el-table-column>
                        <el-table-column label="标准值" sortable>
                            <template scope="scope">
                                <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)"
                                    v-model="scope.row.required" placeholder="请输入标准值"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="internal" label="内控值" sortable>
                            <template scope="scope">
                                <el-input v-if="scope.row.edit === true || scope.row.code === '[2]'" @blur="requiredOnfocus(scope)"
                                    v-model="scope.row.internal" placeholder="请输入内控值"></el-input>
                            </template>
                        </el-table-column>
                    </el-table>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="Standardframe = false">取 消</el-button>
                    <el-button type="primary" @click="GOfrom">确 定</el-button>
@@ -433,7 +433,7 @@
        selectAll,
        addInspect,
        chooseVer,
        lookProByVer
        lookProByVer,
    } from '@/api/experiment/planAssignments'
    export default {
        data() {
@@ -460,7 +460,7 @@
                    amount: '',
                    checkdate: []
                },
                selectedValue: 1,
                selectedValue: {},
                infoForm: {},
                commisionSelection: {
                    entrust_coding: '',
@@ -510,8 +510,10 @@
                tableData: [],
                tableRow: {},
                BANben: [],
                select_1: [],
                aa: {}
                // select_1: [],
                aa: {},
                listdata:[],
                ddd:{}
            }
        },
        watch: {
@@ -529,6 +531,7 @@
            if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
        },
        methods: {
            async selectAll() {
                const res = selectAll({
                    type: 0
@@ -570,6 +573,7 @@
                this.aa = this.BANben[0]
                this.lookProByVer()
            },
            //标准库
            async lookProByVer() {
                const res = await lookProByVer({
@@ -663,6 +667,7 @@
            },
            handleRawMaterialSelection() {
                this.infoForm = this.tmp
                console.log(this.infoForm);
                this.rawmaterialVisible = false
            },
            handleRadioChange() {
@@ -673,13 +678,13 @@
                        selectAll({
                            type: 0
                        }).then(res => {
                            //   var data = res.data
                            // data.forEach((item)=>{
                            //   var checkdate = []
                            //   checkdate.push(item['createTime'])
                            //   checkdate.push(item['updateTime'])
                            //   item['checkdate'] = checkdate // 检验日期
                            // })
                              var data = res.data
                            data.forEach((item)=>{
                              var checkdate = []
                              checkdate.push(item['createTime'])
                              checkdate.push(item['updateTime'])
                              item['checkdate'] = checkdate // 检验日期
                            })
                            this.rawMaterialTable = res.data
                        })
@@ -690,26 +695,35 @@
                        selectAll({
                            type: 2
                        }).then(res => {
                            var data = res.data
                            data.forEach((item)=>{
                              var checkdate = []
                              checkdate.push(item['createTime'])
                              checkdate.push(item['updateTime'])
                              item['checkdate'] = checkdate // 检验日期
                            })
                            this.commisionTable = res.data
                        })
                    }
                }, 100)
            },
            // 新增检验
            async addInspection() {
            async addInspection() {
                if (this.type === 0) {
                    await addInspect({
                    addInspect({
                        endTime: this.infoForm.checkdate[1],
                        formTime: this.infoForm.dateSurvey,
                        mcode: this.infoForm.materialCoding,
                        name: this.infoForm.materialName,
                        num: this.infoForm.quantity,
                        specifications: this.infoForm.specificationsModels,
                        formTime: this.infoForm.formTime,
                        mcode: this.infoForm.mcode,
                        name: this.infoForm.name,
                        num: this.infoForm.num,
                        specifications: this.infoForm.specifications,
                        startTime: this.infoForm.checkdate[0],
                        supplier: this.infoForm.supplierName,
                        supplier: this.infoForm.supplier,
                        type: this.type,
                        unit: this.infoForm.unit
                        unit: this.infoForm.unit,
                        version:this.BANben[1]
                    }).then(res=>{
                    })
                }
                if (this.type === 1) {
@@ -723,7 +737,9 @@
                        startTime: this.commisionSelection.checkdate[0],
                        supplier: this.commisionSelection.supplier,
                        type: this.type,
                        unit: this.commisionSelection.unit
                        unit: this.commisionSelection.unit,
                        version:this.aa
                    })
                }
                if (this.type === 2) {
@@ -737,15 +753,18 @@
                        startTime: '2023-08-14',
                        supplier: this.finishedTable.supplier,
                        type: this.type,
                        unit: this.finishedTable.unit
                        unit: this.finishedTable.unit,
                        version:this.aa
                    })
                }
                this.type = 0
                this.checkTypeVisible = false
                this.$message({
                    message: '添加成功!',
                    type: 'success'
                });
                // this.$message({
                //     message: '添加成功!',
                //     type: 'success'
                // });
                // this.$router.push({name: 'Viewdetails'})
            },
            // 每页条数改变时触发 选择一页显示多少行
            handleSizeChange(val) {
@@ -758,33 +777,45 @@
                this.currentPage = val
                this.selectInspectsList()
            },
            //     //表单校验
            // validateForm(infoForm){
            //     console.log(this.infoForm);
            //     if (infoForm.checkdate == undefined) {
              //           alert('请输入检验时间');
            //         return false;
            //     }
            //     // 校验通过
            //     return true;
            // },
            //确定跳转
            QUEding() {
                // this.tableRow = a
                if (this.infoForm.checkdate[0] == undefined||this.infoForm.checkdate[1] == undefined) {
                    this.$message({
                    message: '请选择检验时间',
                    type: 'warning'
                    });
                    return;
                }
                this.Standardframe = true
                this.skipshow()
                this.chooseVer()
            },
            //新增的数据
            skipshow() {
                const data = this.inspectionTable.at(-1)
                this.listdata = data
            },
            //確定詳情頁
            GOfrom() {
                this.Standardframe = false
                // const data = {
                //   // mcode : this.tmp.mcode,
                //   // name:this.tmp.name,
                //   // specifications:this.tmp.specifications,
                //   version:this.tmp.id
                // }
                this.$router.push({
                    name: 'Viewdetails',
                    query: {
                        id: this.tmp.id
                    }
                })
            },
            async GOfrom() {
                    // this.addInspect()
                    this.addInspection()
                        // this.kk = res.data
                        console.log(this.kk)
                        // this.$router.push({name: 'Viewdetails',query: {id: res.data}})
                        // console.log(res);
            }
        }
    }
</script>
@@ -920,7 +951,6 @@
    .pagination {
        display: flex;
        margin-top: 20px;
        justify-content: end;
    }
src/views/inspectionManagement/commissionInspection/addCommision.vue
@@ -22,7 +22,8 @@
                        <el-table-column type="index" label="序号" min-width="10%" />
                        <el-table-column prop="sampleNumber" label="样品编号" min-width="8%" />
                        <el-table-column prop="sampleName" label="样品名称" min-width="10%" />
                        <el-table-column prop="specificationsModels" label="规格型号" min-width="10%" />
                        <el-table-column prop="speName" label="规格型号" min-width="10%" >
                        </el-table-column>
                        <el-table-column prop="unit" label="单位" min-width="8%" />
                        <el-table-column prop="samplesNumber" label="数量" min-width="8%" />
                        <!-- <el-table-column prop="addway" label="添加方式" min-width="8%">
@@ -228,7 +229,8 @@
        addInspection,
        isIfViewUUID,
        getProductList,
        getContractsSampleInfo
        getContractsSampleInfo,
        getSpecificationsName
    } from '@/api/inspection/commisioninspection'
    export default {
        data() {
@@ -342,7 +344,6 @@
                let res = await getContractsSampleInfo({
                    viewId
                })
                console.log(res.data);
            },
            async getSampleName() {
                const res = await getSampleName()
@@ -384,7 +385,8 @@
                    samplesNumber: '',
                    remarks: '',
                    experiment: [],
                    addway: ''
                    addway: '',
                    speName: ''
                }
            },
            async submitInspection() {
@@ -406,7 +408,8 @@
                    reportNumber: parseInt(this.infoForm.num),
                    sampleDeliveryMode: sampledeliveryway,
                    sampleDeliveryPhone: this.infoForm.sendertel,
                    sampleSender: this.infoForm.sender
                    sampleSender: this.infoForm.sender,
                    speName: this.infoForm.speName
                })
                this.infoForm.commisioncode = res.data
                if (res.data) {
@@ -444,6 +447,11 @@
                        return item.name
                    })
                })
                this.model_sta_options.forEach(a=>{
                    if(a.key == val){
                        this.addPointerForm.speName = a.value
                    }
                })
            },
            getContractsSampleInfo() {
                getContractsSampleInfo({
@@ -467,7 +475,7 @@
                    }
                    this.detectionInfo = res.data.linkDetectionList
                })
            }
            },
        }
    }
</script>
src/views/inspectionManagement/reportForInspection/index.vue
@@ -29,18 +29,32 @@
                </el-form>
            </div>
            <el-dialog title="新增原材料报检" :visible.sync="addReportVisible" width="40%">
                <el-form v-model="insertData" label-position="left" label-width="80px">
                    <el-form-item label="标准类型">
                        <el-input v-model="insertData.materialName" />
                <el-form ref="addMaterialForm" :rules="insertRule" :model="insertData" :inline="true" label-position="right"
                    label-width="80px">
                    <el-form-item label="来料日期:" prop="fromDate">
                        <el-date-picker v-model="insertData.fromDate" type="date" value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="物料名称">
                        <el-input v-model="insertData.materialName" />
                    <el-form-item label="供货商名称:" prop="supplierName">
                        <el-input v-model="insertData.supplierName" />
                    </el-form-item>
                    <el-form-item label="执行标准">
                        <el-input v-model="insertData.standardName" />
                    <el-form-item label="材料名称:" prop="mName">
                        <el-select v-model="insertData.mName" placeholder="请选择材料名称" @change="(val)=>{getSpecification(val)}">
                            <el-option v-for="(item,index) in materialList" :key="index" :label="item.name"
                                :value="item.id"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="规格型号">
                        <el-input v-model="insertData.specificationsName" />
                    <el-form-item label="材料编码:" prop="mCode">
                        <el-input disabled v-model="insertData.mCode" />
                    </el-form-item>
                    <el-form-item label="规格型号:" prop="specificationsNumber">
                        <el-cascader v-model="insertData.specificationsNumber" :options="childrenOptions"
                            :props="{label: 'Name', value: 'Name'}" separator="-"></el-cascader>
                    </el-form-item>
                    <el-form-item label="单位:" prop="unit">
                        <el-input type="text" v-model="insertData.unit" />
                    </el-form-item>
                    <el-form-item label="数量:" prop="num">
                        <el-input type="number" v-model="insertData.num"/>
                    </el-form-item>
                </el-form>
                <span slot="footer" class="dialog-footer">
@@ -60,10 +74,9 @@
                        <el-button @click="addReportBtn" type="primary" size="mini" icon="el-icon-document"
                            style="background-color: rgb(1, 102, 226);">生成报检单</el-button>
                    </div>
                </div>
                <div class="table-box">
                    <el-table ref="inspectionTable" :max-height="800" :cell-style="{textAlign: 'center'}"
                    <el-table ref="inspectionTable" :max-height="600" :cell-style="{textAlign: 'center'}"
                        :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
                        :data="inspectionTable" style="width: 100%" @selection-change="handleSelectionChange">
                        <el-table-column type="selection" :selectable="checkSelect" min-width="5%">
@@ -88,26 +101,44 @@
                        </el-table-column>
                        <el-table-column label="操作" min-width="8%">
                            <template slot-scope="scope">
                                <el-button type="text" size="small" @click="removeFun(scope.row)">删除</el-button>
                                <el-button type="text" size="small" @click="removeFun(scope.row,scope.$index)">删除</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <!-- 分页器 -->
                    <div>
                        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                            :current-page="currentPage" :page-sizes="[5, 10, 15, 20]" :page-size="pageSize"
                            :current-page="currentPage" :page-sizes="[10, 15, 20,30]" :page-size="pageSize"
                            layout="total, sizes, prev, pager, next, jumper" :total="total">
                        </el-pagination>
                    </div>
                </div>
            </div>
        </div>
        <el-dialog title="选择日期" :visible.sync="addReportDialog" width="30%">
            <el-form :model="addInspectionForm" :rules="addInspectionFormRules" rule="addInspectionForm">
                <el-form-item label="检验日期" label-width="100px" prop="inspectionDate">
                    <el-date-picker v-model="addInspectionForm.inspectionDate" type="daterange" value-format="yyyy-MM-dd"
                        range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="版本" label-width="100px" prop="version">
                    <el-select v-model="addInspectionForm.version" placeholder="请选择版本">
                        <el-option v-for="(item,index) in 5" :key="index" :value="item" :label="item"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="resetForm('addInspectionForm')">取 消</el-button>
                <el-button type="primary" @click="confirmBtn('addInspectionForm')">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 生成报检单 -->
        <div class="newPage" v-if="showNewPage">
            <!-- 新增页面 -->
            <div class="inspectionForm">
                <el-form :model="inspectionForm" ref="inspectionForm" label-position="right" label-width="100px" size="mini">
                <el-form :model="inspectionForm" label-position="right" label-width="100px" size="mini">
                    <div class="formwrapper">
                        <el-row>
                            <el-col :span="8">
@@ -182,17 +213,19 @@
                    <el-table-column prop="testValue" label="检验值" width="125"></el-table-column>
                    <el-table-column prop="userName" label="检验人">
                        <template slot-scope="scope">
                            <el-select v-model="scope.row.checker" size="small" slot="append" style="width: 260px;">
                                <el-option v-for="(item,index) in checkeroptions" :key="index" :value="item.value"
                                    :label="item.label">{{ item.label }}</el-option>
                            <el-select @blur="blurOptions(scope.row)" v-model="scope.row.check" size="small" slot="append"
                                style="width: 260px;">
                                <el-option v-for="(item,index) in checkeroptions" :key="index" :value="item.id"
                                    :label="item.name"></el-option>
                            </el-select>
                        </template>
                    </el-table-column>
                    <el-table-column prop="device" label="试验设备">
                        <template slot-scope="scope">
                            <el-select v-model="scope.row.device" size="small" slot="append" style="width: 260px;">
                                <el-option v-for="(item,index) in deviceoptions" :key="index" :value="item.value"
                                    :label="item.label">{{ item.label }}</el-option>
                            <el-select @blur="blurOptions(scope.row)" v-model="scope.row.device" size="small" slot="append"
                                style="width: 260px;">
                                <el-option v-for="(item,index) in deviceoptions" :key="index" :value="item.id"
                                    :label="item.equipmentName"></el-option>
                            </el-select>
                        </template>
                    </el-table-column>
@@ -206,14 +239,32 @@
    import {
        getRawMaterialList,
        addInspect,
        selectInspectsListById
        selectInspectsListById,
        selectUser,
        selectEquipment,
        deleteMaterial,
        addMaterial,
        getMaterielName,
        getSpecification
    } from '@/api/inspection/rawmaterial'
    export default {
        data() {
            return {
                insertData: {
                userName: "",
                devices: "",
                addInspectionForm: {
                    inspectionDate: ['2023-08-01', '2023-08-31'],
                    version: 5
                },
                addInspectionFormRules: {
                    inspectionDate: [{
                        required: true,
                        message: '请选择日期区间',
                        trigger: 'change'
                    }],
                },
                addReportDialog: false,
                insertData: {},
                addReportVisible: false,
                checked: false,
                resultData: {},
@@ -225,15 +276,36 @@
                    state: '',
                    date: ''
                },
                childrenOptions: [{
                    value: 'zhinan',
                    label: '指南',
                    children: [{
                        value: 'shejiyuanze',
                        label: '设计原则',
                        children: [{
                            value: 'yizhi',
                            label: '一致'
                        }, {
                            value: 'fankui',
                            label: '反馈'
                        }, {
                            value: 'xiaolv',
                            label: '效率'
                        }, {
                            value: 'kekong',
                            label: '可控'
                        }]
                    }]
                }],
                options: [{
                    value: 0,
                    value: null,
                    label: '全部'
                }, {
                    value: 1,
                    label: '已检验'
                    label: '已报检'
                }, {
                    value: 2,
                    label: '待检验'
                    value: 0,
                    label: '未报检'
                }],
                deviceoptions: [{
                    value: 0,
@@ -251,15 +323,15 @@
                }],
                radioOptions: [{
                    label: '全部',
                    value: 0
                    value: null
                }, {
                    value: 1,
                    label: '已检验'
                    label: '已报检'
                }, {
                    value: 2,
                    label: '待检验'
                    value: 0,
                    label: '未报检'
                }],
                radioValue: 0,
                radioValue: null,
                inspectionTable: [{
                    createTime: '2023-07-28',
                    supplier_name: '国网山东省电力有限公司',
@@ -274,28 +346,103 @@
                    condition: 1
                }],
                currentPage: 1,
                pageSize: 5,
                pageSize: 10,
                total: 20,
                data: '',
                showNewPage: false,
                inspectionForm: {},
                inspectionItems: []
                inspectionItems: [{
                    index: 1,
                    name: "aaa",
                    unit: "KB",
                    required: "1",
                    internal: "2",
                    testValue: "3",
                    userName: "",
                    device: ""
                }],
                insertRule: {
                    fromDate: [{
                        required: true,
                        message: '请选择来料日期',
                        trigger: 'blur'
                    }],
                    supplierName: [{
                        required: true,
                        message: '请输入供应商名称',
                        trigger: 'blur'
                    }],
                    mName: [{
                        required: true,
                        message: '请选择物料名称',
                        trigger: 'blur'
                    }],
                    mCode: [{
                        required: true,
                        message: '请选择物料',
                        trigger: 'blur'
                    }],
                    specificationsNumber: [{
                        required: true,
                        message: '请选择规格型号',
                        trigger: 'blur'
                    }],
                    unit: [{
                        required: true,
                        message: '请输入单位',
                        trigger: 'blur'
                    }],
                    num: [{
                        required: true,
                        message: '请输入报检数量',
                        trigger: 'blur'
                    }]
                },
                materialList: []
            }
        },
        created() {
            this.getRawMaterialList()
        },
        mounted() {
            this.getMaterielName()
        },
        methods: {
            removeFun(row) {
            handleChange() {
            },
            async deleteMaterialFun(row, index) {
                let formData = new FormData();
                formData.append("deleteId", row.id)
                await deleteMaterial(formData).then(() => {
                    this.inspectionTable.splice(index, 1);
                    this.$message.success("删除成功");
                }).catch(error => {
                    this.$message.error(error.message);
                });
            },
            blurOptions(row) {
                console.log("更新", row);
            },
            async initNewSelection() {
                const res = await selectUser();
                const res2 = await selectEquipment();
                this.checkeroptions = res.data;
                this.deviceoptions = res2.data;
            },
            resetForm(formName) {
                // this.addInspectionForm.inspectionDate = [],
                // this.$refs[formName].resetFields();
                this.addReportDialog = false
            },
            removeFun(row, index) {
                this.$confirm('确认删除该数据吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$message({
                        type: 'success',
                        message: '删除成功!'
                    });
                    console.log(row.id);
                    this.deleteMaterialFun(row, index);
                }).catch(() => {});
            },
            checkSelect(row, index) {
@@ -310,40 +457,46 @@
            },
            //生成报检单按钮
            addReportBtn() {
                let arr = this.checkData;
                if (arr.length < 1) {
                if (this.checkData.length < 1) {
                    this.$message.error("请选择一条数据!");
                } else {
                    if (arr.length > 1) {
                    if (this.checkData.length > 1) {
                        this.$message.error("最多选择一条数据!");
                    } else {
                        //添加报检单
                        let val = arr[0];
                        let obj = {
                            "endTime": val.dateSurvey,
                            "experiment": "",
                            "formTime": val.createTime,
                            "id": val.id,
                            "mcode": val.materialCoding,
                            "name": val.materialName,
                            "num": val.quantity,
                            "specifications": val.specificationsModels,
                            "startTime": val.inspectionDate,
                            "supplier": val.supplierName,
                            "type": val.type,
                            "unit": val.unit,
                            "version": val.version
                        }
                        this.createReport(obj);
                        this.showNewPage = true;
                        this.addReportDialog = true;
                    }
                }
            },
            //生成报检单确认按钮
            confirmBtn(formName) {
                let dateArr = this.addInspectionForm.inspectionDate;
                //添加报检单
                let val = this.checkData[0];
                let obj = {
                    "endTime": dateArr[1],
                    "experiment": "",
                    "formTime": val.createTime,
                    "id": val.id,
                    "mcode": val.materialCoding,
                    "name": val.materialName,
                    "num": val.quantity,
                    "specifications": val.specificationsModels,
                    "startTime": dateArr[0],
                    "supplier": val.supplierName,
                    "type": val.type,
                    "unit": val.unit,
                    "version": val.version
                }
                // this.createReport(obj);
                this.addReportDialog = false;
                this.initNewSelection();
                this.showNewPage = true;
            },
            //生成报价单
            async createReport(param) {
                await addInspect(param);
                let res = await addInspect(param);
                const res2 = await selectInspectsListById({
                    id: 59
                    id: res.data
                });
                this.resultData = res2.data;
                this.inspectionForm = res2.data;
@@ -363,7 +516,7 @@
            async search() {
                this.radioValue = this.searchData.state
                const res = await getRawMaterialList({
                    condition: this.searchData.state,
                    type: this.searchData.state,
                    createTime: this.searchData.date,
                    materialCoding: this.searchData.code,
                    materialName: this.searchData.name,
@@ -384,14 +537,19 @@
                this.getRawMaterialList()
            },
            radioclick() {
                this.searchData.state = this.radioValue
                this.inspectionTable = this.data.filter((item) => {
                    return item.condition === this.radioValue
                })
                console.log(this.inspectionTable);
                if (this.radioValue === 0) {
                    this.inspectionTable = this.data
                }
                this.total = this.inspectionTable.length
            },
            getAllTableData() {
                this.getRawMaterialList()
            },
            getCheckData() {
            },
            getUnCheckData() {
            },
            // 每页条数改变时触发 选择一页显示多少行
            handleSizeChange(val) {
@@ -407,6 +565,53 @@
                this.getRawMaterialList({
                    pageNo: this.currentPage,
                    pageSize: this.pageSize
                })
            },
            insert() {
                this.$refs['addMaterialForm'].validate((valid) => {
                    if (valid) {
                        var str = {
                            "dateSurvey": this.insertData.fromDate,
                            "materialCoding": this.insertData.mCode,
                            "materialName": this.insertData.mName,
                            "quantity": this.insertData.num,
                            "specificationsModels": this.insertData.specificationsNumber[0] + '-' + this.insertData
                                .specificationsNumber[1],
                            "supplierName": this.insertData.supplierName,
                            "type": 0,
                            "unit": this.insertData.unit
                        }
                        this.materialList.forEach(a => {
                            if (a.id == str.materialName) {
                                str.materialName = a.name
                            }
                        })
                        addMaterial(str).then(res => {
                            this.$message.success('添加成功')
                            this.addReportVisible = false
                            this.getRawMaterialList()
                        })
                    } else {
                        return false;
                    }
                });
            },
            getMaterielName() {
                getMaterielName().then(res => {
                    this.materialList = res.data
                })
            },
            getSpecification(val) {
                this.materialList.forEach(a => {
                    if (a.id == val) {
                        this.insertData.mCode = a.code
                    }
                })
                getSpecification({
                    materialId: val
                }).then(res => {
                    this.childrenOptions = JSON.parse(JSON.stringify(res.data).replaceAll('specifications', '').replaceAll(
                        'model', ''))
                })
            }
        }
@@ -510,4 +715,4 @@
            }
        }
    }
</style>
</style>
src/views/laboratory/gather/index.vue
@@ -17,7 +17,7 @@
      </el-form>
    </div>
    <div class="library-table">
      <el-card v-for="item in device" :key="index" class="box-card" style="width: 22.8%;">
      <el-card v-for="(item,index) in device" :key="index" class="box-card" style="width: 22.8%;">
        <div class="header">
          <div style="display: flex;justify-content: start; width: 100%;">
            <div class="el-icon-set-up" style="font-size: 25px;color: rgb(103, 194, 58);line-height: 55px ;"></div>
@@ -76,6 +76,14 @@
      ]
    }
  },
    methods:{
        searchInspections(){
        },
        reset(){
        }
    }
}
</script>
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
@@ -7,6 +7,9 @@
            <el-input v-model="searchData.code" @blur="blurSearch()" class="input-form" placeholder="请输入">
            </el-input>
          </el-form-item>
          <el-form-item v-if="this.radioValue === 1">
            <el-button type="primary" @click="searchPlan">查询</el-button>
          </el-form-item>
          <el-form-item v-if="this.radioValue === 0" :label="this.radioValue === 0 ? '仪器设备名称:' : '设备名称'"
            class="sermargin">
            <el-input v-model="searchData.name" class="input-form" placeholder="请输入">
@@ -70,10 +73,10 @@
            <el-table-column prop="name" label="负责人" min-width="10%" />
            <el-table-column prop="createTime" label="创建日期" min-width="10%" />
            <el-table-column prop="name" label="创建人" min-width="8%" />
            <el-table-column prop="code" label="计量编号" min-width="8%" />
            <el-table-column prop="code" label="计量编号" min-width="12%" />
            <el-table-column label="操作" min-width="15%">
              <template slot-scope="scope">
                <el-button type="text" @click="lookMeasurement(scope.row.equipmentCode)" size="small">查看计量履历</el-button>
                <!-- <el-button type="text" @click="lookMeasurement(scope.row.equipmentCode)" size="small">查看计量履历</el-button> -->
                <el-button type="text" size="small">查看附件</el-button>
              </template>
            </el-table-column>
@@ -109,7 +112,7 @@
            </el-table-column>
          </el-table>
          <!-- 分页器 -->
          <div style="display: flex;justify-content: end;">
          <div style="display: flex;justify-content: end;padding: 10px 0;">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="currentPage" :page-sizes="[5, 10, 20]" :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper" :total="total">
@@ -118,9 +121,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 +384,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 +411,7 @@
      this.addTop = 2
      this.lookVisible = true
      this.$parent.mainShowAdd()
      this.addBtn=true
      this.addBtn = true
    },
    async limitGetPlanMeasureInstrument() {
      let param = {
@@ -418,7 +430,7 @@
      this.getPlanAndInfoAndIns(id)
      this.lookVisible = true
      this.mymodelTop = 2
      this.selectInfoBtn=true
      this.selectInfoBtn = true
      this.$parent.triggerMainBtnPlan()
    },
    async getPlanAndInfoAndIns(id) {
@@ -440,7 +452,7 @@
    combackLookPlan() {
      this.lookVisible = false
      this.mymodelTop = -1000
      this.selectInfoBtn=false
      this.selectInfoBtn = false
    },
    blurSearch() {
      if (this.radioValue === 1) {
@@ -495,6 +507,9 @@
    search() {
      this.getStandingPageList()
    },
    searchPlan(){
      this.getPlanPageList()
    },
    reset(formName) {
      this.searchData.name = ''
      this.searchData.code = ''
@@ -506,8 +521,9 @@
    },
    async getPlanPageList() {
      let param = {
        currentPage: this.currentPage, pageSize: this.pageSize,
        code: this.searchData.code, name: this.searchData.name, unit: this.searchData.measureunit
        currentPage: this.currentPage,
        pageSize: this.pageSize,
        plannedOrderNumber: this.searchData.code
      }
      const res = await getPlanPageList(param)
      res.data.list.forEach(item => {