yuyu
2023-08-15 4a8efc53405efe0d20312694d39fbd8184badb39
8.15提交
已修改8个文件
已添加1个文件
1185 ■■■■ 文件已修改
.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.staging 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/experiment/planAssignments.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/laboratory/measure.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/inspectionApplication/index.vue 812 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inspectionManagement/commissionInspection/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/laboratory/measure/index.vue 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://192.168.110.167:1234/'
VUE_APP_BASE_API = 'http://192.168.110.87:1234/'
.env.production
@@ -3,5 +3,5 @@
# base api
# VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'http://192.168.110.167:1234/'
VUE_APP_BASE_API = 'http://192.168.110.87:1234/'
.env.staging
@@ -5,6 +5,6 @@
# base api
# VUE_APP_BASE_API = '/stage-api'
VUE_APP_BASE_API = 'http://192.168.110.167:1234/'
VUE_APP_BASE_API = 'http://192.168.110.87:1234/'
src/api/experiment/planAssignments.js
@@ -6,4 +6,28 @@
    method: 'get',
    params
  })
}
// æŸ¥è¯¢æ£€éªŒç”³è¯·å•列表
export function selectInspectsList(params){
  return request({
    url: '/inspection/selectInspectsList',
    method: 'get',
    params
  })
}
// æŸ¥è¯¢æ‰€æœ‰æŠ¥æ£€
export function selectAll(params){
  return request({
    url: '/inspection/selectAll',
    method: 'get',
    params
  })
}
// æ–°å¢žæ£€éªŒå•
export function addInspect(data){
  return request({
    url:'/inspection/addInspect',
    method: 'post',
    data
  })
}
src/api/laboratory/measure.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
import request from '@/utils/request'
// è®¡é‡è®¡åˆ’分页查询
export function getPlanPageList(params) {
  return request({
    url: '/metering-plan/plan_page_list',
    method: 'get',
    params
  })
}
// è®¡é‡å°è´¦åˆ†é¡µæŸ¥è¯¢
export function getStandingPageList(params) {
  return request({
    url: '/metering-plan/standing_page_list',
    method: 'get',
    params
  })
}
src/utils/request.js
@@ -14,12 +14,11 @@
service.interceptors.request.use(
  config => {
    // do something before request is sent
    if (store.getters.token) {
      // let each request carry token
      // ['X-Token'] is a custom headers key
      // please modify it according to the actual situation
      config.headers['X-Token'] = getToken()
      config.headers['token'] = getToken()
    }
    config.headers['link'] = store.state.settings.link
    // console.log('config' ,config)
src/views/experiment/inspectionApplication/index.vue
@@ -17,17 +17,17 @@
              <el-form-item label="检验类型:">
                <el-select v-model="searchData.type" placeholder="全部" style="width: 100px;margin-right: 20px;">
                  <el-option
                    v-for="item in options"
                    v-for="item in typeoptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="检验状态:" style="margin-right: 20px;">
              <el-form-item label="检验结果:" style="margin-right: 20px;">
                <el-select v-model="searchData.state" placeholder="全部" style="width: 100px;margin-right: 20px;">
                  <el-option
                    v-for="item in options"
                    v-for="item in stateoptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
@@ -35,8 +35,8 @@
                </el-select>
              </el-form-item>
              <el-form-item>
                <el-button type="primary">查询</el-button>
                <el-button type="primary" plain>重置</el-button>
                <el-button type="primary" @click="searchInspections">查询</el-button>
                <el-button type="primary" plain @click="reset">重置</el-button>
              </el-form-item>
            </el-form>
            <el-form class="rightBtn">
@@ -73,51 +73,42 @@
                  min-width="30px"
                />
                <el-table-column
                  prop="applicationnum"
                  prop="icode"
                  label="申请单号"
                  min-width="100px"
                />
                <el-table-column
                  prop="checktype"
                  prop="type"
                  label="检验类型"
                  min-width="80px"
                />
                <el-table-column
                  prop="checkstate"
                  label="检验状态"
                  min-width="70px">
                  min-width="80px">
                  <template slot-scope="scope">
                    <div v-if="scope.row.checkstate === '1'">
                        <span style="color: green;">已检测</span>
                    </div>
                    <div v-else>
                        <span style="color: red;">未检测</span>
                    </div>
                    <div v-if="scope.row.type === 0" ><span>原材料检验</span></div>
                    <div v-if="scope.row.type === 1" ><span>委托检验</span></div>
                    <div v-if="scope.row.type === 2" ><span>成品检验</span></div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="deliverydate"
                  prop="formTime"
                  label="来料日期"
                  min-width="100px"
                />
                <el-table-column
                  prop="provider"
                  prop="supplier"
                  label="供应商名称"
                  min-width="150px"
                />
                <el-table-column
                  prop="rawcode"
                  prop="mcode"
                  label="原材料编码"
                  min-width="120px"
                  min-width="150px"
                />
                <el-table-column
                  prop="rawname"
                  prop="name"
                  label="原材料名称"
                  min-width="80px"
                />
                <el-table-column
                  prop="modelandspecification"
                  prop="specifications"
                  label="规格型号"
                  min-width="160px"
                />
@@ -127,49 +118,34 @@
                  min-width="50px"
                />
                <el-table-column
                  prop="amount"
                  prop="num"
                  label="数量"
                  min-width="50px"
                />
                <el-table-column
                  prop="registrationdate"
                  prop="createTime"
                  label="登记日期"
                  min-width="80px"
                />
                <el-table-column
                  prop="registrator"
                  prop="userName"
                  label="登记人"
                  min-width="80px"
                />
                <el-table-column
                  prop="qualified"
                  label="检验状态"
                  prop="inspection_status"
                  label="检验结果"
                  min-width="80px">
                  <template slot-scope="scope">
                    <div v-if="scope.row.qualified === null">
                        <span></span>
                    </div>
                    <div v-else>
                    <el-tag :type="scope.row.qualified === '0' ? 'success' : 'danger'"
                    <el-tag class="tag" :type="scope.row.inspection_status === 0 ? 'danger' : 'success'"
                    disable-transitions
                  >{{ scope.row.qualified === '0' ? '合格' : '不合格' }}</el-tag>
                    </div>
                  >{{ scope.row.inspection_status === 0 ? '不合格' : '合格' }}</el-tag>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="applier"
                  label="申请人"
                  min-width="80px"
                />
                <el-table-column
                  prop="checker"
                  label="检验人"
                  min-width="80px"
                />
                <el-table-column
                  prop="checktime"
                  prop="checkdate"
                  label="检验日期"
                  min-width="80px"
                  min-width="150px"
                />
                <el-table-column
                  label="操作"
@@ -188,7 +164,7 @@
                <el-pagination
                  class="pagination"
                  :current-page="currentPage"
                  :page-sizes="[100, 200, 300, 400]"
                  :page-sizes="[5, 10, 20, 30]"
                  :page-size="pageSize"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="total"
@@ -205,76 +181,355 @@
              width="50%"
            >
              <div class="check-box">
                <el-radio-group v-model="type">
                <el-radio-group v-model="type" @change="handleRadioChange">
                  <el-radio :label="0" border>原材料检验</el-radio>
                  <el-radio :label="1" border>半成品检验</el-radio>
                  <el-radio :label="1" border>委托检验</el-radio>
                  <el-radio :label="2" border>成品检验</el-radio>
                </el-radio-group>
              </div>
              <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="top" label-width="200px" size="mini">
                <el-row :gutter="100">
                    <el-col :span="10">
                        <el-form-item label="来料日期:">
                            <el-input style="width: 300px" type="text" :value="infoForm.deliverydate" placeholder="请输入来料日期" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="供应商名称:">
                            <el-input style="width: 300px" type="text" :value="infoForm.name" placeholder="请输入供应商名称" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    </el-row>
                    <el-row :gutter="100">
                    <el-col :span="10">
                        <el-form-item label="原材料编码:">
                            <el-input style="width: 300px" type="text" :value="infoForm.code" placeholder="请输入原材料编码" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="原材料名称:">
                            <el-input style="width: 300px" type="text" :value="infoForm.name" placeholder="请输入原材料名称" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    </el-row>
                    <el-row :gutter="100">
                    <el-col :span="10">
                        <el-form-item label="规格型号:">
                            <el-input style="width: 300px" type="text" :value="infoForm.modelandspecification" placeholder="请输入规格型号" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="单位:">
                            <el-input style="width: 300px" type="text" :value="infoForm.unit" placeholder="请输入单位" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    </el-row>
                    <el-row :gutter="100">
                    <el-col :span="10">
                        <el-form-item label="数量:">
                            <el-input style="width: 300px" type="text" :value="infoForm.amount" placeholder="请输入数量" autocomplete="off" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="检验时间:">
              <div v-if="type === 0 || type === ''">
                <el-form :model="infoForm" ref="infoForm" class="checkTypeForm" label-position="top" label-width="200px" size="mini">
                  <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="来料日期:">
                              <el-input style="width: 300px" type="text" :value="infoForm.dateSurvey" placeholder="请输入来料日期" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="供应商名称:">
                              <el-input style="width: 300px" type="text" :value="infoForm.supplierName" placeholder="请输入供应商名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="原材料编码:">
                              <el-input style="width: 300px" type="text" :value="infoForm.materialCoding" placeholder="请输入原材料编码" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="原材料名称:">
                              <el-input style="width: 300px" type="text" :value="infoForm.materialName" placeholder="请输入原材料名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="规格型号:">
                              <el-input style="width: 300px" type="text" :value="infoForm.specificationsModels" placeholder="请输入规格型号" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="单位:">
                              <el-input style="width: 300px" type="text" :value="infoForm.unit" placeholder="请输入单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="数量:">
                              <el-input style="width: 300px" type="text" :value="infoForm.quantity" placeholder="请输入数量" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="检验时间:">
                              <el-date-picker
                                  v-model="infoForm.checkdate"
                                  type="daterange"
                                  range-separator="至"
                                  start-placeholder="开始日期"
                                  end-placeholder="结束日期"
                                  style="width: 300px;">
                              </el-date-picker>
                          </el-form-item>
                      </el-col>
                      </el-row>
                </el-form>
              </div>
              <div v-if="type === 1">
                <el-form :model="commisionSelection" ref="commisionTable" class="checkTypeForm" label-position="top" label-width="200px" size="mini">
                  <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="来料日期:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.formTime" placeholder="请输入来料日期" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="供应商名称:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.supplier" placeholder="请输入委托单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="委托编号:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.mcode" placeholder="请输入样品编号" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="委托名称:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.name" placeholder="请输入样品名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="规格型号:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.specifications" placeholder="请输入型号规格" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="单位:">
                            <el-input style="width: 300px" type="text" :value="commisionSelection.unit" placeholder="请输入单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="数量:">
                            <el-input style="width: 300px" type="text" :value="commisionSelection.num" placeholder="请输入数量" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="检验日期:">
                            <el-date-picker
                                v-model="infoForm.checkdate"
                                type="daterange"
                                range-separator="至"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期"
                                style="width: 300px;">
                                  v-model="commisionSelection.checkdate"
                                  type="daterange"
                                  range-separator="至"
                                  start-placeholder="开始日期"
                                  end-placeholder="结束日期"
                                  style="width: 300px;">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    </el-row>
              </el-form>
                          </el-form-item>
                      </el-col>
                      </el-row>
                </el-form>
              </div>
              <div v-if="type === 2">
                <el-form :model="finishedTable" ref="finishedTable" class="checkTypeForm" label-position="top" label-width="200px" size="mini">
                  <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="来料日期:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.deliverydate" placeholder="请输入来料日期" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="供应商名称:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.supplier" placeholder="请输入供应商名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="原材料编码:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.code" placeholder="请输入原材料编码" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="原材料名称:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.name" placeholder="请输入原材料名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="规格型号:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.modelandspecification" placeholder="请输入规格型号" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="单位:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.unit" placeholder="请输入单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="数量:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.amount" placeholder="请输入数量" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="检验时间:">
                              <el-date-picker
                                  v-model="finishedTable.checkdate"
                                  type="daterange"
                                  range-separator="至"
                                  start-placeholder="开始日期"
                                  end-placeholder="结束日期"
                                  style="width: 300px;">
                              </el-date-picker>
                          </el-form-item>
                      </el-col>
                      </el-row>
                </el-form>
              </div>
              <span slot="footer" class="dialog-footer">
                <el-button @click="checkTypeVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="goToForInspectionDetail">ç¡® å®š</el-button>
                <el-button type="primary" @click="addInspection">ç¡® å®š</el-button>
              </span>
            </el-dialog>
          </div>
        </div>
        <!-- åŽŸææ–™æ£€éªŒæ¨¡æ€æ¡† -->
        <el-dialog
        title="原材料检验"
        :visible.sync="rawmaterialVisible"
        width="60%">
          <div class="table-box">
            <el-table
              ref="multipleTable"
              :max-height="800"
              :cell-style="{textAlign: 'center'}"
              :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
              :data="rawMaterialTable"
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                label=""
                min-width="10%"
              />
              <el-table-column
                type="index"
                label="序号"
                min-width="8%"
              />
              <el-table-column
                prop="dateSurvey"
                label="来料日期"
                min-width="8%"
              />
              <el-table-column
                prop="supplierName"
                label="供应商名称"
                min-width="12%"
              />
              <el-table-column
                prop="materialCoding"
                label="材料编码"
                min-width="8%"
              />
              <el-table-column
                prop="materialName"
                label="材料名称"
                min-width="8%"
              />
              <el-table-column
                prop="specificationsModels"
                label="规格型号"
                min-width="12%"
              />
              <el-table-column
                prop="unit"
                label="单位"
                min-width="5%"
              />
              <el-table-column
                prop="quantity"
                label="数量"
                min-width="5%"
              />
              <el-table-column
                prop="inspectionDate"
                label="报检日期"
                min-width="8%"
              />
              <el-table-column
                prop="surveyor"
                label="检验人"
                min-width="8%"
              />
              <el-table-column
                prop="createTime"
                label="检验日期"
                min-width="8%"
              />
              <el-table-column
                prop="state"
                label="状态"
                min-width="8%"
              >
              <template slot-scope="scope">
                <span :style="{ color: scope.row.state === 1 ? 'green' : 'red' }">
                  {{ scope.row.state===1 ? '已检测':'待检测' }}
                </span>
              </template>
              </el-table-column>
            </el-table>
            <span slot="footer" class="dialog-footer">
                <el-button @click="rawmaterialVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="handleRawMaterialSelection">ç¡® å®š</el-button>
            </span>
          </div>
        </el-dialog>
        <!-- å§”托检验模态框 -->
        <el-dialog
        title="委托检验"
        :visible.sync="commisionVisible"
        width="60%">
          <div class="table-box">
            <el-table
                ref="multipleTable"
                :max-height="800"
                :cell-style="{textAlign: 'center'}"
                :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
                :data="commisionTable"
                @selection-change="handleSelectionChange"
                style="width: 100%"
              >
                <el-table-column
                  type="selection"
                  min-width="10%"
                />
                <el-table-column
                  type="index"
                  label="序号"
                  min-width="10%"
                />
                <el-table-column
                  prop="formTime"
                  label="来料日期"
                  min-width="10%"
                />
                <el-table-column
                  prop="supplier"
                  label="供应商名称"
                  min-width="12%"
                />
                <el-table-column
                  prop="mcode"
                  label="材料编码"
                  min-width="8%"
                />
                <el-table-column
                  prop="specifications"
                  label="规格型号"
                  min-width="8%"
                />
                <el-table-column
                  prop="unit"
                  label="单位"
                  min-width="12%"
                />
                <el-table-column
                  prop="num"
                  label="数量"
                  min-width="8%"
                />
                <el-table-column
                  prop="checkdate_"
                  label="检验日期"
                  min-width="8%"
                />
              </el-table>
            <span slot="footer" class="dialog-footer">
                <el-button @click="commisionVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="handleCommisionSelection">ç¡® å®š</el-button>
              </span>
          </div>
        </el-dialog>
      </template>
      <template v-else>
        <router-view />
@@ -283,7 +538,7 @@
  </template>
  
  <script>
  import { getInspectionList } from '@/api/rawMaterials/reportForInspection'
  import { selectInspectsList, selectAll, addInspect} from '@/api/experiment/planAssignments'
  export default {
    data() {
      return {
@@ -293,85 +548,72 @@
          type: '',
          state: ''
        },
        inspectionTable: [{
            applicationnum: 'QC22-09155',
            checktype: '原材料检验',
            checkstate: '1',
            deliverydate: '2023-07-31',
            provider: '国网山东省电力有限公司',
            rawcode: '1010010090124',
            rawname: '铝包钢绞线',
            modelandspecification: 'JLHA1/G1A-185/30-27/7',
            unit: 'ml/kg',
            amount: '1999',
            registrationdate: '2022-09-23',
            registrator: '李小龙',
            qualified: '0',
            applier: '李小龙',
            checker: '李小龙',
            checktime: '2023-12-09'
        inspectionTable: [],
        rawMaterialTable: [],
        commisionTable: [{
          specifications_models: "GGXH-AAAAA",
          inspectionTime: "2023-08-03",
          id: 2,
          samples_number: 0,
          dateSurvey: "2023-08-03",
          entrusted: "阿里巴巴",
          completionDeadline: "2023-08-03",
          contacts: "小黑",
          entrust_coding: "SL20230803000003",
          sample_name: "发动机",
          inspection_status: 1
        },{
            applicationnum: 'QC22-09155',
            checktype: '原材料检验',
            checkstate: '1',
            deliverydate: '2023-07-31',
            provider: '国网山东省电力有限公司',
            rawcode: '1010010090124',
            rawname: '铝包钢绞线',
            modelandspecification: 'JLHA1/G1A-185/30-27/7',
            unit: 'ml/kg',
            amount: '1999',
            registrationdate: '2022-09-23',
            registrator: '李小龙',
            qualified: '0',
            applier: '李小龙',
            checker: '李小龙',
            checktime: '2023-12-09'
        },{
            applicationnum: 'QC22-09155',
            checktype: '原材料检验',
            checkstate: '0',
            deliverydate: '2023-07-31',
            provider: '国网山东省电力有限公司',
            rawcode: '1010010090124',
            rawname: '铝包钢绞线',
            modelandspecification: 'JLHA1/G1A-185/30-27/7',
            unit: 'ml/kg',
            amount: '1999',
            registrationdate: '2022-09-23',
            registrator: '李小龙',
            qualified: null,
            applier: '李小龙',
            checker: '李小龙',
            checktime: '2023-12-09'
        },{
            applicationnum: 'QC22-09155',
            checktype: '原材料检验',
            checkstate: '1',
            deliverydate: '2023-07-31',
            provider: '国网山东省电力有限公司',
            rawcode: '1010010090124',
            rawname: '铝包钢绞线',
            modelandspecification: 'JLHA1/G1A-185/30-27/7',
            unit: 'ml/kg',
            amount: '1999',
            registrationdate: '2022-09-23',
            registrator: '李小龙',
            qualified: '1',
            applier: '李小龙',
            checker: '李小龙',
            checktime: '2023-12-09'
          specifications_models: "GGXH-AAAAA",
          inspectionTime: "2023-08-03",
          id: 2,
          samples_number: 0,
          dateSurvey: "2023-08-03",
          entrusted: "阿里巴巴",
          completionDeadline: "2023-08-03",
          contacts: "小黑",
          entrust_coding: "SL20230803000003",
          sample_name: "发动机",
          inspection_status: 1
        }],
        infoForm:{
        finishedTable: {
          deliverydate: '',
          provider: '',
          supplier: '',
          code: '',
          name: '',
          modelandspecification: '',
          unit: '',
          amount: '',
          checkdate: ''
          checkdate: []
        },
        infoForm:'',
        commisionSelection:{
          entrust_coding: '',
          entrusted: '',
          samples_number: '',
          sample_name: '',
          specifications_models: '',
          dateSurvey: '',
          completionDeadline: '',
          contacts: '',
          inspectionTime: ''
        },
        typeoptions:[{
          value: 0,
          label:'原材料检验'
        },{
          value: 1,
          label: '委托检验'
        },{
          value: 2,
          label: '成品检验'
        }],
        stateoptions:[{
          value: 0,
          label:'不合格'
        },{
          value: 1,
          label:'合格'
        }],
        options:[{
          value: '0',
          label: '选项1'
@@ -381,10 +623,13 @@
        }],
        currentPage: 1,
        total: 20, // æ€»æ¡æ•°
        pageSize: 10, // æ¯é¡µçš„æ•°æ®æ¡æ•°
        pageSize: 5, // æ¯é¡µçš„æ•°æ®æ¡æ•°
        radioValue: '全部',
        checkTypeVisible: false,
        type: 0
        type: '', // é»˜è®¤ä¸é€‰ä¸­çš„状态
        rawmaterialVisible: false,
        commisionVisible: false,
        tmp: ''
      }
    },
    watch: {
@@ -397,54 +642,178 @@
        deep: true
      }
    },
    // beforeRouteEnter(to, from, next) {
    //   console.log(to, from)
    //   next()
    //   // åœ¨æ¸²æŸ“该组件的对应路由被 confirm å‰è°ƒç”¨
    //   // ä¸ï¼èƒ½ï¼èŽ·å–ç»„ä»¶å®žä¾‹ `this`
    //   // å› ä¸ºå½“钩子执行前,组件实例还没被创建
    // },
    // beforeRouteUpdate(to, from, next) {
    //   console.log(to, from)
    //   if (to.name === 'ForInspectionDetail') this.showDetail = true
    //   this.$nextTick(() => {
    //     console.log(1)
    //     this.showDetail = true
    //   })
    //   next()
    //   // åœ¨å½“前路由改变,但是该组件被复用时调用
    //   // ä¸¾ä¾‹æ¥è¯´ï¼Œå¯¹äºŽä¸€ä¸ªå¸¦æœ‰åŠ¨æ€å‚æ•°çš„è·¯å¾„ /foo/:id,在 /foo/1 å’Œ /foo/2 ä¹‹é—´è·³è½¬çš„æ—¶å€™ï¼Œ
    //   // ç”±äºŽä¼šæ¸²æŸ“同样的 Foo ç»„件,因此组件实例会被复用。而这个钩子就会在这个情况下被调用。
    //   // å¯ä»¥è®¿é—®ç»„件实例 `this`
    // },
    created() {
      this.getInspectionTableData()
      this.selectInspectsList()
    },
    updated() {
      if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
    },
    methods: {
      async getInspectionTableData() {
        const res = await getInspectionList({ pageSize: this.currentPage, countSize: this.pageSize })
      async selectInspectsList() {
        // èŽ·å–åˆ†é¡µåˆ—è¡¨
        const res = await selectInspectsList({ countSize: this.pageSize, pageSize: this.currentPage })
        // this.inspectionTable = data
        console.log(res)
        // console.log(res.data.row)
        const data = res.data.row
        data.forEach((item) => {
          var formTime = item["DATE_FORMAT(`form_time`,'%Y-%m-%d')"]
          var startTime = item["DATE_FORMAT(i"]["`start_time`,'%Y-%m-%d')"]
          var endTime = item["DATE_FORMAT(i"]["`end_time`,'%Y-%m-%d')"]
          var checkdate = startTime + '~' + endTime
          var createTime = item["DATE_FORMAT(i"]["`create_time`,'%Y-%m-%d')"]
          item['formTime'] = formTime // æ¥æ–™æ—¥æœŸ
          item['checkdate'] = checkdate // æ£€éªŒæ—¥æœŸ
          item['createTime'] = createTime // ç™»è®°æ—¥æœŸ
      })
        this.inspectionTable = data
        this.total = res.data.total
      },
      goToForInspectionDetail() {
        this.$router.push('/rawMaterials/reportForInspection/forInspectionDetail')
      },
      handleClick(row) {
        console.log(row)
      },
      async searchInspections(){
        const res = await selectInspectsList({countSize:this.pageSize,pageSize:this.currentPage,message:this.searchData.applicationnumber})
        var data = res.data.row
        data.forEach((item) => {
          var formTime = item["DATE_FORMAT(`form_time`,'%Y-%m-%d')"]
          var startTime = item["DATE_FORMAT(i"]["`start_time`,'%Y-%m-%d')"]
          var endTime = item["DATE_FORMAT(i"]["`end_time`,'%Y-%m-%d')"]
          var checkdate = startTime + '~' + endTime
          var createTime = item["DATE_FORMAT(i"]["`create_time`,'%Y-%m-%d')"]
          item['formTime'] = formTime // æ¥æ–™æ—¥æœŸ
          item['checkdate'] = checkdate // æ£€éªŒæ—¥æœŸ
          item['createTime'] = createTime // ç™»è®°æ—¥æœŸ
      })
      console.log('data:',data)
      this.inspectionTable = data
      if(this.searchData.type !== ''){
        if(this.searchData.state !== ''){
          this.inspectionTable = data.filter((item)=>{
            return item.type===this.searchData.type && item.inspection_status === this.searchData.state
          })
        }else{
          this.inspectionTable = data.filter((item)=>{
            return item.type===this.searchData.type
          })
        }
      }else{
        if(this.searchData.state !== ''){
          this.inspectionTable = data.filter((item)=>{
            return item.inspection_status===this.searchData.state
          })
        }
      }
      this.total = this.inspectionTable.length
    },
    reset(){
      this.searchData = {
          applicationnumber: '',
          type: '',
          state: ''
      }
      this.selectInspectsList()
    },
    //被选中的信息 å•选
    handleSelectionChange(val) {
      if (val.length > 1) {
        this.$refs.multipleTable.clearSelection();
        this.$refs.multipleTable.toggleRowSelection(val.pop())
      }
      this.tmp = val[0]
    },
    handleCommisionSelection(){
      this.commisionSelection = this.tmp
      this.commisionVisible = false
    },
    handleRawMaterialSelection(){
      this.infoForm = this.tmp
      this.rawmaterialVisible = false
    },
    async handleRadioChange(){
      console.log(this.type)
      if(this.type === 0){
        // åŽŸææ–™æŠ¥æ£€
        this.rawmaterialVisible = true
        const res = await selectAll({type: this.type})
        var data = res.data
        data.forEach((item)=>{
          var checkdate = []
          checkdate.push(item['createTime'])
          checkdate.push(item['updateTime'])
          item['checkdate'] = checkdate // æ£€éªŒæ—¥æœŸ
        })
        this.rawMaterialTable = data
      }else if(this.type === 1){
        this.commisionVisible = true
        const res = await selectAll({type: this.type})
        var data = res.data
        data.forEach((item)=>{
          var checkdate = []
          checkdate.push(item['startTime'])
          checkdate.push(item['endTime'])
          item['checkdate_'] = item['startTime'] + '~' + item['endTime']
          item['checkdate'] = checkdate // æ£€éªŒæ—¥æœŸ
        })
        this.commisionTable = res.data
      }
    },
    // æ–°å¢žæ£€éªŒ
    async addInspection(){
      if(this.type === 0){
        await 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,
          startTime: this.infoForm.checkdate[0] ,
          supplier: this.infoForm.supplierName,
          type: this.type,
          unit: this.infoForm.unit})
      }
      if(this.type === 1){
        console.log(this.commisionSelection)
        const res = await addInspect({endTime: this.commisionSelection.checkdate[1],
          formTime: this.commisionSelection.formTime,
          mcode: this.commisionSelection.mcode,
          name: this.commisionSelection.name,
          num: this.commisionSelection.num,
          specifications: this.commisionSelection.specifications,
          startTime: this.commisionSelection.checkdate[0] ,
          supplier: this.commisionSelection.supplier,
          type: this.type,
          unit: this.commisionSelection.unit})
          console.log('res',res)
      }
      if(this.type === 2){
        console.log(this.finishedTable)
        const res = await addInspect({ endTime: '2023-08-15',
          formTime: this.finishedTable.deliverydate,
          mcode: this.finishedTable.code,
          name: this.finishedTable.name,
          num: parseInt(this.finishedTable.amount),
          specifications: this.finishedTable.modelandspecification,
          startTime: '2023-08-14',
          supplier: this.finishedTable.supplier,
          type: this.type,
          unit: this.finishedTable.unit })
      }
      this.type = ''
      this.checkTypeVisible = false
      this.$message({
          message: '添加成功!',
          type: 'success'
        });
    },
      // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
      handleSizeChange(val) {
        console.log(`每页 ${val} æ¡`)
        this.currentPage = 1
        // this.currentPage = 1
        this.pageSize = val
        this.selectInspectsList()
      },
      // å½“前页改变时触发 è·³è½¬å…¶ä»–页
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`)
        this.currentPage = val
        this.selectInspectsList()
      }
    }
  }
@@ -514,7 +883,6 @@
  .library-table{
        background-color: #fff;
        flex: 1;
        max-width: 100%;
        margin-left: -15px;
        margin-right: -15px;
        margin-top: 50px;
@@ -538,6 +906,9 @@
            flex-direction: column;
            .el-table {
              flex: 1;
              .tag{
                width: 80px;
              }
            }
            >div:nth-child(2){
              display: flex;
@@ -547,12 +918,21 @@
            }
        }
      }
.infoForm{
.checkTypeForm{
    margin-top: 30px;
    margin-left: 50px;
    .el-row{
        margin-bottom: 10px;
    }
}
.pagination{
  display: flex;
  margin-top: 20px;
  justify-content: end;
}
.dialog-footer{
  display: flex;
  margin-top: 20px;
  justify-content: end;
}
  </style>
src/views/inspectionManagement/commissionInspection/index.vue
@@ -232,8 +232,9 @@
    // æŸ¥è¯¢æ–¹æ³•
    async search() {
    // å°†æœç´¢æ¡ä»¶ä½œä¸ºå‚数传递给getCommisionList方法
    let res
    if(this.radioValue === 0){
      const res = await getCommisionList({
      res = await getCommisionList({
        pageNo: this.currentPage,
        pageSize: this.pageSize,
        entrustCoding: this.searchData.code,
@@ -241,7 +242,7 @@
        entrusted: this.searchData.department,
      })
    }else{
      const res = await getCommisionList({
      res = await getCommisionList({
        pageNo: this.currentPage,
        pageSize: this.pageSize,
        entrustCoding: this.searchData.code,
@@ -261,13 +262,13 @@
      this.searchData.code = ''
      this.searchData.name = ''
      this.searchData.department = ''
      this.radioValue = '0'
      this.radioValue = 0
      // é‡æ–°èŽ·å–æ•°æ®
      this.getCommisionList()
    },
    async radioclick(){
      // å¤„理点击radio的时间
      // console.log('radioValue',this.radioValue)
      console.log('radioValue',this.radioValue)
      if(this.radioValue === 0){
        this.getCommisionList() 
      }else{
src/views/laboratory/measure/index.vue
@@ -1,13 +1,319 @@
<template>
  <div>计量管理</div>
  <div>
      <div class="content-main">
          <div class="top-bar">
              <el-form ref="form" :inline="true" :model="searchData">
              <el-form-item :label="this.radioValue === 0 ? '仪器设备编号:' : '编号:'" class="sermargin">
                <el-input
                  v-model="searchData.code"
                  class="input-form"
                  placeholder="请输入"
                >
                </el-input>
              </el-form-item>
              <el-form-item :label="this.radioValue === 0 ? '仪器设备名称:' : '设备名称'" class="sermargin">
                <el-input
                  v-model="searchData.name"
                  class="input-form"
                  placeholder="请输入"
                >
                </el-input>
              </el-form-item>
              <el-form-item :label="this.radioValue === 0 ? '计量单位:' : '计量单位:'" style="margin-right: 20px;">
                <el-input
                  v-model="searchData.measureunit"
                  class="input-form"
                  placeholder="请输入"
                >
                </el-input>
              </el-form-item>
              </el-form>
              <el-form>
                <el-form-item v-if="this.radioValue === 0" class="rightBtn">
                  <el-button type="primary" @click="search">查询</el-button>
                  <el-button type="primary" plain @click="reset">重置</el-button>
                </el-form-item>
                <el-form-item v-if="this.radioValue === 1" class="rightBtn">
                  <el-button type="primary" icon="el-icon-plus">新增计划</el-button>
                </el-form-item>
              </el-form>
              </el-form>
          </div>
          <div class="library-table">
            <div class="table-header">
              <div class="search-bar">
                <el-radio-group v-model="radioValue" @change="radioclick">
                <el-radio-button v-for="item in options" :key="item.value" :label="item.value">
                {{ item.label }}
              </el-radio-button>
              </el-radio-group>
              </div>
            </div>
            <div class="table-box">
              <el-table
                v-if="this.radioValue === 0"
                :max-height="800"
                :cell-style="{textAlign: 'center'}"
                :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
                :data="measureLedgerTable"
                style="width: 100%"
              >
                <el-table-column
                  type="selection"
                  min-width="10%"
                />
                <el-table-column
                  prop="hello"
                  label="仪器设备编号"
                  min-width="10%"
                />
                <el-table-column
                  prop="entrust_coding"
                  label="仪器设备名称"
                  min-width="10%"
                />
                <el-table-column
                  prop="entrusted"
                  label="测量范围"
                  min-width="15%"
                />
                <el-table-column
                  prop="samples_number"
                  label="计量周期"
                  min-width="6%"
                />
                <el-table-column
                  prop="inspection_status"
                  label="计量结果"
                  min-width="6%">
                  <template slot-scope="scope">
                    <div v-if="scope.row.inspection_status === 1">
                      <span style="color: green;">正常</span>
                    </div>
                    <div v-else>
                      <span style="color: red;">失准</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="specifications_models"
                  label="计量日期"
                  min-width="12%"
                />
                <el-table-column
                  prop="dateSurvey"
                  label="计量有效期"
                  min-width="8%"
                />
                <el-table-column
                  prop="completionDeadline"
                  label="负责人"
                  min-width="6%"
                />
                <el-table-column
                  prop="contacts"
                  label="创建日期"
                  min-width="8%"
                />
                <el-table-column
                  prop="inspectionTime"
                  label="创建人"
                  min-width="8%"
                />
                <el-table-column
                  prop="inspectionTime"
                  label="计量编号"
                  min-width="8%"
                />
                <el-table-column
                  label="操作"
                  min-width="15%"
                >
                  <template slot-scope="scope">
                    <el-button type="text" size="small" >查看计量履历</el-button>
                    <el-button type="text" size="small" >查看附件</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <el-table
                v-if="this.radioValue === 1"
                :max-height="800"
                :cell-style="{textAlign: 'center'}"
                :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
                :data="measurePlanTable"
                style="width: 100%"
              >
                <el-table-column
                  type="selection"
                  min-width="10%"
                />
                <el-table-column
                  prop="hello"
                  label="计量单号"
                  min-width="10%"
                />
                <el-table-column
                  prop="entrust_coding"
                  label="设备编号"
                  min-width="10%"
                />
                <el-table-column
                  prop="entrusted"
                  label="设备名称"
                  min-width="15%"
                />
                <el-table-column
                  prop="samples_number"
                  label="计划日期"
                  min-width="6%"
                />
                <el-table-column
                  prop="inspection_status"
                  label="计量状态"
                  min-width="6%">
                  <template slot-scope="scope">
                    <div v-if="scope.row.inspection_status === 1">
                      <span style="color: green;">已完成</span>
                    </div>
                    <div v-else>
                      <span style="color: red;">未完成</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="specifications_models"
                  label="计量负责人"
                  min-width="12%"
                />
                <el-table-column
                  prop="dateSurvey"
                  label="计量单位"
                  min-width="8%"
                />
                <el-table-column
                  prop="completionDeadline"
                  label="创建人"
                  min-width="6%"
                />
                <el-table-column
                  prop="contacts"
                  label="创建日期"
                  min-width="8%"
                />
                <el-table-column
                  label="操作"
                  min-width="15%"
                >
                  <template slot-scope="scope">
                    <el-button type="text" size="small" >查看计量履历</el-button>
                    <el-button type="text" size="small" >查看附件</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <!-- åˆ†é¡µå™¨ -->
              <div>
                <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">
                </el-pagination>
              </div>
            </div>
          </div>
      </div>
  </div>
</template>
<script>
import { getPlanPageList, getStandingPageList } from '@/api/laboratory/measure'
export default {
  data() {
    return {
      searchData:{
        code: '',
        name: '',
        measureunit: ''
      },
      radioValue: 0,
      options:[{
        value: 0,
        label: '计量台账'
      },{
        value: 1 ,
        label: '计量计划'
      }],
      measureLedgerTable: [],
      measurePlanTable: [],
      currentPage: 1,
      pageSize: 5,
      total: 20
    }
  },
  created(){
    this.getStandingPageList()
  },
  methods: {
    async getStandingPageList(){
      const res = await getStandingPageList({pageNo:this.currentPage , pageSize:this.pageSize })
      this.measureLedgerTable = res.data
      console.log(this.measureLedgerTable)
    }
  }
}
</script>
<style lang="scss" scoped>
<style scoped>
.top-bar{
    margin: -25px -15px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    padding: 5px 24px 0px 24px;
    .sermargin{
      margin-right: 60px;
    }
  }
.rightBtn{
    margin-right: 50px
}
.library-table{
      background-color: #fff;
      flex: 1;
      margin: 0px -15px;
      margin-top: 40px;
      display: flex;
      flex-direction: column;
      .table-header{
        padding: 20px;
        display: flex;
        justify-content: space-between;
        .el-form-item{
          margin-bottom: 30px !important;
        }
      }
      .table-box{
          padding: 0px 20px;
          margin-top: 0px;
          flex: 1;
          background: #fff;
          /* padding: 20px 20px 10px 20px; */
          display: flex;
          flex-direction: column;
          .el-table {
            flex: 1;
          }
          >div:nth-child(2){
            display: flex;
            justify-content: end;
            margin: 10px 0;
          }
      }
    }
</style>