WXL
昨天 9b2c74ee4f08fad01c2a16bc6e36df073bfa1dd5
src/views/business/transfer/index.vue
@@ -155,6 +155,18 @@
        prop="caseNo"
        width="140"
      />
      <el-table-column
        label="转运状态"
        align="center"
        prop="transitStatus"
        width="100"
      >
        <template slot-scope="scope">
          <el-tag :type="getStatusTagType(scope.row.transitStatus)">
            {{ getStatusText(scope.row.transitStatus) }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="患者信息" align="center" width="260">
        <template slot-scope="scope">
          <div class="donor-info">
@@ -194,18 +206,7 @@
        prop="contactPerson"
        width="100"
      />
      <el-table-column
        label="转运状态"
        align="center"
        prop="transitStatus"
        width="100"
      >
        <template slot-scope="scope">
          <el-tag :type="getStatusTagType(scope.row.transitStatus)">
            {{ getStatusText(scope.row.transitStatus) }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column
        label="创建时间"
        align="center"
@@ -429,11 +430,7 @@
      append-to-body
    >
      <div class="action-confirm">
        <p>
          确定要{{ actionText }}转运单 "{{
             currentTransport.id
          }}" 吗?
        </p>
        <p>确定要{{ actionText }}转运单 "{{ currentTransport.id }}" 吗?</p>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="actionOpen = false">取 消</el-button>
@@ -519,15 +516,15 @@
        pageNum: 1,
        pageSize: 10,
        caseNo: undefined,
        patName: undefined,
        patName: undefined
        // 只查询已同意且需要转运的案例
        // reportStatus: "3", // 已同意
        isTransport: "2" // 需要转运
        // isTransport: "2" // 需要转运
      }
    };
  },
  created() {
    this.getList();
    // this.getList();
    this.checkAutoCreate();
  },
  methods: {
@@ -567,26 +564,31 @@
    },
    checkAutoCreate() {
      const query = this.$route.query;
      // 上报跳转过来进行处理
      if (query.autoCreate === "true") {
        // 自动打开案例选择弹框
        this.selectCaseOpen = true;
        this.resetCaseSearch();
        // 如果有特定的案例编号,可以预先搜索
        if (query.caseNo) {
          // this.selectCaseOpen = true;
          this.resetCaseSearch(1);
          this.caseQueryParams.caseNo = query.caseNo;
          this.searchCaseList();
          this.searchCaseList(1);
        } else {
          this.queryParams.patName = query.patName;
        }
      }
      this.getList();
    },
    /** 搜索可用案例 */
    async searchCaseList() {
    async searchCaseList(type) {
      this.caseLoading = true;
      try {
        const response = await donateList(this.caseQueryParams);
        if (response.code === 200) {
          this.availableCaseList = response.rows || response.data || [];
          this.caseTotal = response.total || 0;
          if (type == 1 && response.data[0]) {
            this.selectCase(response.data[0]);
          }
        } else {
          this.$modal.msgError(response.msg || "获取案例列表失败");
        }
@@ -599,7 +601,7 @@
    },
    /** 重置案例搜索 */
    resetCaseSearch() {
    resetCaseSearch(type) {
      this.caseQueryParams = {
        pageNum: 1,
        pageSize: 10,
@@ -608,7 +610,12 @@
        // reportStatus: "3",
        isTransport: "2"
      };
      this.searchCaseList();
      if (!type) {
        this.searchCaseList();
      } else {
        // 跨页面新增取消限制
        this.caseQueryParams.isTransport = null;
      }
    },
    /** 判断案例是否已有转运单 */
@@ -636,7 +643,7 @@
      // 打开转运单编辑页面,并传入选中的案例
      this.currentTransport = this.convertCaseToTransport(caseData);
      console.log(this.currentTransport,'currentTransport');
      console.log(this.currentTransport, "currentTransport");
      this.isEditing = false;
      this.editOpen = true;
@@ -644,7 +651,7 @@
    /** 将案例信息转换为转运单格式 */
    convertCaseToTransport(caseData) {
      console.log(caseData,'2');
      console.log(caseData, "2");
      return {
        caseNo: caseData.caseNo,
@@ -712,7 +719,7 @@
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item =>  item.id);
      this.ids = selection.map(item => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
@@ -740,7 +747,7 @@
    /** 详情按钮操作 */
    handleDetail(row) {
      this.currentTransport = row;
      this.detailTitle = `转运单详情 - ${ row.id}`;
      this.detailTitle = `转运单详情 - ${row.id}`;
      this.detailOpen = true;
    },