From d21d7dd23f15a0ca395a4c9d1b3bb31330ff56c0 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期三, 30 九月 2026 11:27:37 +0800
Subject: [PATCH] 专家费校验
---
src/views/project/fund/applyDetail/index.vue | 598 ++++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 407 insertions(+), 191 deletions(-)
diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index 8f7e001..89b17e7 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -229,8 +229,9 @@
v-if="businessType == '1' || businessType == '2'">
<template slot-scope="scope">
<el-form-item label-width="0">
- <el-input :disabled="userprofile.nickName != '闄堟厱鍗�'" v-model.number="scope.row.idcardno"
- @input="tableParValueChange1(scope.row)" placeholder="韬唤璇佸彿" />
+ <el-input :disabled="userprofile.nickName != '闄堟厱鍗�' || scope.row.isunit == 1"
+ :placeholder="scope.row.isunit == 1 ? '鍗曚綅鏃犻渶濉啓' : '韬唤璇佸彿'"
+ v-model.number="scope.row.idcardno" @input="tableParValueChange1(scope.row)" />
</el-form-item>
</template>
</el-table-column>
@@ -690,13 +691,19 @@
</el-dialog>
<!-- 鎵归噺閫夊彇 -->
- <el-dialog title="鎵归噺鐢熸垚鏄庣粏淇℃伅" :visible.sync="batchdialogVisible" width="30%">
+ <el-dialog title="鎵归噺鐢熸垚鏄庣粏淇℃伅" :visible.sync="batchdialogVisible" width="35%">
+ <div style="margin-bottom: 12px">
+ <el-input v-model="personKeyword" clearable size="small" prefix-icon="el-icon-search"
+ placeholder="杈撳叆 濮撳悕 / 鍗曚綅 / 宸ュ彿 / 韬唤璇佸悗4浣� 绛涙煡" style="width: 330px" />
+ <span style="margin-left: 10px; color: #909399; font-size: 12px">鍏� {{ filteredCityOptions.length }} 浜�</span>
+ </div>
<div style="max-height: 300px; overflow-y: auto">
- <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ��</el-checkbox>
+ <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ�夛紙褰撳墠绛涙煡缁撴灉锛�</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
- <el-checkbox border v-for="city in cityOptions" :label="city" :key="city.reportNo">{{ city.reportName
- }}</el-checkbox>
+ <el-checkbox border v-for="city in filteredCityOptions" :label="city"
+ :key="city.reportNo + '_' + city.reportName">{{ city.reportName
+ }}{{ city.unitname ? " 路 " + city.unitname : "" }}</el-checkbox>
</el-checkbox-group>
</div>
@@ -736,6 +743,7 @@
addorupdateFund,
ManualCalculation,
getdetailsByItemId,
+ validateExpertFee,
listbypower
} from "@/api/project/fund";
@@ -882,6 +890,8 @@
// 缃戠粶璇锋眰澶�
Networkheader: null,
batchdialogVisible: false,
+ //鎵归噺褰曞叆寮规鐨勭瓫鏌ュ叧閿瓧
+ personKeyword: "",
itemlist: [],
cityOptions: [],
checkAll: false,
@@ -964,7 +974,19 @@
],
unitTaxNo: [{ required: true, message: "璇疯緭鍏ョ◣鍙�", trigger: "blur" }],
idcardno: [
- { required: true, message: '璇疯緭鍏ヨ韩浠借瘉鍙�', trigger: 'blur' },
+ {
+ // 璐︽埛绫诲瀷閫夋嫨"鍗曚綅鏈烘瀯"鏃朵笉闇�瑕佽韩浠借瘉鍙�
+ validator: (rule, value, callback) => {
+ if (this.hasUserType(this.accountselectform.usertype, "org")) {
+ return callback();
+ }
+ if (!value || !String(value).trim()) {
+ return callback(new Error("璇疯緭鍏ヨ韩浠借瘉鍙�"));
+ }
+ return callback();
+ },
+ trigger: "blur"
+ },
// 娣诲姞鑷畾涔夋牎楠岃鍒�
{ validator: validateIdCard, trigger: 'blur' }
],
@@ -1126,7 +1148,16 @@
},
//鐩戝惉灞炴�� 绫讳技浜巇ata姒傚康
- computed: {},
+ computed: {
+ //鎵归噺褰曞叆寮规锛氭寜鍏抽敭瀛楋紙濮撳悕/鍗曚綅/宸ュ彿/韬唤璇佸悗4浣嶏級绛涙煡鍚庣殑鍊欓�変汉
+ filteredCityOptions() {
+ const kw = (this.personKeyword || "").trim().toLowerCase();
+ if (!kw) {
+ return this.cityOptions;
+ }
+ return this.cityOptions.filter(item => this.personMatchKeyword(item, kw));
+ }
+ },
//鐩戞帶data涓殑鏁版嵁鍙樺寲
watch: {},
//鏂规硶闆嗗悎
@@ -1539,6 +1570,31 @@
if (valid) {
this.formData = this.form;
+ // 涓撳鍔冲姟璐逛笓鐢細9 鏉¤垂鐢ㄦ帶鍒惰鍒欐牎楠岋紙鏍¢獙涓嶉�氳繃涓嶅厑璁镐繚瀛橈級
+ if (this.businessType == "1") {
+ this.$modal.loading("姝e湪鏍¢獙涓撳鍔冲姟璐圭敤锛岃绋嶅�欙紒");
+ this.checkExpertFeeRules("淇濆瓨").then((allowed) => {
+ this.$modal.closeLoading();
+ if (allowed) {
+ this.doSubmitForm();
+ }
+ });
+ return;
+ }
+
+ this.doSubmitForm();
+ }
+ });
+ }, 500),
+
+ /**
+ * 淇濆瓨鐢宠鍗曠殑瀹為檯钀藉簱閫昏緫銆�
+ *
+ * 浠� submitForm 涓媶鍑猴紝渚夸簬鍦ㄤ笓瀹跺姵鍔¤垂瑙勫垯鏍¢獙閫氳繃鍚庡啀鎵ц锛�
+ * 鍏朵粬涓氬姟绫诲瀷鐢� submitForm 鐩存帴璋冪敤锛岃涓轰笌鎷嗗垎鍓嶄竴鑷淬��
+ */
+ doSubmitForm() {
+
//淇濆瓨鍓嶆牎楠屾暟鎹�
for (let k = 0; k < this.rbDetails.length; k++) {
let tempDetail = this.rbDetails[k];
@@ -1736,9 +1792,84 @@
//鍏抽棴绐楀彛
this.loading = false;
// this.getfundList();
- }
+ },
+
+ /**
+ * 涓撳鍔冲姟璐� 9 鏉¤垂鐢ㄦ帶鍒惰鍒欐牎楠岋紙鎻愪氦鍓嶆嫤鎴級銆�
+ *
+ * 閫傜敤鑼冨洿锛歜usinessType === '1'锛堜笓瀹跺姵鍔¤垂鐢宠鍗曪級锛屼笌鍚庣 applytype === '1' 瀵瑰簲銆�
+ * 鍏朵粬涓氬姟绫诲瀷锛堜鸡鐞嗕笓瀹惰垂銆佸尰瀛︽垚鏈�佸姙鍏垂鐢級涓嶆牎楠岋紝鐩存帴鏀捐銆�
+ *
+ * 鏍¢獙鍙e緞锛堝悓涓�鎹愮尞妗堜緥 infoid 涓嬬疮璁★級鐢卞悗绔粺涓�瀹炵幇锛�
+ * errors 闃绘柇鍨嬶細鎻愮ず杩濆弽鐨勫叿浣撹鍒欙紝涓嶅厑璁哥户缁繚瀛�/瀹℃牳
+ * warnings 鎻愮ず鍨嬶細浠呮彁閱掔粡鍔炰汉澶勭悊锛堣鍒� 5銆�6锛夛紝闇�浜屾纭鍚庢墠缁х画
+ *
+ * @param {string} action 褰撳墠鍔ㄤ綔锛岀敤浜庢嫾鎺ユ彁绀烘枃妗堬紙濡傗�滀繚瀛樷�濃�滄彁浜ゅ鏍糕�濓級
+ * @returns {Promise<boolean>} true 鍏佽缁х画锛宖alse 闃绘缁х画
+ */
+ checkExpertFeeRules(action) {
+ if (this.businessType != "1") {
+ return Promise.resolve(true);
+ }
+ // 鍚庣鎸夈�屾渚嬪唴宸叉湁鍗曟嵁 + 鏈鎻愪氦鏄庣粏銆嶅悎骞惰绠楋紝纭繚灏氭湭钀藉簱鐨勬槑缁嗕篃鍙備笌鏍¢獙
+ const payload = Object.assign({}, this.form, {
+ applytype: this.form.applytype || "1",
+ serviceFunddetails: this.rbDetails,
});
- }, 500),
+ // 鎺掓煡鐢細鑳界洿鎺ヤ粠鎺у埗鍙扮湅鍒板埌搴曢�佷簡浠�涔堬紝浠ュ強鍚庣鍒ゅ畾浜嗕粈涔�
+ console.log("[涓撳璐规牎楠宂 鎻愪氦鏍¢獙", action, {
+ businessType: this.businessType,
+ applytype: payload.applytype,
+ infoid: payload.infoid,
+ fundId: payload.id,
+ 鏄庣粏: (this.rbDetails || []).map((d) => ({
+ itemid: d.itemid,
+ amount: d.amount,
+ taxedamount: d.taxedamount,
+ 鍦烘櫙: d.servicesscopename,
+ })),
+ });
+
+ return validateExpertFee(payload)
+ .then((res) => {
+ const errors = (res && res.errors) || [];
+ const warnings = (res && res.warnings) || [];
+ console.log("[涓撳璐规牎楠宂 鍚庣杩斿洖", { errors, warnings });
+
+ // 1) 闃绘柇鍨嬶細鍒楀嚭杩濆弽鐨勫叿浣撹鍒欙紝涓嶅厑璁哥户缁�
+ // 鐢ㄥ脊绐楄�岄潪杞绘彁绀猴細閿欒鍙兘鏈夊鏉★紝杞绘彁绀轰細鎸ゆ垚涓�琛屼笖寰堝揩娑堝け
+ if (errors.length > 0) {
+ this.$modal.alertError(
+ "涓撳鍔冲姟璐圭敤涓嶇鍚堜互涓嬭瀹氾紝鏃犳硶" +
+ action +
+ "锛歕n\n" +
+ errors.map((msg, i) => i + 1 + ". " + msg).join("\n\n")
+ );
+ return false;
+ }
+
+ // 2) 鎻愮ず鍨嬶細闇�缁忓姙浜虹‘璁ゅ悗鎵嶈兘缁х画锛堝綋鍓嶈鍒� 5銆�6 宸叉敼涓虹‖鎷︽埅锛屾鍒嗘敮淇濈暀澶囩敤锛�
+ if (warnings.length > 0) {
+ const confirmText =
+ "涓撳鍔冲姟璐圭敤瀛樺湪浠ヤ笅闂锛岃纭鏄惁缁х画" +
+ action +
+ "锛焅n\n" +
+ warnings.map((msg, i) => i + 1 + ". " + msg).join("\n\n");
+ return this.$modal
+ .confirm(confirmText)
+ .then(() => true)
+ .catch(() => false);
+ }
+
+ return true;
+ })
+ .catch((err) => {
+ // 鎺ュ彛寮傚父鏃舵寜鈥滀笉闃绘柇鈥濆鐞嗭紝閬垮厤鏍¢獙鏈嶅姟涓嶅彲鐢ㄥ鑷村畬鍏ㄦ棤娉曟姤閿�锛�
+ // 鍚庣 addOrUpdateNew / checkFund 浠嶆湁鍚屾牱鐨勭‖鎷︽埅鍏滃簳銆�
+ console.error("涓撳鍔冲姟璐硅鍒欐牎楠屾帴鍙h皟鐢ㄥけ璐�", err);
+ return true;
+ });
+ },
checksubmit() {
//妫�鏌ユ槸鍚︽敹鍒扮焊璐ㄦ潗鏂�
@@ -1770,8 +1901,19 @@
return;
}
- this.Savenow();
- console.log("淇濆瓨骞跺鎵�");
+ // 涓撳鍔冲姟璐逛笓鐢細9 鏉¤垂鐢ㄦ帶鍒惰鍒欐牎楠岋紙浠呭鏍搁�氳繃鏃舵嫤鎴級
+ const needExpertFeeCheck = this.checkObj.flowlevelone == 1;
+ const expertFeePromise = needExpertFeeCheck
+ ? this.checkExpertFeeRules("鎻愪氦瀹℃牳")
+ : Promise.resolve(true);
+
+ expertFeePromise.then((allowed) => {
+ if (!allowed) {
+ return;
+ }
+ this.Savenow();
+ console.log("淇濆瓨骞跺鎵�");
+ });
},
// 杩炵画瀹℃壒锛氳幏鍙栧綋鍓嶄笟鍔$被鍨嬩笅鐨勫緟瀹℃壒鍒楄〃
@@ -1880,6 +2022,19 @@
});
},
+ /** 浜哄憳绫诲瀷锛堝鍊硷紝閫楀彿鍒嗛殧锛夋槸鍚﹀寘鍚寚瀹氱被鍨嬶紱org = 鍗曚綅鏈烘瀯 */
+ hasUserType(usertype, code) {
+ if (!usertype) {
+ return false;
+ }
+ return (
+ String(usertype)
+ .split(",")
+ .map(t => t.trim())
+ .indexOf(code) > -1
+ );
+ },
+ /** 鍙楃泭浜�/璐︽埛鏄惁涓�"鍗曚綅"锛堜汉鍛樼被鍨嬪惈 org锛� */
//鑾峰彇涓撳銆佸崟浣嶆満鏋勭殑璐︽埛鍒楄〃
getAccountList() {
listExternalperson().then(res => {
@@ -1888,7 +2043,7 @@
for (let j = 0; j < res.rows.length; j++) {
//鍗曚綅璐﹀彿鍒楄〃
if (res.rows[j].userstatus == "1") {
- if (res.rows[j].usertype == "org") {
+ if (this.hasUserType(res.rows[j].usertype, "org")) {
this.accountlist.push({
id: res.rows[j].id,
userno: res.rows[j].userno,
@@ -1899,6 +2054,7 @@
bankcardno: res.rows[j].bankcardno,
unitno: res.rows[j].unitno,
unitname: res.rows[j].unitname,
+ usertype: res.rows[j].usertype,
userid:
res.rows[j].username + "锛�" + res.rows[j].bankcardno + "锛�"
});
@@ -1913,6 +2069,7 @@
bankcardno: res.rows[j].bankcardno,
unitno: res.rows[j].unitno,
unitname: res.rows[j].unitname,
+ usertype: res.rows[j].usertype,
userid:
res.rows[j].username + "锛�" + res.rows[j].idcardno + "锛�"
});
@@ -2193,192 +2350,202 @@
this.Savereminder = false;
this.Reminderquantity = 0;
this.totalquantity = 0;
- this.$refs["form"].validate(valid => {
- if (valid) {
- this.formData = this.form;
- //淇濆瓨鍓嶆牎楠屾暟鎹�
- for (let k = 0; k < this.rbDetails.length; k++) {
- let tempDetail = this.rbDetails[k];
- if (tempDetail.itemid == null) {
- this.$modal.msgWarning(
- "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
- (k + 1).toString() +
- "琛岀殑鏈嶅姟椤圭洰鏈�夋嫨锛岃鍏堥�夋嫨鏈嶅姟椤圭洰鍚庡啀鎻愪氦淇濆瓨锛�"
- );
- return;
- }
-
- if (this.businessType == "1") {
- if (tempDetail.servicesscope == null) {
- this.$modal.msgWarning(
- "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
- (k + 1).toString() +
- "琛岀殑璐圭敤璇存槑鏈�夋嫨,璇烽�夋嫨璐圭敤璇存槑鍚庡啀鎻愪氦淇濆瓨锛�"
- );
- return;
- }
-
- if (tempDetail.beneficiaryno == null) {
- this.$modal.msgWarning(
- "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
- (k + 1).toString() +
- "琛岀殑浜哄憳濮撳悕涓虹┖,璇烽�夋嫨浜哄憳鍚庡啀鎻愪氦淇濆瓨锛�"
- );
- return;
- }
- if (tempDetail.unitname == null) {
- this.$modal.msgWarning(
- "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
- (k + 1).toString() +
- "琛岀殑涓撳鍗曚綅涓虹┖,璇烽�夋嫨鍗曚綅鍚庡啀鎻愪氦淇濆瓨锛�"
- );
- return;
- }
- }
- }
-
- //澶勭悊鏄庣粏
- for (let i = 0; i < this.rbDetails.length; i++) {
- let tempDetail = this.rbDetails[i];
- //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
- let tempitemlist = tempDetail.itemlist;
- let itemIndex = tempitemlist.findIndex(
- item => tempDetail.itemid == item.id
- );
- if (itemIndex > -1) {
- tempDetail.itemname = tempitemlist[itemIndex].itemName;
- tempDetail.itemid = tempitemlist[itemIndex].id;
- }
-
- //鑾峰彇applytypename銆佹湇鍔¤垂鐢ㄥぇ绫�
- let applytypeIndex = this.rowfeeItemTypes.findIndex(
- item => tempDetail.applytype == item.value
- );
- if (applytypeIndex > -1) {
- tempDetail.applytypename = this.rowfeeItemTypes[
- applytypeIndex
- ].label;
- tempDetail.subjecttype = this.rowfeeItemTypes[
- applytypeIndex
- ].subjecttype;
- tempDetail.subjecttypename = this.rowfeeItemTypes[
- applytypeIndex
- ].subjecttypename;
- }
- this.rbDetails[i] = tempDetail;
- }
- //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佹墸绋庨噾棰濓紙taxamount锛夈�佺◣鍚庨噾棰濓紙taxedamount锛�
- if (this.businessType == "2") {
- for (let j = 0; j < this.rbDetails.length; j++) {
- let tempDetail = this.rbDetails[j];
- if (
- isNaN(parseFloat(tempDetail.amount)) ||
- moneyRound(tempDetail.amount) == 0
- ) {
- this.$modal.msgWarning(
- "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
- (j + 1).toString() +
- "琛岀殑閲戦鏈緭鍏ワ紝璇峰厛杈撳叆閲戦鍚庡啀鎻愪氦淇濆瓨锛�"
- );
- return;
- }
- }
- } else if (this.businessType == "3" || this.businessType == "4") {
- for (let j = 0; j < this.rbDetails.length; j++) {
- let tempDetail = this.rbDetails[j];
- if (
- isNaN(parseFloat(tempDetail.amount)) ||
- moneyRound(tempDetail.amount) == 0
- ) {
- this.$modal.msgWarning(
- "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
- (j + 1).toString() +
- "琛岀殑閲戦鏈緭鍏ワ紝璇峰厛杈撳叆閲戦鍚庡啀鎻愪氦淇濆瓨锛�"
- );
- return;
- }
- if (
- isNaN(parseFloat(tempDetail.taxamount)) ||
- moneyRound(tempDetail.taxamount) == 0
- ) {
- tempDetail.taxedamount = parseFloat(tempDetail.amount);
- } else {
- tempDetail.taxedamount =
- parseFloat(tempDetail.amount) +
- parseFloat(tempDetail.taxamount);
- }
- }
- }
-
- //淇濆瓨鏁版嵁
- this.loading = true;
- this.form.serviceFunddetails = 0;
- this.rbDetails.map(item => {
- this.form.serviceFunddetails += item.amount;
- });
- this.form.serviceFunddetails = this.rbDetails;
-
- if (this.form.id != null) {
- } else {
- this.form.recordstatus = -1;
- }
-
- addorupdateFund(this.form).then(response => {
- if (response.code === 200) {
- this.$modal.msgSuccess("鐢宠鍗曚繚瀛樻垚鍔燂紒");
- // 闈炴彁閱掔姸鎬佷笅鎵ц瀹℃壒瑙e喅寮傛璋冪敤寤惰繜闂
- if (!this.Savereminder) {
- let checkFundObj = {
- // fundid: this.checkObj.fundid,
- fundid: this.curId,
- flowconclusion: this.checkObj.flowlevelone,
- flowcontent: this.checkObj.flowconclusion
- };
- this.$modal.loading("姝e湪鎻愪氦瀹℃牳锛岃绋嶅�欙紒");
- checkfund(checkFundObj).then(res => {
- if (res.code == 200) {
- //鍏抽棴绐楀彛
- this.$modal.closeLoading();
- this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
- // 杩炵画瀹℃壒锛氳闂槸鍚︾户缁鎵逛笅涓�鍗�
- this.continueOrExit();
- } else {
- this.$modal.closeLoading();
-
- if (res.msg) {
- this.$modal.msgError("鎿嶄綔澶辫");
- } else {
- this.$modal.msgError(res.msg);
- }
- }
- });
- }
- this.Getnetworkheader();
- this.getroute();
- this.getAccountList();
- this.getUserList();
- this.getUserProfile();
- } else {
- this.$modal.msgError("鐢宠鍗曚繚瀛樺け璐ワ細" + response.msg);
- }
- });
-
- //鍏抽棴绐楀彛
- this.loading = false;
- // this.getfundList();
+ // 涓撳鍔冲姟璐逛笓鐢細9 鏉¤垂鐢ㄦ帶鍒惰鍒欐牎楠岋紙鏍¢獙涓嶉�氳繃涓嶅厑璁歌惤搴擄級
+ this.checkExpertFeeRules("淇濆瓨").then((allowed) => {
+ if (!allowed) {
+ return;
}
+
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ this.formData = this.form;
+
+ //淇濆瓨鍓嶆牎楠屾暟鎹�
+ for (let k = 0; k < this.rbDetails.length; k++) {
+ let tempDetail = this.rbDetails[k];
+ if (tempDetail.itemid == null) {
+ this.$modal.msgWarning(
+ "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
+ (k + 1).toString() +
+ "琛岀殑鏈嶅姟椤圭洰鏈�夋嫨锛岃鍏堥�夋嫨鏈嶅姟椤圭洰鍚庡啀鎻愪氦淇濆瓨锛�"
+ );
+ return;
+ }
+
+ if (this.businessType == "1") {
+ if (tempDetail.servicesscope == null) {
+ this.$modal.msgWarning(
+ "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
+ (k + 1).toString() +
+ "琛岀殑璐圭敤璇存槑鏈�夋嫨,璇烽�夋嫨璐圭敤璇存槑鍚庡啀鎻愪氦淇濆瓨锛�"
+ );
+ return;
+ }
+
+ if (tempDetail.beneficiaryno == null) {
+ this.$modal.msgWarning(
+ "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
+ (k + 1).toString() +
+ "琛岀殑浜哄憳濮撳悕涓虹┖,璇烽�夋嫨浜哄憳鍚庡啀鎻愪氦淇濆瓨锛�"
+ );
+ return;
+ }
+ if (tempDetail.unitname == null) {
+ this.$modal.msgWarning(
+ "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
+ (k + 1).toString() +
+ "琛岀殑涓撳鍗曚綅涓虹┖,璇烽�夋嫨鍗曚綅鍚庡啀鎻愪氦淇濆瓨锛�"
+ );
+ return;
+ }
+ }
+ }
+
+ //澶勭悊鏄庣粏
+ for (let i = 0; i < this.rbDetails.length; i++) {
+ let tempDetail = this.rbDetails[i];
+ //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
+ let tempitemlist = tempDetail.itemlist;
+ let itemIndex = tempitemlist.findIndex(
+ item => tempDetail.itemid == item.id
+ );
+ if (itemIndex > -1) {
+ tempDetail.itemname = tempitemlist[itemIndex].itemName;
+ tempDetail.itemid = tempitemlist[itemIndex].id;
+ }
+
+ //鑾峰彇applytypename銆佹湇鍔¤垂鐢ㄥぇ绫�
+ let applytypeIndex = this.rowfeeItemTypes.findIndex(
+ item => tempDetail.applytype == item.value
+ );
+ if (applytypeIndex > -1) {
+ tempDetail.applytypename = this.rowfeeItemTypes[
+ applytypeIndex
+ ].label;
+ tempDetail.subjecttype = this.rowfeeItemTypes[
+ applytypeIndex
+ ].subjecttype;
+ tempDetail.subjecttypename = this.rowfeeItemTypes[
+ applytypeIndex
+ ].subjecttypename;
+ }
+ this.rbDetails[i] = tempDetail;
+ }
+ //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佹墸绋庨噾棰濓紙taxamount锛夈�佺◣鍚庨噾棰濓紙taxedamount锛�
+ if (this.businessType == "2") {
+ for (let j = 0; j < this.rbDetails.length; j++) {
+ let tempDetail = this.rbDetails[j];
+ if (
+ isNaN(parseFloat(tempDetail.amount)) ||
+ moneyRound(tempDetail.amount) == 0
+ ) {
+ this.$modal.msgWarning(
+ "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
+ (j + 1).toString() +
+ "琛岀殑閲戦鏈緭鍏ワ紝璇峰厛杈撳叆閲戦鍚庡啀鎻愪氦淇濆瓨锛�"
+ );
+ return;
+ }
+ }
+ } else if (this.businessType == "3" || this.businessType == "4") {
+ for (let j = 0; j < this.rbDetails.length; j++) {
+ let tempDetail = this.rbDetails[j];
+ if (
+ isNaN(parseFloat(tempDetail.amount)) ||
+ moneyRound(tempDetail.amount) == 0
+ ) {
+ this.$modal.msgWarning(
+ "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
+ (j + 1).toString() +
+ "琛岀殑閲戦鏈緭鍏ワ紝璇峰厛杈撳叆閲戦鍚庡啀鎻愪氦淇濆瓨锛�"
+ );
+ return;
+ }
+ if (
+ isNaN(parseFloat(tempDetail.taxamount)) ||
+ moneyRound(tempDetail.taxamount) == 0
+ ) {
+ tempDetail.taxedamount = parseFloat(tempDetail.amount);
+ } else {
+ tempDetail.taxedamount =
+ parseFloat(tempDetail.amount) +
+ parseFloat(tempDetail.taxamount);
+ }
+ }
+ }
+
+ //淇濆瓨鏁版嵁
+ this.loading = true;
+ this.form.serviceFunddetails = 0;
+ this.rbDetails.map(item => {
+ this.form.serviceFunddetails += item.amount;
+ });
+ this.form.serviceFunddetails = this.rbDetails;
+
+ if (this.form.id != null) {
+ } else {
+ this.form.recordstatus = -1;
+ }
+
+ addorupdateFund(this.form).then(response => {
+ if (response.code === 200) {
+ this.$modal.msgSuccess("鐢宠鍗曚繚瀛樻垚鍔燂紒");
+ // 闈炴彁閱掔姸鎬佷笅鎵ц瀹℃壒瑙e喅寮傛璋冪敤寤惰繜闂
+ if (!this.Savereminder) {
+ let checkFundObj = {
+ // fundid: this.checkObj.fundid,
+ fundid: this.curId,
+ flowconclusion: this.checkObj.flowlevelone,
+ flowcontent: this.checkObj.flowconclusion
+ };
+ this.$modal.loading("姝e湪鎻愪氦瀹℃牳锛岃绋嶅�欙紒");
+ checkfund(checkFundObj).then(res => {
+ if (res.code == 200) {
+ //鍏抽棴绐楀彛
+ this.$modal.closeLoading();
+ this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
+ // 杩炵画瀹℃壒锛氳闂槸鍚︾户缁鎵逛笅涓�鍗�
+ this.continueOrExit();
+ } else {
+ this.$modal.closeLoading();
+
+ if (res.msg) {
+ this.$modal.msgError("鎿嶄綔澶辫");
+ } else {
+ this.$modal.msgError(res.msg);
+ }
+ }
+ });
+ }
+ this.Getnetworkheader();
+ this.getroute();
+ this.getAccountList();
+ this.getUserList();
+ this.getUserProfile();
+ } else {
+ this.$modal.msgError("鐢宠鍗曚繚瀛樺け璐ワ細" + response.msg);
+ }
+ });
+
+ //鍏抽棴绐楀彛
+ this.loading = false;
+ // this.getfundList();
+ }
+ });
});
},
handleCheckAllChange(val) {
- this.checkedCities = val ? this.cityOptions : [];
+ this.checkedCities = val ? this.filteredCityOptions.slice() : [];
this.isIndeterminate = false;
},
handleCheckedCitiesChange(value) {
let checkedCount = value.length;
- this.checkAll = checkedCount === this.cityOptions.length;
+ this.checkAll =
+ this.filteredCityOptions.length > 0 &&
+ checkedCount === this.filteredCityOptions.length;
this.isIndeterminate =
- checkedCount > 0 && checkedCount < this.cityOptions.length;
+ checkedCount > 0 && checkedCount < this.filteredCityOptions.length;
},
// 鎵嬪姩璁$畻
Manualcalculationfn() {
@@ -2414,19 +2581,57 @@
// 鎵归噺褰曞叆鐐瑰嚮
Batchentry() {
// ethical
+ this.personKeyword = "";
+ this.checkedCities = [];
+ this.checkAll = false;
+ this.isIndeterminate = false;
listReportname("ethical").then(res => {
this.cityOptions = res.data;
});
this.batchdialogVisible = true;
},
+ /** 鎵归噺褰曞叆寮规锛氬鍚�/鍗曚綅/宸ュ彿/韬唤璇佸悗4浣� 鍛戒腑鍒ゆ柇 */
+ personMatchKeyword(item, kw) {
+ const idcard = String(item.idcrad || "");
+ return (
+ String(item.reportName || "")
+ .toLowerCase()
+ .indexOf(kw) > -1 ||
+ String(item.unitname || "")
+ .toLowerCase()
+ .indexOf(kw) > -1 ||
+ String(item.reportNo || "")
+ .toLowerCase()
+ .indexOf(kw) > -1 ||
+ (idcard.length >= 4 && idcard.slice(-4).indexOf(kw) > -1)
+ );
+ },
// 纭褰曞叆
BatchentryFn() {
+ // 鏄庣粏涓凡鏈夌殑浜哄憳濮撳悕锛岀敤浜庨噸澶嶆彁閱�
+ const existed = {};
+ this.rbDetails.forEach(row => {
+ if (row.beneficiaryname) {
+ existed[String(row.beneficiaryname).trim()] = true;
+ }
+ });
+
+ const duplicated = [];
this.checkedCities.forEach(item => {
+ const nameKey = String(item.reportName || "").trim();
+ if (nameKey && existed[nameKey]) {
+ duplicated.push(item.reportName);
+ return;
+ }
+ if (nameKey) {
+ existed[nameKey] = true;
+ }
let rowData = {
orderno: null,
fundid: null,
beneficiaryname: item.reportName,
beneficiaryno: item.reportNo,
+ isunit: 0,
unitname: item.unitname,
unitno: null,
uintuserno: null,
@@ -2471,11 +2676,17 @@
this.rbDetails.push(rowData);
});
- for (let i = 0; i < this.checkedCities.length + 1; i++) {
+ for (let i = 0; i < this.rbDetails.length; i++) {
this.rbDetails[i].orderno = i + 1;
}
this.calculateTax();
this.batchdialogVisible = false;
+ this.checkedCities = [];
+ if (duplicated.length) {
+ this.$modal.msgWarning(
+ "浠ヤ笅浜哄憳鍦ㄦ槑缁嗕腑宸插瓨鍦紝宸茶烦杩囬噸澶嶆坊鍔狅細" + duplicated.join("銆�")
+ );
+ }
},
//鏂板涓�琛�
addRow(rowIndex) {
@@ -2485,6 +2696,7 @@
fundid: null,
beneficiaryname: null,
beneficiaryno: null,
+ isunit: 0,
unitname: null,
itemdescribe: null,
unitno: null,
@@ -3121,11 +3333,13 @@
this.rbDetails[tempIndex].phone = res.telephone;
if (res.usertype == "org") {
+ this.$set(this.rbDetails[tempIndex], "isunit", 1);
this.rbDetails[tempIndex].idcardno = "";
this.rbDetails[tempIndex].title = "";
this.rbDetails[tempIndex].unitno = "";
this.rbDetails[tempIndex].unitname = "";
} else {
+ this.$set(this.rbDetails[tempIndex], "isunit", 0);
this.rbDetails[tempIndex].idcardno = res.idcardno;
this.rbDetails[tempIndex].title = res.title;
this.rbDetails[tempIndex].unitno = parseInt(res.unitno);
@@ -3231,12 +3445,14 @@
this.rbDetails[tempIndex].bankcardno = res.bankcardno;
this.rbDetails[tempIndex].phone = res.telephone;
- if (res.usertype == "org") {
+ if (this.hasUserType(res.usertype, "org")) {
+ this.$set(this.rbDetails[tempIndex], "isunit", 1);
this.rbDetails[tempIndex].idcardno = "";
this.rbDetails[tempIndex].title = "";
this.rbDetails[tempIndex].unitno = "";
this.rbDetails[tempIndex].unitname = "";
} else {
+ this.$set(this.rbDetails[tempIndex], "isunit", 0);
this.rbDetails[tempIndex].idcardno = res.idcardno;
this.rbDetails[tempIndex].title = res.title;
this.rbDetails[tempIndex].unitno = parseInt(res.unitno);
--
Gitblit v1.9.3