From d08414f291cdfc84625e6d34241a56228c958134 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 10 八月 2023 14:12:50 +0800
Subject: [PATCH] yxh
---
src/views/project/travelexpenseslist/Modifydetails/index.vue | 436 ++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 307 insertions(+), 129 deletions(-)
diff --git a/src/views/project/travelexpenseslist/Modifydetails/index.vue b/src/views/project/travelexpenseslist/Modifydetails/index.vue
index 9709834..cd24f2c 100644
--- a/src/views/project/travelexpenseslist/Modifydetails/index.vue
+++ b/src/views/project/travelexpenseslist/Modifydetails/index.vue
@@ -212,7 +212,13 @@
<el-col :span="20">鎶ラ攢鏄庣粏褰曞叆锛�</el-col>
</el-row>
<el-row>
- <el-table :data="rbDetails" border highlight-current-row show-summary>
+ <el-table
+ :data="rbDetails"
+ border
+ highlight-current-row
+ :summary-method="getSummaries"
+ show-summary
+ >
<el-table-column
prop="orderno"
slot=""
@@ -607,13 +613,13 @@
label="鎿嶄綔"
align="center"
width="120"
- v-if="dialogType == 'edit'"
>
<template slot-scope="scope">
<el-button
type="text"
size="mini"
@click="addDetailRow(scope.$index)"
+ v-if="dialogType == 'edit'"
>鏂板</el-button
>
<el-button
@@ -622,18 +628,17 @@
"
type="text"
size="small"
+ v-if="dialogType == 'edit'"
+ >鍒犻櫎</el-button
>
- 鍒犻櫎
- </el-button>
<el-button
@click.native.prevent="
Filepopup(scope.$index, rbDetails, scope.row)
"
type="text"
size="small"
+ >绁ㄦ嵁</el-button
>
- 闄勪欢
- </el-button>
</template>
</el-table-column>
</el-table>
@@ -642,7 +647,13 @@
<el-col :span="20">鎶ラ攢璇锋鏄庣粏锛�</el-col>
</el-row>
<el-row style="margin-top: 30px">
- <el-table :data="rbPayees" border highlight-current-row show-summary>
+ <el-table
+ :data="rbPayees"
+ border
+ highlight-current-row
+ :summary-method="getSummaries"
+ show-summary
+ >
<el-table-column
prop="orderno"
slot=""
@@ -782,33 +793,19 @@
label="璇锋璇存槑"
align="center"
fixed
- width="280"
>
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="璇存槑" />
- </template> </el-table-column
- ><el-table-column
- prop="paiddate"
- slot=""
- label="鎵撴鏃ユ湡"
- fixed
- align="center"
- width="150"
- >
- <template slot-scope="scope">
- <el-date-picker
- clearable
- size="small"
- style="width: 100%"
- v-model="scope.row.paiddate"
- type="date"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="鎵撴鏃ユ湡"
- :disabled="true"
- >
- </el-date-picker>
</template>
</el-table-column>
+ <!--
+ <el-table-column prop="paiddate" slot="" label="鎵撴鏃ユ湡" fixed align="center" width="150">
+ <template slot-scope="scope">
+ <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.paiddate" type="date"
+ value-format="yyyy-MM-dd HH:mm:ss" placeholder="鎵撴鏃ユ湡" :disabled="true">
+ </el-date-picker>
+ </template>
+ </el-table-column>-->
<el-table-column
label="鎿嶄綔"
align="center"
@@ -836,7 +833,7 @@
</el-table>
</el-row>
- <el-row v-if="dialogType == 'detail'">
+ <el-row v-if="dialogType == 'detail' || dialogType == 'check'">
<el-table :data="fundflowList" border>
<el-table-column
label="瀹℃牳浜�"
@@ -869,6 +866,26 @@
/>
</el-table>
</el-row>
+ <el-row
+ style="margin-top: 25px; margin-bottom: 5px"
+ v-if="dialogType == 'check'"
+ >
+ <el-col :span="7">
+ <el-form-item label="瀹℃牳缁撴灉" align="left">
+ <el-radio-group v-model="checkObj.flowlevelone" align="left">
+ <el-radio label="1">閫氳繃</el-radio>
+ <el-radio label="2">涓嶉�氳繃</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row v-if="dialogType == 'check'">
+ <el-col :span="17">
+ <el-form-item label="瀹℃牳澶囨敞" align="left">
+ <el-input v-model="checkObj.flowconclusion" placeholder="澶囨敞" />
+ </el-form-item>
+ </el-col>
+ </el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
@@ -877,7 +894,13 @@
v-if="dialogType == 'edit'"
>淇� 瀛�</el-button
>
- <el-button @click="cancel">鍙� 娑�</el-button>
+ <el-button
+ type="primary"
+ @click="checksubmit"
+ v-if="dialogType == 'check'"
+ >鎻� 浜�</el-button
+ >
+ <!--<el-button @click="cancel">閫� 鍑�</el-button>-->
</div>
</div>
@@ -928,11 +951,6 @@
<div v-else class="pdfimgmins">{{ hintitle }}</div>
</div>
</el-dialog>
-
- <!-- <div class="container">
- <pdf :src="iframeurl"></pdf>
- </div> -->
- <!-- <embed :src="iframeurl" type="application/pdf" width="1000" height="800" /> -->
</div>
</template>
@@ -954,6 +972,7 @@
updateReimbursement,
exportReimbursement,
getdownload,
+ checkfund,
fundSubmit
} from "@/api/project/reimbursement";
import {
@@ -1006,7 +1025,9 @@
//涓嬫媺鍙互閫夋嫨浜哄憳鍒楄〃
personsSel: [],
// 閮ㄩ棬鏍戦�夐」
+
deptOptions: undefined,
+ //绁ㄦ嵁鏂囦欢
pdftitle: "",
pdfimg: "",
pdfVisible: false,
@@ -1014,6 +1035,7 @@
value: 0,
label: ""
},
+
hintitle: "閫変腑宸︿晶宸蹭笂浼犳枃浠堕瑙堟煡鐪�",
atpresent: "",
iframeurl: "",
@@ -1106,19 +1128,34 @@
headers: {
Authorization: "Bearer " + getToken()
- }
+ },
+
+ //瀹℃壒淇℃伅
+ checkObj: {
+ flowlevelone: null,
+ flowconclusion: null,
+ fundid: null
+ },
+
+ //淇濆瓨鎸夐挳鎺у埗
+ idisabled: false
};
},
created() {
//鑾峰彇璁板綍鍒楄〃
- this.getList();
- this.gainee();
+ // this.getList();
+
//鑾峰彇鎶ラ攢涓殑浜哄憳淇℃伅
this.getPersonList();
- },
- mounted() {
+ //鑾峰彇鐧诲綍鑰呬俊鎭�
+ getUserProfile().then(response => {
+ this.defaultperson = response.data;
+ this.standardlevel = response.data.standardlevel;
+ console.log("this.defaultperson", this.defaultperson);
+ });
+
//鑾峰彇鎹愮尞鑰呭鍚�
listDonatebaseinfo().then(res => {
let list = res.rows;
@@ -1136,10 +1173,24 @@
}
});
- //鑾峰彇鐧诲綍鑰呬俊鎭�
- this.getUsermsg();
//鑾峰彇閮ㄩ棬淇℃伅
//this.getTreeselect();
+ },
+
+ mounted() {
+ //閫夋嫨涓氬姟绫诲瀷:1銆佹柊澧烇紱2銆佷慨鏀癸紱3銆佹煡鐪�
+ let ids = this.$route.query.id;
+ let pos = this.$route.query.pos;
+ this.defaultperson = this.$route.query.routerparam;
+ if (pos == 1) {
+ this.handleAdd(ids);
+ } else if (pos == 2) {
+ this.handleUpdate(ids);
+ } else if (pos == 3) {
+ this.handleDetail(ids);
+ } else if (pos == 4) {
+ this.handleCheck(ids);
+ }
},
methods: {
@@ -1148,8 +1199,6 @@
remove(file, fileList) {
const rbDetails = [...this.rbDetails];
this.fileListto.splice(this.fileListto.indexOf(file), 1);
- console.log(file);
- console.log(this.fileListto);
rbDetails[this.atpresent].annexfilesList = this.fileListto;
},
@@ -1159,29 +1208,22 @@
//鏂囦欢涓婁紶鎴愬姛鍥炶皟
uploadSccess(response, file, fileList) {
- console.log(response);
- console.log(file);
- console.log(fileList);
this.rbDetails;
- //鑾峰彇闄勪欢淇℃伅浣嶇疆
+ //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
if (response.code == 200) {
this.form.filename = file.raw.name;
- console.log(this.fileList);
this.$modal.msgSuccess(response.msg);
this.fileListto.push({ name: file.name, url: response.url });
- console.log(this.fileListto);
this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
} else {
- this.$modal.msgError(response.msg);
+ console.log(response.msg);
}
},
- // 鐐瑰嚮鏂囦欢
+ // 鐐瑰嚮绁ㄦ嵁
Filepopup(index, rows, row) {
- console.log(index, rows, row);
this.atpresent = index;
- console.log(this.atpresent);
this.pdfVisible = true;
if (this.rbDetails[index].annexfilesList) {
this.fileListto = this.rbDetails[index].annexfilesList;
@@ -1198,20 +1240,7 @@
this.pdftitle = item.name;
let name = item.name.split(".");
if (name[1] == "pdf") {
- this.$confirm("褰撳墠鏂囦欢鏆備笉鏀寔棰勮鏄惁涓嬭浇", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- })
- .then(() => {
- window.location.href = item.url;
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "宸插彇娑�"
- });
- });
+ this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
this.previewpdf = false;
this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
} else if (name[1] == "jpg" || "png") {
@@ -1226,14 +1255,6 @@
this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
this.previewpdf = false;
}
- },
-
- //鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅
- getUsermsg() {
- getUserProfile().then(response => {
- this.defaultperson = response.data;
- this.standardlevel = response.data.standardlevel;
- });
},
/** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
@@ -1346,30 +1367,35 @@
//璁$畻琛ュ姪
getallowance(row) {
- console.log("ro", row);
- //鍏潅璐硅ˉ鍔╋細鏉窞妗愬簮锛屽缓寰凤紝娣冲畨60锛屾澀宸炲叾浠栧湴鍖�0锛岄潪鏉窞鍦板尯80
- if (row.destination != "") {
- var tempStr = row.destination;
+ if (
+ row.persontype == "涓撹亴浜哄憳" ||
+ row.persontype == "鍗忚皟鍛�" ||
+ row.persontype == "绠$悊浜哄憳"
+ ) {
+ //鍏潅璐硅ˉ鍔╋細鏉窞妗愬簮锛屽缓寰凤紝娣冲畨60锛屾澀宸炲叾浠栧湴鍖�0锛岄潪鏉窞鍦板尯80
+ if (row.destination != "") {
+ var tempStr = row.destination;
- //楠岃瘉鍩庡競
- if (tempStr == "鏉窞") {
- row.otherexpense = "";
- } else if (
- tempStr == "鏉窞-妗愬簮" ||
- tempStr == "鏉窞-寤哄痉" ||
- tempStr == "鏉窞-娣冲畨"
- ) {
- row.otherexpense = (parseInt(row.days) * 60).toString();
- } else {
- row.otherexpense = (parseInt(row.days) * 80).toString();
+ //楠岃瘉鍩庡競
+ if (tempStr == "鏉窞") {
+ row.otherexpense = "";
+ } else if (
+ tempStr == "鏉窞-妗愬簮" ||
+ tempStr == "鏉窞-寤哄痉" ||
+ tempStr == "鏉窞-娣冲畨"
+ ) {
+ row.otherexpense = (parseInt(row.days) * 60).toString();
+ } else {
+ row.otherexpense = (parseInt(row.days) * 80).toString();
+ }
}
+
+ //浼欓璐硅ˉ鍔╋細鍩庡競锛堣タ钘忥紝鏂扮枂锛岄潚娴�.120锛夛紙鍏朵粬100锛�
+ row.foodallowance = (parseInt(row.days) * 100).toString();
+
+ //璁$畻鍚堣
+ this.sumRowFee(row);
}
-
- //浼欓璐硅ˉ鍔╋細鍩庡競锛堣タ钘忥紝鏂扮枂锛岄潚娴�.120锛夛紙鍏朵粬100锛�
- row.foodallowance = (parseInt(row.days) * 100).toString();
-
- //璁$畻鍚堣
- this.sumRowFee(row);
},
getStandard(row) {
@@ -1514,10 +1540,12 @@
this.loading = false;
});
},
+
// 鍙栨秷鎸夐挳
cancel() {
- this.open = false;
+ window.close();
},
+
// 琛ㄥ崟閲嶇疆
reset() {
this.fileListto = [];
@@ -1569,6 +1597,7 @@
this.rbPayees = [];
this.resetForm("form");
},
+
//
handup(e) {
console.log("涓婃姤", e);
@@ -1586,7 +1615,7 @@
// this.queryParams.paprovincecode= this.$refs["residenceSelect" ].getSheng();
// this.queryParams.patowncode= this.$refs["residenceSelect" ].getQu();
this.queryParams.pageNum = 1;
- this.getList();
+ // this.getList();
},
/** 閲嶇疆鎸夐挳鎿嶄綔 */
@@ -1604,11 +1633,12 @@
/** 鏂板鎸夐挳鎿嶄綔 */
handleAdd() {
this.reset();
-
- this.open = true;
- this.title = "鏂板鎶ラ攢鐢宠";
+ // this.open = true;
+ this.title = "鏂板宸梾鐢宠鍗�";
this.dialogType = "edit";
this.fundflowList = [];
+
+ console.log(this.title, this.defaultperson);
this.form.userno = this.defaultperson.userName;
this.form.username = this.defaultperson.nickName;
@@ -1619,23 +1649,14 @@
this.addDetailRow(0);
this.addPayeeRow(0);
},
- gainee() {
- let ids = this.$route.query.id;
- let pos = this.$route.query.pos;
- console.log(ids, pos);
- if (pos == 2) {
- this.handleDetail(ids);
- } else if (pos == 1) {
- this.handleUpdate(ids);
- }
- },
/** 淇敼鎸夐挳鎿嶄綔 */
handleUpdate(ids) {
- this.$router.push({
- path: "/finance/travelexpenseslist/Modifydetails/",
- query: { id: ids }
- });
+ // this.$router.push({
+ // path: "/finance/travelexpenseslist/Modifydetails/",
+ // query: { id: ids }
+ // });
+
this.dialogType = "edit";
this.reset();
// this.open = true;
@@ -1661,6 +1682,8 @@
this.addDetailRow(0);
}
+ //瀹炴椂鍚堣閲戦
+ //this.sumTotalFee();
for (let i = 0; i < this.rbDetails.length; i++) {
this.sumRowFee(this.rbDetails[i]);
//瑙f瀽鍑哄樊鍦板潃
@@ -1672,9 +1695,6 @@
qu: this.rbDetails[i].traveltownname,
}; */
}
-
- //瀹炴椂鍚堣閲戦
- //this.sumTotalFee();
});
//鑾峰彇鎶ラ攢鎵撴淇℃伅
@@ -1699,7 +1719,7 @@
getReimbursement(id).then(response => {
this.form = response.data;
- //闄勪欢
+ //绁ㄦ嵁
this.fileListto = this.form.annexfiles
? this.form.annexfiles
.split(",")
@@ -1708,7 +1728,6 @@
//瀹℃牳鐘舵��
this.form.recordstatus = response.data.recordstatus + "";
-
let ids = response.data.id;
let listFundflowparams = {
fundid: ids,
@@ -1731,9 +1750,12 @@
};
}
*/
+ //鍚堣璐圭敤
+ // if (this.rbDetails.length > 0) this.sumTotalFee();
+ for (let i = 0; i < this.rbDetails.length; i++) {
+ this.sumRowFee(this.rbDetails[i]);
+ }
});
-
- if (this.rbDetails.length > 0) this.sumTotalFee();
//浠樻淇℃伅
this.queryParamsPayee.rbid = ids;
@@ -1746,10 +1768,100 @@
});
},
+ /** 瀹℃牳鎸夐挳鎿嶄綔 */
+ handleCheck(ids) {
+ this.dialogType = "check";
+ this.title = "鎶ラ攢鐢宠璇︽儏";
+
+ this.reset();
+ this.open = true;
+ const id = ids || this.ids;
+ this.checkObj.fundid = id;
+
+ getReimbursement(id).then(response => {
+ this.form = response.data;
+ //绁ㄦ嵁
+ this.fileListto = this.form.annexfiles
+ ? this.form.annexfiles
+ .split(",")
+ .map(item => ({ url: item, name: item }))
+ : [];
+
+ //瀹℃牳鐘舵��
+ this.form.recordstatus = response.data.recordstatus + "";
+
+ let ids = response.data.id;
+ let listFundflowparams = {
+ fundid: ids,
+ fundtype: 1
+ };
+ listFundflow(listFundflowparams).then(res => {
+ this.fundflowList = res.rows;
+ });
+
+ //鎶ラ攢鏄庣粏
+ getReimbursementdetaillist(ids).then(res => {
+ this.rbDetails = res.data;
+ console.log(this.rbDetails);
+ /*
+ for (let i = 0; i < this.rbDetails.length; i++) {
+ this.rbDetails[i].index = i;
+ this.rbDetails[i].searchAddress = {
+ sheng: this.rbDetails[i].travelprovincename,
+ shi: this.rbDetails[i].travelcityname,
+ qu: this.rbDetails[i].traveltownname,
+ };
+ }
+ */
+
+ //鍚堣璐圭敤
+ // if (this.rbDetails.length > 0) this.sumTotalFee();
+ for (let i = 0; i < this.rbDetails.length; i++) {
+ this.sumRowFee(this.rbDetails[i]);
+ }
+ });
+
+ //浠樻淇℃伅
+ this.queryParamsPayee.rbid = ids;
+ listReimbursementpayee(this.queryParamsPayee).then(res => {
+ this.rbPayees = res.rows;
+ if (this.rbPayees.length == 0) {
+ this.addPayeeRow(0);
+ }
+ });
+ });
+ },
+
+ //鎻愪氦瀹℃牳鎰忚
+ checksubmit() {
+ let checkfundobj = {
+ flowconclusion: this.checkObj.flowlevelone,
+ flowcontent: this.checkObj.flowconclusion,
+ fundid: this.checkObj.fundid
+ };
+
+ if (
+ checkfundobj.flowconclusion == null ||
+ checkfundobj.flowconclusion == undefined ||
+ checkfundobj.flowconclusion == ""
+ ) {
+ this.$modal.msgError("璇烽�夋嫨瀹℃牳缁撹鍚庡啀鎻愪氦瀹℃壒缁撴灉!");
+ return;
+ }
+
+ checkfund(checkfundobj).then(res => {
+ this.reset();
+ this.open = false;
+ this.getList();
+ this.$modal.msgSuccess("鎻愪氦瀹℃牳鎴愬姛!");
+ });
+ },
+
/** 鎻愪氦淇濆瓨鎸夐挳 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
+ // idisabled=true;
/**
let indexErrTime = this.rbDetails.findIndex((item) => {
if (item.endtime && item.starttime) {
@@ -1806,7 +1918,7 @@
}
*/
- //闄勪欢鏂囦欢澶勭悊
+ //绁ㄦ嵁鏂囦欢澶勭悊
let list = this.fileListto;
console.log(list);
@@ -1828,8 +1940,6 @@
const rbDetails = [...this.rbDetails];
const rbPayees = [...this.rbPayees];
- console.log(rbDetails);
- console.log(rbPayees);
if (this.form.id != null) {
console.log(this.form);
updateReimbursement(this.form);
@@ -1858,7 +1968,10 @@
this.$modal.msgSuccess("淇敼鎶ラ攢鍗曚繚瀛樻垚鍔�!");
this.open = false;
- this.getList();
+
+ // 鍏抽棴绐楀彛
+ this.$router.go(-1);
+ // this.getList();
// })
// .catch(err => {
// this.$modal.msgError("淇敼鎶ラ攢鍗曚繚瀛樺け璐ワ紒");
@@ -1883,7 +1996,9 @@
this.$modal.msgSuccess("鏂板鎶ラ攢鍗曚繚瀛樻垚鍔�!");
this.open = false;
- this.getList();
+
+ // 鍏抽棴绐楀彛
+ this.$router.go(-1);
})
.catch(err => {
this.$modal.msgError("鏂板鎶ラ攢鍗曚繚瀛樺け璐ワ紒");
@@ -2307,6 +2422,51 @@
chineseStr += cnInteger;
}
return chineseStr;
+ },
+
+ //琛ㄦ牸鍚堣
+ getSummaries(param) {
+ const { columns, data } = param;
+ const sums = [];
+ var columnnames = [
+ "bankname",
+ "bankcardno",
+ "remark",
+ "personname",
+ "starttime",
+ "endtime",
+ "departure",
+ "destination",
+ "traffictype",
+ "traffictype2",
+ "departure"
+ ];
+ columns.forEach((column, index) => {
+ if (index === 0) {
+ sums[index] = "鍚堣";
+ return;
+ }
+ //鍘婚櫎閮ㄥ垎瀛楁璁$畻
+ if (columnnames.indexOf(column.property) > -1) {
+ return;
+ }
+
+ const values = data.map(item => Number(item[column.property]));
+ if (!values.every(value => isNaN(value))) {
+ sums[index] = values.reduce((prev, curr) => {
+ const value = Number(curr);
+ if (!isNaN(value)) {
+ return prev + curr;
+ } else {
+ return prev;
+ }
+ }, 0);
+ sums[index] += "";
+ } else {
+ sums[index] = "";
+ }
+ });
+ return sums;
}
}
};
@@ -2315,10 +2475,12 @@
<style lang="scss" scoped>
.Modifydetailscla {
padding: 10px;
+
.boxdiv {
font-size: 18px;
padding: 0 30px;
padding-bottom: 60px;
+
.top-text {
text-align: center;
@@ -2327,19 +2489,23 @@
margin: 20px 0;
margin-bottom: 50px;
}
+
.dialog-footer {
text-align: left;
margin-top: 10px;
}
}
}
+
.upload-demo {
text-align: center;
}
+
.pdfimg {
display: flex; // text-align: center;
width: 100%;
height: 600px;
+
.box-pdf {
width: 200px;
padding-top: 20px;
@@ -2347,25 +2513,37 @@
border: 1px solid #dcdfe6;
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
0 0 6px 0 rgba(0, 0, 0, 0.04);
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); // <- Add this to fix.
}
+
.pdftit {
width: 200px;
padding: 20px;
font-size: 18px;
}
+
.pdftit:hover {
background: #c0cef7;
}
+
.pdfimgmin {
width: 60%;
+
img {
width: 100%;
}
}
+
.pdfimgmins {
font-size: 28px;
width: 60%;
text-align: center;
}
}
+
+::v-deep .el-input--medium .el-input__inner {
+ height: 36px;
+ line-height: 36px;
+ text-align: center;
+}
</style>
--
Gitblit v1.9.3