董国庆
2025-07-25 0c9660562a03191d44fc779a889d3da0dc624b6d
laboratory/src/views/dataManagement/confirmation-sheet/components/confirm-dialog.vue
@@ -5,6 +5,7 @@
    width="80%"
    :close-on-click-modal="false"
    @close="handleClose"
    @open='open'
    class="submit-confirm-dialog"
  >
    <div class="approval-content">
@@ -23,19 +24,19 @@
        </div>
      </div>
      <Table :tableData="sampleData" :total="0" :height="null">
      <Table :data="sampleData" :total="0" :height="null">
        <template>
          <el-table-column prop="index" label="序号" width="60" align="center"></el-table-column>
          <el-table-column prop="testName" label="检测项名称"></el-table-column>
          <el-table-column prop="testCode" label="检测项编号"></el-table-column>
          <el-table-column prop="testType" label="定性/定量" align="center">
          <el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
          <el-table-column prop="termName" label="检测项名称"></el-table-column>
          <el-table-column prop="termCode" label="检测项编号"></el-table-column>
          <el-table-column prop="termType" label="定性/定量" align="center">
            <template slot-scope="scope">
              {{ scope.row.testType === 1 ? '定性' : '定量' }}
              {{ scope.row.termType === 1 ? '定性' : '定量' }}
            </template>
          </el-table-column>
          <el-table-column prop="methodCode" label="检测方法编号"></el-table-column>
          <el-table-column prop="methodName" label="检测方法"></el-table-column>
          <el-table-column prop="requirements" label="收样要求" show-overflow-tooltip></el-table-column>
          <el-table-column prop="termMethodCode" label="检测方法编号"></el-table-column>
          <el-table-column prop="termMethod" label="检测方法"></el-table-column>
          <el-table-column prop="sampleRequire" label="收样要求" show-overflow-tooltip></el-table-column>
        </template>
      </Table>
@@ -46,14 +47,14 @@
          <el-button type="primary" @click="openSignature">签名</el-button>
        </div>
        <div v-if="imgSrc" class="signature-preview">
          <img :src="imgSrc" alt="签名" />
          <img :src="getFullUrl(imgSrc)" alt="签名" />
        </div>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="handleConfirm" :disabled="!imgSrc">确 认</el-button>
      <el-button type="primary" @click="handleConfirm">确 认</el-button>
    </div>
    <SignatureCanvas
@@ -66,6 +67,9 @@
<script>
import SignatureCanvas from "@/components/SignatureCanvas.vue";
import {queryDetail} from '@/components/service.js'
import {getFullUrl} from '@/utils/utils.js'
export default {
  name: "ConfirmDialog",
@@ -99,6 +103,13 @@
    };
  },
  methods: {
    open(){
      queryDetail().then(res=>{
        if(res){
          this.imgSrc=res.signPicture
        }
      })
    },
    handleClose() {
      this.$emit("update:visible", false);
      this.imgSrc = "";
@@ -111,16 +122,24 @@
    },
    handleSignatureConfirm(imageData) {
      this.signatureDialogVisible = false;
      this.imgSrc = imageData;
      this.imgSrc = ""; // 先清空
      this.$nextTick(() => {
        this.imgSrc = imageData;
      });
    },
    handleConfirm() {
      if (!this.imgSrc) {
        this.$message.warning("请先完成签名确认");
        return;
        this.$message({
          type: 'warning',
          message: '请先完成签名确认',
          duration: 2000
        })
        return
      }
      this.$emit("confirm", this.imgSrc);
      this.handleClose();
    },
    getFullUrl
  },
};
</script>