董国庆
2025-07-01 4ca375b2e3dae98d6ececc1b7b421a12f3fa8a26
laboratory/src/views/dataManagement/dispatching/editDispatch.vue
@@ -4,6 +4,7 @@
      :title="dialogTitle"
      :visible.sync="visible"
      width="80%"
      @open='open'
      :close-on-click-modal="false"
      @close="handleClose"
    >
@@ -118,7 +119,6 @@
                <div style="padding-left: 25px">
                  <el-form-item prop="experimentTime" label="试验时间">
                    <el-date-picker
                      style="width: 100%"
                      v-model="form.experimentTime"
                      type="datetimerange"
                      range-separator="至"
@@ -236,7 +236,7 @@
        <img
          v-if="imgSrc"
          style="width: 200px; height: 100px; margin-left: 25px"
          :src="imgSrc"
          :src="getFullUrl(imgSrc)"
          fit="fit"
        />
      </div>
@@ -263,6 +263,8 @@
import SignatureCanvas from "@/components/SignatureCanvas.vue";
import AIEditor from "@/components/AiEditor";
import { getDetailById, sign } from "./service";
import {queryDetail} from '@/components/service.js'
import {getFullUrl} from '@/utils/utils.js'
export default {
  name: "ApprovalDialog",
@@ -357,6 +359,14 @@
    },
  },
  methods: {
    getFullUrl,
    open(){
      queryDetail().then(res=>{
        if(res){
          this.imgSrc=res.signPicture
        }
      })
    },
    // 获取详情
    getDetail(id) {
      getDetailById({ id })
@@ -483,7 +493,6 @@
        dispatchId: this.data.id, // 传递当前调度id
        confirmSign: this.imgSrc, // 签名图片
      };
      console.log('params',params)
      sign(params).then(res => {
        if (res && res.code === 200) {
          this.$message.success('签字成功');
@@ -501,10 +510,10 @@
    },
    handleSignatureConfirm(imageData) {
      this.signatureDialogVisible = false;
      // 模拟上传签名图片,实际应调用上传接口,成功后回显图片链接
      // TODO: 替换为实际上传接口
      // uploadSignature(imageData).then(url => { this.imgSrc = url })
      this.imgSrc = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'; // 默认图片链接
      this.imgSrc = ""; // 先清空
      this.$nextTick(() => {
        this.imgSrc = imageData;
      });
    },
  },
};