licp
2024-12-09 c720c2a6eb50796876cae4b18b37b54e9a99ea60
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -259,7 +259,7 @@
    <el-row class="title">
      <el-col :span="12" style="padding-left: 20px;text-align: left;" :class="{noShow:noBack}">检验单详情
      </el-col>
      <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end;margin-top: 16px;">
      <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end;margin-bottom: 16px;">
        <el-button size="small" type="primary" @click="versionDialogVisible=true" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')">电调/非电调模板切换</el-button>
        <el-select v-model="template" size="medium" placeholder="电路预设模板" style="margin-right: 10px;margin-left: 10px;" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')"
          @change="selectInsProductTemplateById">
@@ -277,10 +277,11 @@
        <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
          :loading="submitLoading">提交</el-button>
        <!-- 复核 -->
        <el-button size="small" type="primary" @click="upInsReview(1,'继续试验')" :loading="reviewLoading"
          v-if="state>1&&!isLook">继续试验</el-button>
        <!-- <el-button size="small" type="primary" @click="upInsReview(1,'继续试验')" :loading="reviewLoading"
          v-if="state>1&&!isLook">继续测试下一个样品</el-button>
        <el-button size="small" @click="upInsReview(0,'再次试验')" v-if="state>1&&!isLook" type="danger">再次试验</el-button>
        <el-button size="small" @click="upInsReview(2,'结束试验')" v-if="state>1&&!isLook">结束试验</el-button>
        <el-button size="small" @click="upInsReview(2,'结束试验')" v-if="state>1&&!isLook">此委托单结束</el-button> -->
        <el-button size="small" type="primary" @click="upInsReviewDia=true" v-if="state>1&&!isLook">复核</el-button>
        <el-button size="small" @click="handleBack" v-if="!noBack">返回</el-button>
      </el-col>
    </el-row>
@@ -756,7 +757,7 @@
      }"
      v-if="state==1&&fileAdd"
      :on-success="handleSuccessUp" :show-file-list="false"
        accept='.jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv' :headers="headers" :on-change="beforeUpload"
        accept='.jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv' :headers="headers" :before-upload="beforeUpload"
        style="width: 80px !important;"
        :on-error="onError" ref='upload'>
        <el-button size="small" type="primary" v-if="state==1">附件上传</el-button></el-upload>
@@ -940,6 +941,18 @@
        <el-button type="primary" @click="addTemplateDia" :loading="templateLoading">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="复核" :visible.sync="upInsReviewDia" width="400px">
      <el-radio-group v-model="upInsReviewType" style="display: flex;flex-direction: column">
        <el-radio :label="1" style="margin: 10px 0; ">继续测试下一个样品或其他站点任务</el-radio>
        <el-radio :label="0" style="margin: 10px 0; ">再次检验该样品</el-radio>
        <el-radio :label="2" style="margin: 10px 0; ">此委托单结束</el-radio>
        <p style="font-size: 12px;color:red">慎重:如果还有其他样品在检,点击结束可能会中断,请确保所有样品都检验且复核完成再点击</p>
      </el-radio-group>
      <span slot="footer" class="dialog-footer">
        <el-button @click="upInsReviewDia = false">取 消</el-button>
        <el-button type="primary" @click="upInsReview" :loading="reviewLoading">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -967,6 +980,8 @@
        lookFileVisible:false,//预览文件
        experimentDia:false,
        experimentDia0:false,
        upInsReviewDia:false,
        upInsReviewType:1,
        experimentInfo:{
          note:'',
          term:''
@@ -3224,23 +3239,19 @@
        })
      },
      // 复核
      upInsReview(e,type) {
        this.$confirm(type=='结束试验'?'确认结束试验?确定后此委托单停止试验,并且无法再次检验!':`是否${type}?`, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          if (e == 1||e==2) {
      upInsReview() {
        if (this.upInsReviewType == 1||this.upInsReviewType==2) {
          // 继续试验
          this.reviewLoading = true;
          this.$axios.post(this.$api.insOrderPlan.verifyPlan, {
            sampleId: this.orderId,
            type: e,
            type: this.upInsReviewType,
            laboratory: this.sonLaboratory,
            tell: null
          }).then(res => {
            if (res.code === 200) {
              this.$message.success("操作成功")
              this.upInsReviewDia = false;
              this.$emit('goback')
            }
            this.reviewLoading = false;
@@ -3252,7 +3263,6 @@
          // 再次试验
          this.reviewDia = true;
        }
        })
      },
      handleReviewDia() {
        if (this.noReason) {
@@ -3315,6 +3325,9 @@
        }
        if(!this.otherForm.humidity){
          this.$message.error('请输入湿度')
          return
        }
        if(this.sonLaboratory === '电路试验'&&!this.$refs.CircuitParameters.saveAll()){
          return
        }
        this.experimentDia = true
@@ -3706,22 +3719,35 @@
        let list = await this.getCurrentProduct(this.currentFiberOptic.id,2)
        this.getTableLists0(list)
      },
      handleSuccessUp(response, ) {
      async handleSuccessUp(response, ) {
        this.upLoading = false;
            if (response.code == 200) {
          this.$message.success('上传成功');
          this.$refs.fileList.selectList()
          if(this.sonLaboratory === '电路试验'){
            // // 电路试验数采
            // 获取当前样品的检验项
            let list = await this.getCurrentProduct(this.currentSample.id,0)
            this.currentSample.insProduct = this.HaveJson(list)
            this.currentNum++
          }
            }
         },
      beforeUpload(file) {
            if (file.size > 1024 * 1024 * 10) {
               this.$message.error('上传文件不超过10M');
               this.$refs.upload.clearFiles()
               return false;
            } else {
          this.upLoading = true;
               return true;
            }
        if(this.sonLaboratory === '电路试验'&&!this.$refs.CircuitParameters.allBandList.find(m=>m.band)){
          this.$message.error('上传附件前请先填写并保存频段');
          return false
        }else{
          this.$refs.CircuitParameters.saveAll()
          if (file.size > 1024 * 1024 * 10) {
            this.$message.error('上传文件不超过10M');
            this.$refs.upload.clearFiles()
            return false;
          } else {
            this.upLoading = true;
            return true;
          }
        }
         },
      onError(err, file, fileList) {
            this.$message.error('上传失败')
@@ -3820,7 +3846,9 @@
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.$emit('goback')
            if(this.$refs.CircuitParameters.saveAll()){
              this.$emit('goback')
            }
          })
        }else{
          this.$emit('goback')