|
@@ -88,16 +88,17 @@
|
|
|
|
|
|
<!-- 备注 -->
|
|
|
<el-form-item label="备注" style="display: block; width: 70%; float: left;">
|
|
|
- <el-input type="textarea" v-model="addForm.remark"></el-input>
|
|
|
+ <el-input type="textarea" v-model="addForm.remark" :autosize="{minRows: 2, maxRows: 2}"></el-input>
|
|
|
</el-form-item>
|
|
|
<!-- 总费用 -->
|
|
|
<!-- <div style="float: left; line-height: 55px;margin-left:20px">总费用 <el-link disabled v-model="addForm.totalAmount">{{addForm.totalAmount}}</el-link> 元</div> -->
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<!-- 按钮 -->
|
|
|
+
|
|
|
<div class="pu_button">
|
|
|
- <span v-if="this.addForm.totalAmount <= 0" style="color:#606266;">总费用 {{this.addForm.totalAmount}} 元</span>
|
|
|
- <span v-else style="color:#606266;">总费用 ¥{{this.addForm.totalAmount | numberToCurrency}} 元</span>
|
|
|
+ <span v-if="totalCost <= 0" style="color:#606266;">总费用 {{totalCost}} 元</span>
|
|
|
+ <span v-else style="color:#606266;">总费用 ¥{{totalCost | numberToCurrency}} 元</span>
|
|
|
<span class="pu_bu_x" style="margin-left:10px;" @click="addxz"> <i class="el-icon-circle-plus-outline"></i> 新增发票</span>
|
|
|
</div>
|
|
|
|
|
@@ -107,7 +108,7 @@
|
|
|
:data="invoiceList"
|
|
|
border
|
|
|
style="width: 100%;height:100%"
|
|
|
- height="286px"
|
|
|
+ height="386px"
|
|
|
@row-dblclick="dbclick">
|
|
|
<el-table-column prop="projectName" label="所属项目" width="180">
|
|
|
<template slot-scope="scope">
|
|
@@ -314,7 +315,7 @@
|
|
|
<el-form-item label="费用类型" style="width: 270px">
|
|
|
<el-select v-model="ParticularsList.type" placeholder="请选择" :disabled="flg">
|
|
|
<el-option label="一般" :value="0"></el-option>
|
|
|
- <el-option label="差旅" :value="1"></el-option>git
|
|
|
+ <el-option label="差旅" :value="1"></el-option>
|
|
|
<el-option label="外包" :value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -499,7 +500,17 @@ export default {
|
|
|
diz: 'http://worktime.ttkuaiban.com'
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ totalCost : function(){
|
|
|
+ let num = 0
|
|
|
+ for(let i in this.invoiceList){
|
|
|
+ if(this.invoiceList[i].amount){
|
|
|
+ num += this.invoiceList[i].amount*1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return num
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {},
|
|
|
created() {
|
|
|
let height = window.innerHeight;
|
|
@@ -643,7 +654,7 @@ export default {
|
|
|
delec(ids) {
|
|
|
// console.log('删除操作', ids);
|
|
|
this.ParticularsList.invoiceList.splice(ids, 1)
|
|
|
-
|
|
|
+ this.kan()
|
|
|
},
|
|
|
adds() {
|
|
|
// happenDate
|
|
@@ -827,7 +838,7 @@ export default {
|
|
|
add() {
|
|
|
// happenDate
|
|
|
this.addForm.items = JSON.stringify(this.invoiceList)//这里要传发票列表的json转string
|
|
|
-
|
|
|
+ this.addForm.totalAmount = this.totalCost
|
|
|
this.http.post('/expense-sheet/add', this.addForm,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
@@ -1238,7 +1249,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.public {
|
|
|
- height: 230px;
|
|
|
+ height: 180px;
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
}
|
|
|
.public .el-form-item {
|