From 5743e533414c608a12f9323f17a7c86721c7f54c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 06 十一月 2026 00:13:43 +0800
Subject: [PATCH] organfee
---
src/views/project/donationdetails/index.vue | 161 +++++++++++++++++++++++++----------------------------
1 files changed, 77 insertions(+), 84 deletions(-)
diff --git a/src/views/project/donationdetails/index.vue b/src/views/project/donationdetails/index.vue
index be05831..50b2afe 100644
--- a/src/views/project/donationdetails/index.vue
+++ b/src/views/project/donationdetails/index.vue
@@ -2511,6 +2511,7 @@
:title="pdftitle"
:visible.sync="pdfVisible"
width="68%"
+ custom-class="pdf-resize-dialog"
>
<!-- <el-tabs style="margin-top: 20px;" v-model="activeName" type="card">
<el-tab-pane :label="activetele" name="1"> </el-tab-pane>
@@ -2811,18 +2812,6 @@
contacttime: "",
reporttime: ""
},
- organOrder: [
- "鑲濊剰",
- "宸﹁偩",
- "鍙宠偩",
- "蹇冭剰",
- "宸﹁偤",
- "鍙宠偤",
- "鑳拌吅",
- "灏忚偁",
- "宸︾溂瑙掕啘",
- "鍙崇溂瑙掕啘"
- ], // 鎸囧畾鐨勫櫒瀹橀『搴�
isSorting: false, // 鏍囧織浣嶏紝琛ㄧず鏄惁姝e湪鎺掑簭
tableKey: 0,
istb: false,
@@ -3182,7 +3171,8 @@
// 鐩戝惉 procureddata 鐨勫彉鍖栵紝鏁版嵁鏇存柊鍚庨噸鏂版帓搴�
procureddata: {
handler(newVal) {
- if (this.procureddata[0].organgettime) {
+ // 鍒ょ┖锛氬彇娑堟渶鍚庝竴涓櫒瀹樻椂鏁扮粍浼氬彉鎴愮┖锛岀洿鎺ュ彇 [0] 浼氭姏 TypeError
+ if (this.procureddata[0] && this.procureddata[0].organgettime) {
this.organgettimetrue = true;
}
if (this.isSorting) {
@@ -3342,7 +3332,8 @@
listDonateorgan(searchParam).then(res => {
if (res.code == 200) {
if (res.rows[0]) {
- this.allocateddata = res.rows;
+ // 2026-10-23锛氭寜鍣ㄥ畼鎺掗槦搴忓彿鎺掑簭鍚庡啀娓叉煋
+ this.allocateddata = this.sortOrganRows(res.rows);
console.log("this.allocateddata", this.allocateddata);
this.allocateddataform.allocateddata = this.allocateddata;
}
@@ -3383,6 +3374,8 @@
});
// this.procureddata.infoid = this.infoid;
}
+ // 2026-10-23锛氭寜鍣ㄥ畼鎺掗槦搴忓彿鎺掑簭鍚庡啀娓叉煋
+ this.procureddata = this.sortOrganRows(this.procureddata);
this.organList.organprocured = [];
for (let i = 0; i < this.procureddata.length; i++) {
this.organList.organprocured.push(this.procureddata[i].organno);
@@ -3437,6 +3430,8 @@
this.transplantdata.infoid = this.infoid;
}
+ // 2026-10-23锛氭寜鍣ㄥ畼鎺掗槦搴忓彿鎺掑簭鍚庡啀娓叉煋
+ this.transplantdata = this.sortOrganRows(this.transplantdata);
for (let i = 0; i < this.transplantdata.length; i++) {
this.organList.organtransplant.push(
this.transplantdata[i].organno
@@ -3703,6 +3698,8 @@
item.transplanthospitalname = objs.organizationname;
}
});
+ // 2026-10-23锛氭彁浜ゅ墠鎸夊櫒瀹樻帓闃熷簭鍙锋帓搴忥紝淇濊瘉鍏ュ簱椤哄簭涓庡睍绀轰竴鑷�
+ this.sortOrganRows(this.allocateddata);
saveDonateorgan(this.allocateddata).then(res => {
// 鍥炲~涓婚敭锛氬悗绔凡鎸�"鍚屼竴妗堜緥鍚屼竴鍣ㄥ畼"鍋� upsert锛屽洖濉悗鍓嶇涓嶄細鍐嶈鍒や负鏂板
if (res && res.data && res.data.length === this.allocateddata.length) {
@@ -3757,6 +3754,8 @@
}
});
//淇濆瓨鍣ㄥ畼鑾峰彇琛ㄦ暟鎹�
+ // 2026-10-23锛氭彁浜ゅ墠鎸夊櫒瀹樻帓闃熷簭鍙锋帓搴�
+ this.sortOrganRows(this.procureddata);
saveDonationwitnessorgan(this.procureddata).then(res => {
if (res && res.data && res.data.length === this.procureddata.length) {
res.data.forEach((row, i) => {
@@ -3793,6 +3792,8 @@
this.Processvalidation();
});
//淇濆瓨鍣ㄥ畼鑾峰彇琛ㄦ暟鎹�
+ // 2026-10-23锛氭彁浜ゅ墠鎸夊櫒瀹樻帓闃熷簭鍙锋帓搴�
+ this.sortOrganRows(this.procureddata);
saveDonationwitnessorgan(this.procureddata).then(res => {
if (res && res.data && res.data.length === this.procureddata.length) {
res.data.forEach((row, i) => {
@@ -3833,6 +3834,8 @@
if (this.accomplishform.id) {
updateDonatecompletioninfo(this.accomplishform).then(response => {
this.$modal.msgSuccess("瀹屾垚鐧昏淇℃伅淇敼鎴愬姛");
+ // 2026-10-23锛氭彁浜ゅ墠鎸夊櫒瀹樻帓闃熷簭鍙锋帓搴�
+ this.sortOrganRows(this.transplantdata);
saveDonatecomporgan(this.transplantdata).then(res => {
if (res && res.data && res.data.length === this.transplantdata.length) {
res.data.forEach((row, i) => {
@@ -3854,6 +3857,8 @@
this.accomplishform.id = response.data.id;
}
this.$modal.msgSuccess("瀹屾垚鐧昏鎴愬姛");
+ // 2026-10-23锛氭彁浜ゅ墠鎸夊櫒瀹樻帓闃熷簭鍙锋帓搴�
+ this.sortOrganRows(this.transplantdata);
saveDonatecomporgan(this.transplantdata).then(res => {
if (res && res.data && res.data.length === this.transplantdata.length) {
res.data.forEach((row, i) => {
@@ -3886,35 +3891,48 @@
}
},
- customOrganSort() {
- console.log("璋冪敤");
+ /**
+ * 鍙栧櫒瀹樼殑鎺掗槦搴忓彿锛氬瓧鍏� sys_Organ 鐨� dict_sort 鍘熷��
+ * 瀛楀吀閲屾病鏈夎鍣ㄥ畼鏃惰繑鍥� null锛堟帓搴忔椂鎺掓渶鍚庯級
+ */
+ getOrganSort(organno) {
+ const list =
+ (this.dict && this.dict.type && this.dict.type.sys_Organ) || [];
+ const item = list.find(d => d.value === organno);
+ if (item && item.raw) {
+ const s = item.raw.dictSort;
+ if (s !== null && s !== undefined && s !== "") {
+ return Number(s);
+ }
+ }
+ return null;
+ },
+ /**
+ * 鎸夊櫒瀹樻帓闃熷簭鍙峰崌搴忔帓搴忥紙鍘熷湴锛�
+ * sort 涓虹┖/0 瑙嗕负鏈煡锛屾帓鏈�鍚庯紱鐩稿悓搴忓彿鎸� id 鍏滃簳锛屼繚璇侀『搴忕ǔ瀹�
+ */
+ sortOrganRows(rows) {
+ if (!rows || !rows.length) {
+ return rows;
+ }
+ const weight = r => {
+ const s = Number(r.sort);
+ if (r.sort === null || r.sort === undefined || isNaN(s) || s === 0) {
+ return 999999;
+ }
+ return s;
+ };
+ rows.sort((a, b) => weight(a) - weight(b) || (a.id || 0) - (b.id || 0));
+ return rows;
+ },
+
+ customOrganSort() {
// 1. 鍔犻攣锛岄樆姝㈢洃鍚櫒鎵ц
this.isSorting = true;
this.loading = true;
- // 鑷畾涔夋帓搴忓嚱鏁�
- this.procureddata.sort((a, b) => {
- const indexA = this.organOrder.indexOf(a.organname);
- const indexB = this.organOrder.indexOf(b.organname);
-
- // 濡傛灉涓や釜閮藉湪鍒楄〃涓紝鎸夊垪琛ㄤ腑鐨勯『搴忔帓搴�
- if (indexA !== -1 && indexB !== -1) {
- return indexA - indexB;
- }
- // 濡傛灉 a 鍦ㄥ垪琛ㄤ腑锛宐 涓嶅湪锛宎 鎺掑墠闈�
- if (indexA !== -1) {
- return -1;
- }
- // 濡傛灉 b 鍦ㄥ垪琛ㄤ腑锛宎 涓嶅湪锛宐 鎺掑墠闈�
- if (indexB !== -1) {
- return 1;
- }
- // 涓や釜閮戒笉鍦ㄥ垪琛ㄤ腑锛屼繚鎸佸師椤哄簭锛堟垨鎸夊叾浠栬鍒欙紝姣斿鎸夊瓧姣嶆帓搴忥紝杩欓噷鎸夊師濮嬮『搴忥級
- return 0;
- });
- console.log(this.procureddata, "椤哄簭");
+ this.sortOrganRows(this.procureddata);
this.tableKey += 1; // 鏀瑰彉 key 杩娇琛ㄦ牸閲嶆柊娓叉煋
- // 浣犲彲浠ヤ娇鐢� this.$forceUpdate() 鎴栬�呴噸鏂拌祴鍊兼暟缁勬潵瑙﹀彂鏇存柊
this.procureddata = [...this.procureddata];
this.$nextTick(() => {
this.isSorting = false;
@@ -3922,33 +3940,10 @@
});
},
allocateddataSort() {
- console.log("璋冪敤");
-
// 1. 鍔犻攣锛岄樆姝㈢洃鍚櫒鎵ц
this.isSorting = true;
- // 鑷畾涔夋帓搴忓嚱鏁�
- this.allocateddata.sort((a, b) => {
- const indexA = this.organOrder.indexOf(a.organname);
- const indexB = this.organOrder.indexOf(b.organname);
-
- // 濡傛灉涓や釜閮藉湪鍒楄〃涓紝鎸夊垪琛ㄤ腑鐨勯『搴忔帓搴�
- if (indexA !== -1 && indexB !== -1) {
- return indexA - indexB;
- }
- // 濡傛灉 a 鍦ㄥ垪琛ㄤ腑锛宐 涓嶅湪锛宎 鎺掑墠闈�
- if (indexA !== -1) {
- return -1;
- }
- // 濡傛灉 b 鍦ㄥ垪琛ㄤ腑锛宎 涓嶅湪锛宐 鎺掑墠闈�
- if (indexB !== -1) {
- return 1;
- }
- // 涓や釜閮戒笉鍦ㄥ垪琛ㄤ腑锛屼繚鎸佸師椤哄簭锛堟垨鎸夊叾浠栬鍒欙紝姣斿鎸夊瓧姣嶆帓搴忥紝杩欓噷鎸夊師濮嬮『搴忥級
- return 0;
- });
- console.log(this.allocateddata, "椤哄簭");
+ this.sortOrganRows(this.allocateddata);
this.tableKey += 1; // 鏀瑰彉 key 杩娇琛ㄦ牸閲嶆柊娓叉煋
- // 浣犲彲浠ヤ娇鐢� this.$forceUpdate() 鎴栬�呴噸鏂拌祴鍊兼暟缁勬潵瑙﹀彂鏇存柊
this.allocateddata = [...this.allocateddata];
this.$nextTick(() => {
this.isSorting = false;
@@ -4028,6 +4023,8 @@
this.allocateddata.push({
organname: temporganname,
organno: value,
+ // 2026-10-23锛氬啓鍏ュ櫒瀹樻帓闃熷簭鍙凤紙瀛楀吀 dict_sort锛�
+ sort: this.getOrganSort(value),
id: null,
infoid: this.infoid,
donorno: this.form.donorno,
@@ -4098,6 +4095,8 @@
this.procureddata.push({
organname: temporganname,
organno: value,
+ // 2026-10-23锛氬啓鍏ュ櫒瀹樻帓闃熷簭鍙凤紙瀛楀吀 dict_sort锛�
+ sort: this.getOrganSort(value),
id: null,
infoid: this.infoid,
donorno: this.form.donorno,
@@ -4174,12 +4173,17 @@
this.transplantdata.push({
organname: temporganname,
organno: value,
+ // 2026-10-23锛氬啓鍏ュ櫒瀹樻帓闃熷簭鍙凤紙瀛楀吀 dict_sort锛�
+ sort: this.getOrganSort(value),
id: null,
infoid: this.infoid,
donorno: this.form.donorno,
organstate: 1,
transplantstate: 1
});
+ // 2026-10-23锛氬畬鎴愮櫥璁板師鍏堟病鏈� watch锛屾柊澧炲櫒瀹樹細鍋滃湪琛ㄦ牸鏈�鍚庯紱
+ // 杩欓噷绔嬪嵆鎸夋帓闃熷簭鍙峰綊浣嶏紙鍘熷湴鎺掑簭鍚庡繀椤婚噸鏂拌祴鍊硷紝鍚﹀垯琛ㄦ牸涓嶉噸娓叉煋锛�
+ this.transplantdata = this.sortOrganRows([...this.transplantdata]);
}
} else {
this.$modal.msgWarning("璇ュ櫒瀹樺凡缁忛�夋嫨锛岃鍕块噸澶嶉�夋嫨锛�");
@@ -4279,14 +4283,8 @@
},
// 鑾峰彇璇锋眰澶�
Getnetworkheader() {
- let string = window.location.href;
- if (string.includes("9091")) {
- const index = string.indexOf("9091");
- this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
- } else {
- const index = string.indexOf("8032");
- this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
- }
+ // 浠ュ綋鍓嶉〉闈� origin 涓哄噯锛屽吋瀹� 80/8032/9091 鍙婂悗缁鍙h皟鏁�
+ this.Networkheader = window.location.origin;
},
// 鑾峰彇闄勪欢鏁版嵁骞跺垎绫讳簩绾у垪
@@ -4334,7 +4332,7 @@
const config = {
headers: { Authorization: "Bearer " + this.ICDtoken }
};
- const pdfimg = this.Networkheader + "/prod-api" + response.fileName;
+ const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + response.fileName;
console.log(this.Networkheader);
//鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
if (response.code == 200) {
@@ -4395,7 +4393,7 @@
this.pdfVisible = true;
if (this.annexfilesList.length) {
this.annexfilesList.forEach((value, indexson) => {
- const pdfimg = this.Networkheader + "/prod-api" + value.annexurl;
+ const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.annexurl;
fetch(pdfimg, config)
.then(response => response.blob())
.then(blob => {
@@ -4430,18 +4428,13 @@
console.log(item, "鐐瑰嚮鏂囦欢鎷縤tem");
this.pdftitle =
"鍏�" + this.donatelist.length + "椤癸紝褰撳墠閫変腑" + item.annexname;
- let name = item.annexname.split(".");
- if (name[1] == "pdf") {
- this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
- this.previewpdf = false;
- this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
- } else if (name[1] == "jpg" || "png") {
- this.previewpdf = true;
- if (item.annexurl) {
- this.pdfimg = item.annexurl;
- } else {
- this.pdfimg = "";
- }
+ const ext = String(item.annexname || "pdf").toLowerCase().split(".").pop();
+ if (ext === "pdf") {
+ this.$previewFile([{ name: item.annexname, url: item.annexurl }]);
+ return;
+ } else if (["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(ext)) {
+ this.$previewFile([{ name: item.annexname, url: item.annexurl }]);
+ return;
} else {
this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
--
Gitblit v1.9.3