From 7a46adff3aae94ca4dabc24d9c4921a752d3a827 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 30 七月 2023 23:54:11 +0800
Subject: [PATCH] yxh
---
src/views/project/travelexpenseslist/Modifydetails/index.vue | 193 ++++++++++++++++++++++++++++++------------------
1 files changed, 121 insertions(+), 72 deletions(-)
diff --git a/src/views/project/travelexpenseslist/Modifydetails/index.vue b/src/views/project/travelexpenseslist/Modifydetails/index.vue
index e0e38ae..be3fc18 100644
--- a/src/views/project/travelexpenseslist/Modifydetails/index.vue
+++ b/src/views/project/travelexpenseslist/Modifydetails/index.vue
@@ -166,7 +166,7 @@
<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="" label="搴忓彿" align="center" fixed width="65">
<template slot-scope="scope">
<el-input v-model="scope.row.orderno" placeholder="搴忓彿" />
@@ -274,8 +274,8 @@
<el-table-column prop="trafficexpense" label="浜ら�氳垂" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.trafficexpense" placeholder="浜ら�氳垂" @blur="val => {
- sumRowFee(scope.row);
- }
+ sumRowFee(scope.row);
+ }
" />
</template>
</el-table-column>
@@ -294,8 +294,8 @@
<el-table-column prop="hotelexpense" label="浣忓璐�" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.hotelexpense" placeholder="浣忓璐�" @blur="val => {
- sumRowFee(scope.row);
- }
+ sumRowFee(scope.row);
+ }
" />
</template>
</el-table-column>
@@ -303,24 +303,24 @@
<el-table-column prop="foodexpenses" label="椁愯垂鎶ラ攢" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.foodexpenses" placeholder="浼欓璐规姤閿�" @blur="val => {
- sumRowFee(scope.row);
- }
+ sumRowFee(scope.row);
+ }
" />
</template>
</el-table-column>
<el-table-column prop="foodallowance" label="浼欓琛ュ姪" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.foodallowance" placeholder="浼欓璐硅ˉ鍔�" @blur="val => {
- sumRowFee(scope.row);
- }
+ sumRowFee(scope.row);
+ }
" />
</template>
</el-table-column>
<el-table-column prop="otherexpense" label="鍏潅璐硅ˉ鍔�" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.otherexpense" placeholder="鏉傝垂" @blur="val => {
- sumRowFee(scope.row);
- }
+ sumRowFee(scope.row);
+ }
" />
</template>
</el-table-column>
@@ -328,8 +328,8 @@
<el-table-column prop="otherfeeamount" label="鍏朵粬璐圭敤" align="center" width="90">
<template slot-scope="scope">
<el-input v-model="scope.row.otherfeeamount" placeholder="鍏朵粬璐圭敤" @blur="val => {
- sumRowFee(scope.row);
- }
+ sumRowFee(scope.row);
+ }
" />
</template>
</el-table-column>
@@ -344,19 +344,14 @@
<el-input v-model="scope.row.total" placeholder="鍚堣" />
</template>
</el-table-column>
- <el-table-column fixed="right" label="鎿嶄綔" align="center" width="120" v-if="dialogType == 'edit'">
+ <el-table-column fixed="right" label="鎿嶄綔" align="center" width="120">
<template slot-scope="scope">
- <el-button type="text" size="mini" @click="addDetailRow(scope.$index)">鏂板</el-button>
- <el-button @click.native.prevent="
- deleteDetailRow(scope.$index, rbDetails, scope.row)
- " type="text" size="small">
- 鍒犻櫎
- </el-button>
- <el-button @click.native.prevent="
- Filepopup(scope.$index, rbDetails, scope.row)
- " type="text" size="small">
- 闄勪欢
- </el-button>
+ <el-button type="text" size="mini" @click="addDetailRow(scope.$index)"
+ v-if="dialogType == 'edit'">鏂板</el-button>
+ <el-button @click.native.prevent="deleteDetailRow(scope.$index, rbDetails, scope.row)" type="text"
+ size="small" v-if="dialogType == 'edit'">鍒犻櫎</el-button>
+ <el-button @click.native.prevent="Filepopup(scope.$index, rbDetails, scope.row)" type="text"
+ size="small">绁ㄦ嵁</el-button>
</template>
</el-table-column>
</el-table>
@@ -365,7 +360,7 @@
<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="" label="搴忓彿" align="center" fixed width="65">
<template slot-scope="scope">
<el-input v-model="scope.row.orderno" placeholder="搴忓彿" />
@@ -418,17 +413,19 @@
<el-input v-model="scope.row.amount" placeholder="鎵撴閲戦" />
</template>
</el-table-column>
- <el-table-column prop="remark" slot="" label="璇锋璇存槑" align="center" fixed width="280">
+ <el-table-column prop="remark" slot="" label="璇锋璇存槑" align="center" fixed>
<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>
+ </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>-->
<el-table-column label="鎿嶄綔" align="center" width="100" v-if="dialogType == 'edit'">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="addPayeeRow(scope.$index)">鏂板</el-button>
@@ -456,7 +453,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-if="dialogType == 'edit'">淇� 瀛�</el-button>
- <el-button @click="cancel">鍙� 娑�</el-button>
+ <!--<el-button @click="cancel">閫� 鍑�</el-button>-->
</div>
</div>
@@ -466,7 +463,7 @@
<div>
<el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileListto" multiple
:limit="20" :headers="headers" :on-success="(response, file, fileList) =>
- uploadSccess(response, file, fileList)
+ uploadSccess(response, file, fileList)
" :on-preview="downFile" :disabled="dialogType == 'detail'" :on-error="handleUploadError"
:on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf">
<el-button :disabled="dialogType == 'detail'" size="small" type="primary">涓婁紶</el-button>
@@ -566,7 +563,9 @@
//涓嬫媺鍙互閫夋嫨浜哄憳鍒楄〃
personsSel: [],
// 閮ㄩ棬鏍戦�夐」
+
deptOptions: undefined,
+ //绁ㄦ嵁鏂囦欢
pdftitle: "",
pdfimg: "",
pdfVisible: false,
@@ -574,6 +573,7 @@
value: 0,
label: ""
},
+
hintitle: "閫変腑宸︿晶宸蹭笂浼犳枃浠堕瑙堟煡鐪�",
atpresent: "",
iframeurl: "",
@@ -672,13 +672,19 @@
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;
@@ -696,10 +702,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);
+ }
},
methods: {
@@ -724,7 +744,7 @@
console.log(fileList);
this.rbDetails;
- //鑾峰彇闄勪欢淇℃伅浣嶇疆
+ //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
if (response.code == 200) {
this.form.filename = file.raw.name;
console.log(this.fileList);
@@ -737,7 +757,7 @@
this.$modal.msgError(response.msg);
}
},
- // 鐐瑰嚮鏂囦欢
+ // 鐐瑰嚮绁ㄦ嵁
Filepopup(index, rows, row) {
console.log(index, rows, row);
this.atpresent = index;
@@ -773,14 +793,6 @@
this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
this.previewpdf = false;
}
- },
-
- //鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅
- getUsermsg() {
- getUserProfile().then(response => {
- this.defaultperson = response.data;
- this.standardlevel = response.data.standardlevel;
- });
},
/** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
@@ -1061,10 +1073,12 @@
this.loading = false;
});
},
+
// 鍙栨秷鎸夐挳
cancel() {
- this.open = false;
+ window.close();
},
+
// 琛ㄥ崟閲嶇疆
reset() {
this.fileListto = [];
@@ -1116,6 +1130,7 @@
this.rbPayees = [];
this.resetForm("form");
},
+
//
handup(e) {
console.log("涓婃姤", e);
@@ -1133,7 +1148,7 @@
// this.queryParams.paprovincecode= this.$refs["residenceSelect" ].getSheng();
// this.queryParams.patowncode= this.$refs["residenceSelect" ].getQu();
this.queryParams.pageNum = 1;
- this.getList();
+ // this.getList();
},
/** 閲嶇疆鎸夐挳鎿嶄綔 */
@@ -1151,11 +1166,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;
@@ -1166,23 +1182,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;
@@ -1246,7 +1253,7 @@
getReimbursement(id).then(response => {
this.form = response.data;
- //闄勪欢
+ //绁ㄦ嵁
this.fileListto = this.form.annexfiles
? this.form.annexfiles
.split(",")
@@ -1353,7 +1360,7 @@
}
*/
- //闄勪欢鏂囦欢澶勭悊
+ //绁ㄦ嵁鏂囦欢澶勭悊
let list = this.fileListto;
console.log(list);
@@ -1405,7 +1412,7 @@
this.$modal.msgSuccess("淇敼鎶ラ攢鍗曚繚瀛樻垚鍔�!");
this.open = false;
- this.getList();
+ // this.getList();
// })
// .catch(err => {
// this.$modal.msgError("淇敼鎶ラ攢鍗曚繚瀛樺け璐ワ紒");
@@ -1430,7 +1437,7 @@
this.$modal.msgSuccess("鏂板鎶ラ攢鍗曚繚瀛樻垚鍔�!");
this.open = false;
- this.getList();
+ // this.getList();
})
.catch(err => {
this.$modal.msgError("鏂板鎶ラ攢鍗曚繚瀛樺け璐ワ紒");
@@ -1854,9 +1861,42 @@
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;
+ },
+
}
};
+
</script>
<style lang="scss" scoped>
@@ -1900,6 +1940,7 @@
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 {
@@ -1925,5 +1966,13 @@
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