yxh
yxh
2024-01-03 ad33e8834b09f52f3751be207b75346ab6be7494
src/views/project/donorcharge/donorcharge/index.vue
ÎļþÃû´Ó src/views/project/donorcharge/index.vue ÐÞ¸Ä
@@ -47,24 +47,19 @@
          <span>{{ parseTime(scope.row.donatetime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="OPO编号" align="center" prop="donateno" />
      <el-table-column label="案例编号" align="center" prop="donateno" />
      <el-table-column label="捐献姓名" align="center" prop="name" />
      <el-table-column label="出生年月" align="center" prop="borthdate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.borthdate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="性别" align="center" prop="sex" />
      <el-table-column label="年龄" align="center" prop="age" />
      <el-table-column label="捐献类别" align="center" prop="donationcategory" />
      <el-table-column label="捐献器官" align="center" prop="donateorgan" />
      <el-table-column label="实收费用" align="center" prop="chargeamounted" />
      <el-table-column label="应收费用" align="center" prop="chargeamount" />
      <el-table-column label="已收费用" align="center" prop="chargeamounted" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['system:donorcharge:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)"
            v-hasPermi="['system:donorcharge:edit']">详情</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['system:donorcharge:remove']">删除</el-button>
        </template>
@@ -132,16 +127,87 @@
              <el-input v-model="form.remark" placeholder="请输入备注" />
            </el-form-item></el-col>
        </el-row>
        <el-row>
          <el-table :data="donorchargerogans" v-loading="loading" max-height="1200" border highlight-current-row>
            <el-table-column prop="orderno" align="center" label="序号" width="80">
              <template slot-scope="scope">
                <el-input v-model="scope.row.orderno" placeholder="序号" />
              </template>
            </el-table-column>
            <el-table-column prop="organno" align="center" label="器官编号" width="90">
              <template slot-scope="scope">
                <el-input v-model="scope.row.organno" placeholder="器官编号" />
              </template>
            </el-table-column>
            <el-table-column prop="organname" align="center" label="器官名称" width="100">
              <template slot-scope="scope">
                <el-input v-model="scope.row.organname" placeholder="器官名称" />
              </template>
            </el-table-column>
            <el-table-column prop="hospitalname" align="center" label="接收医院" width="200">
              <template slot-scope="scope">
                <el-input v-model="scope.row.hospitalname" placeholder="接收医院" />
              </template>
            </el-table-column>
            <el-table-column prop="amounttime" align="center" label="接收时间" width="120">
              <template slot-scope="scope">
                <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.amounttime" type="date"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="接收时间">
                </el-date-picker> </template>
            </el-table-column>
            <el-table-column prop="amount" align="center" label="已收费用" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.amount" placeholder="已收费用" />
              </template>
            </el-table-column>
            <el-table-column prop="amounttime" align="center" label="收款时间" width="120">
              <template slot-scope="scope">
                <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.amounttime" type="date"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="收款时间" @blur="getdays(scope.row)">
                </el-date-picker> </template>
            </el-table-column>
            <el-table-column prop="organcharge" align="center" label="标准费用" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.organcharge" placeholder="已收费用" />
              </template>
            </el-table-column>
            <el-table-column prop="remark" align="center" label="备注">
              <template slot-scope="scope">
                <el-input v-model="scope.row.remark" placeholder="备注" />
              </template>
            </el-table-column>
          </el-table>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
        <el-button @click="cancel">取 æ¶ˆ</el-button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="showSelectionDialog" :close-on-click-modal="false" :title="'请选择捐献案例'" width="500px"
      style="text-align: center" v-loading="loading">
      <el-form ref="selectionForm" :model="selectionForm">
        <el-row>
          <el-form-item label="捐献者名字:" prop="donorname" label-width="120px">
            <el-select v-model="selectionForm.donorid" filterable reserve-keyword default-first-option
              placeholder="请输入捐献者的姓名" style="width: 100%">
              <el-option v-for="item in donorlist" :key="item.donorid" :label="item.donorname" :value="item.donorid">
              </el-option>
            </el-select>
          </el-form-item>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showSelectionDialog = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="confirmSelection()">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { listDonatebaseinfo } from "@/api/project/donatebaseinfo";
import { listDonorcharge, getDonorcharge, delDonorcharge, addDonorcharge, updateDonorcharge, exportDonorcharge, listDonorchargeorgan, getDonorchargeorgan, delDonorchargeorgan, addDonorchargeorgan, updateDonorchargeorgan, exportDonorchargeorgan } from "@/api/project/donorcharge";
export default {
  name: "Donorcharge",
@@ -161,27 +227,46 @@
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      //当前案例id
      curInfoId: 0,
      // æçŒ®æ¡ˆä¾‹å™¨å®˜åˆ—表格数据
      donorchargeList: [],
      donorchargerogans: [],
      //捐献案例选择
      showSelectionDialog: false,
      donorlist: [],
      donorinfolist: [],
      selectionForm: {
        index: null,
        donorid: null,
        donorname: null
      },
      loadingdonorlist: false,
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      // æŸ¥è¯¢è´¹ç”¨è¡¨å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        infoid: null,
        donateno: null,
        donatetime: null,
        name: null,
        borthdate: null,
        sex: null,
        age: null,
        donationcategory: null,
        donateorgan: null,
        chargeamount: null,
        chargeamounted: null,
      },
      //查询案例参数
      donorParams: {
        pageNum: 1,
        pageSize: 1000,
      },
      // æŸ¥è¯¢è´¹ç”¨å™¨å®˜è¡¨å‚æ•°
      organParams: {
        pageNum: 1,
        pageSize: 10,
        donorchargeid: null,
      },
      // è¡¨å•参数
      form: {},
@@ -193,7 +278,24 @@
  created() {
    this.getList();
  },
  methods: {
    //专家/医疗机构/费用报销机构选择
    confirmSelection() {
      var curdonorinfo = null;
      //从案例列表获取信息
      this.donorinfolist.map(item => {
        if (this.selectionForm.donorid == item.id) {
          curdonorinfo = item;
        }
      });
      this.showSelectionDialog = false;
      this.$router.push({
        path: "/finance/donorchargedetail/",
        query: { id: 0, operation: "add", data: curdonorinfo }
      });
    },
    /** æŸ¥è¯¢æçŒ®æ¡ˆä¾‹å™¨å®˜åˆ—列表 */
    getList() {
      this.loading = true;
@@ -203,6 +305,7 @@
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
@@ -250,20 +353,102 @@
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.selectionForm.index = null;
      this.selectionForm.donorid = null;
      this.selectionForm.donorname = null;
      if (this.donorlist[0]) {
        this.showSelectionDialog = true;
      }
      else {
        //获取捐献案例列表
        if (this.donorlist.length>0) { }
        else {
          this.loading = true;
          listDonatebaseinfo(this.donorParams).then(res => {
            this.donorinfolist = res.rows;
            this.donorinfolist.forEach(item => {
              this.donorlist.push({
                donorid: item.id,
                donorname: item.name
              });
            });
            this.loading = false;
          });
        }
        this.showSelectionDialog = true;
      };
      /**
      this.reset();
      this.open = true;
      this.title = "添加捐献案例器官列";
      this.title = "捐献案例器官费用情况";
      this.donorchargerogans = [];
      */
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.$router.push({
        path: "/finance/donorchargedetail/",
        query: { id: row.id, operation: "update", data: row }
      });
      /**
      this.reset();
      const id = row.id || this.ids
      getDonorcharge(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改捐献案例器官列";
        this.title = "修改捐献案例器官费用情况";
        //器官费用信息
        // this.organParams.infoid = row.infoid;
        this.organParams.donorchargeid = row.id;
        listDonorchargeorgan(this.organParams).then(res => {
          console.log(res);
          this.donorchargerogans = res.rows;
          if (this.donorchargerogans.length > 0) {
          } else {
            this.addRow(0);
          }
        });
      });
      */
    },
    /** è¯¦æƒ…查看按钮操作 */
    handleDetail(row) {
      this.$router.push({
        path: "/finance/donorchargedetail/",
        query: { id: row.id, operation: "detail", data: row }
      });
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除捐献案例器官列编号为"' + ids + '"的数据项?').then(function () {
        return delDonorcharge(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal.confirm('是否确认导出所有捐献案例器官列数据项?').then(() => {
        this.exportLoading = true;
        return exportDonorcharge(queryParams);
      }).then(response => {
        this.$download.name(response.msg);
        this.exportLoading = false;
      }).catch(() => { });
    },
    /** æäº¤æŒ‰é’® */
    submitForm() {
      this.$refs["form"].validate(valid => {
@@ -284,27 +469,6 @@
        }
      });
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除捐献案例器官列编号为"' + ids + '"的数据项?').then(function () {
        return delDonorcharge(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal.confirm('是否确认导出所有捐献案例器官列数据项?').then(() => {
        this.exportLoading = true;
        return exportDonorcharge(queryParams);
      }).then(response => {
        this.$download.name(response.msg);
        this.exportLoading = false;
      }).catch(() => { });
    }
  }
};
</script>