yxh
2026-09-20 c870390bfc28b314f30240352895c5d6c466c148
src/views/project/donorcharge/donorchargedetail/index.vue
@@ -20,7 +20,7 @@
                  v-for="dict in dict.type.sys_user_sex"
                  :key="dict.label"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
@@ -134,6 +134,21 @@
                <el-input
                  v-model="scope.row.organname"
                  placeholder="器官名称"
                  :disabled="true"
                />
              </template>
            </el-table-column>
            <el-table-column
              label="系统编号"
              align="center"
              width="120"
              prop="caseno"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.caseno"
                  placeholder="系统编号"
                  :disabled="true"
                />
              </template>
            </el-table-column>
@@ -144,7 +159,11 @@
              width="150"
            >
              <template slot-scope="scope">
                <el-input v-model="scope.row.amount" placeholder="实收金额" />
                <el-input
                  v-model="scope.row.amount"
                  placeholder="实收金额"
                  :disabled="true"
                />
              </template>
            </el-table-column>
            <el-table-column
@@ -156,6 +175,7 @@
              <template slot-scope="scope">
                <el-date-picker
                  clearable
                  :disabled="true"
                  size="small"
                  style="width: 100%"
                  v-model="scope.row.amounttime"
@@ -176,21 +196,36 @@
                <el-input
                  v-model="scope.row.organcharge"
                  placeholder="标准费用"
                  :disabled="true"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="hospitalname"
              prop="hospitalno"
              align="center"
              label="接收医院"
              width="280"
            >
              <template slot-scope="scope">
                <org-selecter
                  v-model="scope.row.hospitalno"
                  ref="tranHosSelect"
                  :org-type="'4'"
                  v-model="scope.row.hospitalno"
                  style="width: 100%"
                  :disabled="true"
                />
              </template>
            </el-table-column>
            <el-table-column
              label="受体姓氏"
              align="center"
              width="120"
              prop="name"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.name"
                  placeholder="受体姓氏"
                />
              </template>
            </el-table-column>
@@ -203,6 +238,7 @@
              <template slot-scope="scope">
                <el-date-picker
                  clearable
                  :disabled="true"
                  size="small"
                  style="width: 100%"
                  v-model="scope.row.organtime"
@@ -214,7 +250,7 @@
              </template>
            </el-table-column>
            <el-table-column prop="organchargedesc" align="center" label="备注">
              <template slot-scope="scope">
              <template slot-scope="scope" width="300">
                <el-input
                  v-model="scope.row.organchargedesc"
                  placeholder="备注"
@@ -226,12 +262,12 @@
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          type="primary"
          type="success"
          @click="submitForm"
          v-if="operationType == 'add' || operationType == 'update'"
          >保 存</el-button
        >
        <el-button type="primary" @click="cancel">关闭</el-button>
        <el-button type="info" @click="cancel">关闭</el-button>
      </div>
    </div>
  </div>
@@ -258,6 +294,7 @@
import Li_area_select from "@/components/Address";
import { getUserProfile } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import { moneySum, moneyRound } from "@/utils/money";
import debounce from "lodash/debounce";
export default {
  components: {
@@ -272,7 +309,6 @@
    return {
      activeName: 1, //文件类型
      // 部门树选项
      //票据文件
      pdftitle: "",
      pdfimg: "",
@@ -315,8 +351,6 @@
      donorchargeorgans: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询费用表参数
      queryParams: {
        pageNum: 1,
@@ -333,7 +367,6 @@
        pageSize: 10,
        donorchargeid: null
      },
      // 当前用户信息
      userprofile: {},
      // 表单参数
@@ -382,7 +415,6 @@
      headers: {
        Authorization: "Bearer " + getToken()
      },
      jurisdiction: false,
      //保存按钮控制
@@ -400,7 +432,6 @@
      this.defaultperson = response.data;
      this.standardlevel = response.data.standardlevel;
    });
    //获取参数
    this.getroute();
  },
