zss
2025-08-13 e3fd4f635af4a4d05d5fe99e88124d1ad3ba0e0b
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -315,6 +315,7 @@
          <span style="color: #3A7BFA;">保存模板</span>
        </el-button>
        <!-- <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">样品切换</el-button> -->
        <el-button size="small" type="primary" @click="showSampleChangeDialog" >样品编号更改</el-button>
        <el-button size="small" type="primary" @click="taskVisible = true" v-show="!isLook">任务切换</el-button>
        <el-button size="small" type="primary" @click="handleSubmit" v-if="state == 1"
          :loading="submitLoading">提交</el-button>
@@ -1168,6 +1169,21 @@
        <el-button type="primary" @click="upInsReview" :loading="reviewLoading">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="修改样品编号"
      :visible.sync="changeSampleDialog"
      width="30%"
      :before-close="handleCloseSampleChangeDialog">
      <el-form ref="changeSampleFormRef" :model="changeSampleForm" :rules="{sampleCode:[{required:true,message:'请输入样品编号',trigger:'blur'}]}">
        <el-form-item label="样品编号:" prop="sampleCode" >
        <el-input clearable v-model="changeSampleForm.sampleCode" placeholder='样品编号'></el-input>
      </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleCloseSampleChangeDialog">取 消</el-button>
        <el-button type="primary" @click="confirmChangeSample">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -1206,6 +1222,10 @@
  },
  data() {
    return {
      changeSampleDialog: false,
      changeSampleForm:{
        sampleCode:null,
      },
      lookFileVisible: false, //预览文件
      experimentDia: false,
      experimentDia0: false,
@@ -1645,6 +1665,37 @@
    this.stopWorker();
  },
  methods: {
    handleCloseSampleChangeDialog(){
      this.changeSampleForm = {sampleChange:null}
      this.$refs.changeSampleFormRef.resetFields();
      this.changeSampleDialog = false
    },
    //确认修改样品编号
    confirmChangeSample(){
      this.$refs.changeSampleFormRef.validate((valid)=>{
        if(valid){
          this.$axios.post(this.$api.insOrderPlan.changeSampleCode,{
            id:this.currentSample.id,
            sampleCode:this.changeSampleForm.sampleCode
          },{
            headers:{"Content-Type":"application/json"}
          }).then(res=>{
            if(res.code==200){
              this.$message.success("修改成功")
              //调用刷新方法
              this.currentSample.sampleCode = this.changeSampleForm.sampleCode
            }
            this.$nextTick(()=>{
              this.handleCloseSampleChangeDialog()
            })
          })
        }
      })
    },
    //显示修改样品编号
    showSampleChangeDialog(){
      this.changeSampleDialog = true
    },
    // 数据采集
    getDataAcquisitionDevice() {
      if (