From 1c678c6fc8bbb7974ceb57d95c96e3ed2f4c2676 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期五, 01 九月 2023 16:45:30 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/opo-web
---
src/views/project/travelexpenseapply/travelexpensedetail/index.vue | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 167 insertions(+), 8 deletions(-)
diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index c9090c5..9670383 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -960,14 +960,32 @@
<div v-if="this.previewpdf" class="pdfimgmin">
<!-- <img :src="pdfimg" /> -->
<el-image
- style="width: 100px; height: 100px"
+ style="width: 95%; height: 90%"
:src="pdfimg"
:preview-src-list="pdfimgsrcList"
>
+ <!-- <div slot="error" class="image-slot">
+ <i class="el-icon-picture-outline"></i>
+ </div> -->
</el-image>
</div>
<div v-else class="pdfimgmins">{{ hintitle }}</div>
</div>
+ </el-dialog>
+ <el-dialog title="鎻愮ず" :visible.sync="Savereminder" width="30%">
+ <el-alert
+ :title="
+ '鎮ㄥ凡娣诲姞' +
+ totalquantity +
+ '鏉℃暟鎹紝涓洪槻姝㈡暟鎹涪澶辨槸鍚︽彁浜や繚瀛樺啀缁х画娣诲姞銆�'
+ "
+ type="warning"
+ >
+ </el-alert>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="unsave">鍙� 娑�</el-button>
+ <el-button type="primary" @click="Savenow">纭� 瀹�</el-button>
+ </span>
</el-dialog>
</div>
</template>
@@ -1054,6 +1072,9 @@
label: ""
},
pdfimgsrcList: [],
+ Savereminder: false, //鎻愰啋淇濆瓨寮规
+ Reminderquantity: 0, //鎻愰啋鏁伴噺
+ totalquantity: 0, //鎬绘暟閲�
hintitle: "閫変腑宸︿晶宸蹭笂浼犳枃浠堕瑙堟煡鐪�",
atpresent: "",
@@ -1071,6 +1092,8 @@
loading: true,
// 瀵煎嚭閬僵灞�
exportLoading: false,
+ // 缃戠粶璇锋眰澶�
+ Networkheader: null,
// 褰撳墠鍗曟嵁ID
curId: 0,
@@ -1165,6 +1188,8 @@
},
created() {
+ this.Getnetworkheader();
+
//鑾峰彇璁板綍鍒楄〃
// this.getList();
@@ -1222,7 +1247,20 @@
methods: {
handleUploadError() {},
-
+ // 鑾峰彇璇锋眰澶�
+ Getnetworkheader() {
+ console.log(window.location.href);
+ let string = window.location.href;
+ if (string.includes("9091")) {
+ const index = string.indexOf("9091");
+ this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
+ console.log(this.Networkheader);
+ } else {
+ const index = string.indexOf("8032");
+ this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
+ console.log(this.Networkheader);
+ }
+ },
remove(file, fileList) {
const rbDetails = [...this.rbDetails];
this.fileListto.splice(this.fileListto.indexOf(file), 1);
@@ -1236,13 +1274,19 @@
//鏂囦欢涓婁紶鎴愬姛鍥炶皟
uploadSccess(response, file, fileList) {
this.rbDetails;
-
//鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
if (response.code == 200) {
this.form.filename = file.raw.name;
this.$modal.msgSuccess(response.msg);
- this.fileListto.push({ name: file.name, url: response.url });
+ this.fileListto.push({
+ name: file.name,
+ url: response.fileName
+ });
+ // this.fileListto.push({
+ // name: file.name,
+ // url: response.url
+ // });
this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
} else {
console.log(response.msg);
@@ -1252,8 +1296,14 @@
Filepopup(index, rows, row) {
this.atpresent = index;
this.pdfVisible = true;
+ console.log(this.rbDetails[index]);
if (this.rbDetails[index].annexfilesList) {
this.fileListto = this.rbDetails[index].annexfilesList;
+ console.log(this.fileListto);
+ this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url;
+ console.log(this.pdfimg);
+ this.pdfimgsrcList = [];
+ this.pdfimgsrcList.push(this.pdfimg);
} else {
this.fileListto = [];
this.pdfimg = "";
@@ -1273,11 +1323,12 @@
} else if (name[1] == "jpg" || "png") {
this.previewpdf = true;
if (item.url) {
- this.pdfimg = item.url;
- this.pdfimgsrcList=[]
- this.pdfimgsrcList.push(item.url);
+ this.pdfimg = this.Networkheader + "/prod-api" + item.url;
+ this.pdfimgsrcList = [];
+ this.pdfimgsrcList.push(this.pdfimg);
+ console.log(this.pdfimg);
} else {
- this.pdfimg = item.response.url;
+ this.pdfimg = this.Networkheader + "/prod-api" + item.response.url;
}
} else {
this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
@@ -1578,6 +1629,7 @@
this.loading = true;
listReimbursement(this.queryParams).then(response => {
this.reimbursementList = response.rows;
+ console.log(this.reimbursementList);
this.total = response.total;
this.loading = false;
});
@@ -1717,6 +1769,7 @@
//鑾峰彇鎶ラ攢鏄庣粏淇℃伅
getReimbursementdetaillist(curId).then(res => {
this.rbDetails = res.data;
+ console.log(this.rbDetails);
if (this.rbDetails.length == 0) {
this.addDetailRow(0);
}
@@ -2094,6 +2147,100 @@
})
.catch(() => {});
},
+ // 鍙栨秷鎻愰啋
+ unsave() {
+ this.Savereminder = false;
+ this.Reminderquantity = 0;
+ },
+ // 鎺ュ彈鎻愰啋绔嬪埢淇濆瓨
+ Savenow() {
+ this.Savereminder = false;
+ this.Reminderquantity = 0;
+ this.totalquantity = 0;
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ //绁ㄦ嵁鏂囦欢澶勭悊
+ let list = this.fileListto;
+ console.log(list);
+
+ //鏍¢獙璇锋閲戦鍚堣鏄惁绛変簬鎶ラ攢鍗曢噾棰�
+ if (
+ this.form.amountrequested !=
+ this.rbPayees.reduce(
+ (amount, item) => amount + Number(item.amount),
+ 0.0
+ )
+ ) {
+ this.$message({
+ message:
+ "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛�",
+ type: "warning"
+ });
+ return;
+ }
+
+ const rbDetails = [...this.rbDetails];
+ const rbPayees = [...this.rbPayees];
+ if (this.form.id != null) {
+ console.log(this.form);
+ updateReimbursement(this.form);
+ // .then(res => {
+ //淇濆瓨鏄庣粏
+ for (let i = 0; i < rbDetails.length; i++) {
+ if (rbDetails[i].rbid != null) {
+ updateReimbursementdetail(rbDetails[i]);
+ } else {
+ //rbid鍏宠仈涓昏〃Id
+ rbDetails[i].rbid = this.form.id;
+ addReimbursementdetail(rbDetails[i]);
+ }
+ }
+
+ //淇濆瓨璐︽埛
+ for (let i = 0; i < rbPayees.length; i++) {
+ if (rbPayees[i].rbid != null) {
+ updateReimbursementpayee(rbPayees[i]);
+ } else {
+ //rbid鍏宠仈涓昏〃Id
+ rbPayees[i].rbid = this.form.id;
+ addReimbursementpayee(rbPayees[i]);
+ }
+ }
+
+ this.$modal.msgSuccess("淇敼鎶ラ攢鍗曚繚瀛樻垚鍔�!");
+
+ // this.getList();
+ // })
+ // .catch(err => {
+ // this.$modal.msgError("淇敼鎶ラ攢鍗曚繚瀛樺け璐ワ紒");
+ // });
+ } else {
+ this.form.recordstatus = -1;
+ addReimbursement(this.form)
+ .then(response => {
+ //淇濆瓨鏄庣粏
+ for (let i = 0; i < rbDetails.length; i++) {
+ //rbid鍏宠仈涓昏〃Id
+ rbDetails[i].rbid = response.data;
+ addReimbursementdetail(rbDetails[i]);
+ }
+
+ //淇濆瓨璐﹀彿
+ for (let i = 0; i < rbPayees.length; i++) {
+ //rbid鍏宠仈涓昏〃Id
+ rbPayees[i].rbid = response.data;
+ addReimbursementpayee(rbPayees[i]);
+ }
+
+ this.$modal.msgSuccess("鏂板鎶ラ攢鍗曚繚瀛樻垚鍔�!");
+ })
+ .catch(err => {
+ this.$modal.msgError("鏂板鎶ラ攢鍗曚繚瀛樺け璐ワ紒");
+ });
+ }
+ }
+ });
+ },
//鏂板涓�琛�
addDetailRow(rowIndex) {
@@ -2137,11 +2284,17 @@
personname: null,
destination: null
};
+ if (this.Reminderquantity >= 5) {
+ this.Savereminder = true;
+ return;
+ }
if (rowIndex == undefined || rowIndex == null || rowIndex < 0) {
this.rbDetails.push(rowData);
} else {
this.rbDetails.splice(rowIndex + 1, 0, rowData);
}
+ this.Reminderquantity++;
+ this.totalquantity++;
for (let i = 0; i < this.rbDetails.length; i++) {
this.rbDetails[i].orderno = i + 1;
}
@@ -2160,11 +2313,17 @@
personname: null,
amount: null
};
+ if (this.Reminderquantity >= 5) {
+ this.Savereminder = true;
+ return;
+ }
if (rowIndex == undefined || rowIndex == null || rowIndex <= 0) {
this.rbPayees.push(rowData);
} else {
this.rbPayees.splice(rowIndex + 1, 0, rowData);
}
+ this.Reminderquantity++;
+ this.totalquantity++;
for (let i = 0; i < this.rbPayees.length; i++) {
this.rbPayees[i].orderno = i + 1;
}
--
Gitblit v1.9.3