@@ -533,7 +564,6 @@
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "新增捐献案例器官费用表";
      if (this.curCase) {
@@ -566,7 +596,6 @@
              if (res1.code == 200) {
                this.organchargelist = res1.rows;
              }
              //插入器官表
              res.rows.forEach(item => {
                //获取费用金额
@@ -574,11 +603,12 @@
                  if (rescharge.organcode == item.organno) {
                    this.donorchargeorgans.push({
                      organno: item.organno,
                      caseno: item.caseno,
                      organname: item.organname,
                      organcharge: rescharge.charge,
                      infoid: item.infoid,
                      hospitalname: item.transplanthospitalname,
                      hospitalno: item.transplanthospitalno,
                      hospitalname: item.hospitalname,
                      hospitalno: item.hospitalno,
                      organtime: item.transplanttime,
                      chargestate: "0"
                    });
@@ -594,13 +624,11 @@
    /** 修改按钮操作 */
    handleUpdate() {
      this.reset();
      this.open = true;
      this.title = "修改捐献案例器官费用表";
      getDonorcharge(this.curId).then(response => {
        this.form = response.data;
        console.log("getDonorcharge", response);
        //器官费用信息
        this.organParams.donorchargeid = this.curId;
        console.log("this.organParams", this.organParams);
@@ -619,11 +647,9 @@
    /** 修改查看操作 */
    handleDetail() {
      this.reset();
      this.open = true;
      getDonorcharge(this.curId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "查看捐献案例器官费用表";
        //器官费用信息
@@ -642,27 +668,23 @@
    submitForm: debounce(function(data) {
      this.$refs["form"].validate(valid => {
        if (valid) {
          //校验、费用合计
          let ChargeSum = 0;
          let ChargeamountSum = 0;
          //校验、费用合计(金额一律走精确运算)
          let organname = "";
          try {
            for (let i = 0; i < this.donorchargeorgans.length; i++) {
              organname += this.donorchargeorgans[i].organname + ",";
              if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) {
                ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge);
              }
              if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) {
                ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount);
              }
            }
            this.form.donateorgan = organname.substring(
              0,
              organname.lastIndexOf(",")
            );
            this.form.chargeamount = ChargeSum.toFixed(2);
            this.form.chargeamounted = ChargeamountSum.toFixed(2);
            this.form.chargeamount = moneyRound(
              moneySum(this.donorchargeorgans, "organcharge")
            ).toFixed(2);
            this.form.chargeamounted = moneyRound(
              moneySum(this.donorchargeorgans, "amount")
            ).toFixed(2);
          } catch {}
          //保存
@@ -670,13 +692,13 @@
            for (let k = 0; k < this.donorchargeorgans.length; k++) {
              this.donorchargeorgans[k].donorchargeID = this.form.id;
            }
            updateDonorcharge(this.form).then(res1 => {
              if (res1.code == 200) {
                saveDonorchargeorgan(this.donorchargeorgans).then(res2 => {
                  if (res2.code == 200) {
                    this.$modal.msgSuccess("保存成功!");
                    this.open = false;
        this.$router.go(-1);
                  }
                });
              }
@@ -692,7 +714,8 @@
                saveDonorchargeorgan(this.donorchargeorgans).then(res2 => {
                  if (res2.code == 200) {
                    this.$modal.msgSuccess("保存成功!");
                    this.open = false;
        this.$router.go(-1);
                  }
                });
              }
@@ -702,24 +725,16 @@
      });
    }, 500),
    //计算费用合计
    //计算费用合计(金额一律走精确运算)
    chargeSum() {
      let ChargeSum = 0;
      let ChargeamountSum = 0;
      //费用合计
      try {
        for (let i = 0; i < this.donorchargeorgans.length; i++) {
          if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) {
            ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge);
          }
          if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) {
            ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount);
          }
        }
        this.form.chargeamount = ChargeSum.toFixed(2);
        this.form.chargeamounted = ChargeamountSum.toFixed(2);
        this.form.chargeamount = moneyRound(
          moneySum(this.donorchargeorgans, "organcharge")
        ).toFixed(2);
        this.form.chargeamounted = moneyRound(
          moneySum(this.donorchargeorgans, "amount")
        ).toFixed(2);
      } catch {}
    },
@@ -730,12 +745,13 @@
      var columnnames = [
        "organno",
        "organname",
        "amount",
        "caseno",
        "amounttime",
        "organcharge",
        "name",
        "hospitalname",
        "organtime",
        "remark"
        "remark",
        'organchargedesc'
      ];
      columns.forEach((column, index) => {
        if (index === 0) {
@@ -844,6 +860,12 @@
    text-align: center;
  }
}
::v-deep .el-input.is-disabled .el-input__inner {
    background-color: #F5F7FA;
    border-color: #dfe4ed;
    color: #000000;
    cursor: not-allowed;
}
::v-deep .el-input--medium .el-input__inner {
  height: 36px;