刘璐珈噶东

This commit is contained in:
Vergil
2020-02-24 09:32:44 +08:00
parent b3513a9a3d
commit 6c08cd2ea8
19 changed files with 1217 additions and 822 deletions

View File

@@ -1,92 +1,118 @@
<template>
<div class="app-container">
<el-card>
<el-select v-model="entryNameValue" filterable placeholder="项目名称" style="margin: 3px;width: 140px " size="small" clearable>
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="customerName" filterable placeholder="客户名称" style="margin: 3px;width: 220px " size="small" clearable>
<!--<el-select v-model="entryNameValue" filterable placeholder="项目名称" style="margin: 3px 10px;width: 180px " size="small" clearable>-->
<!--<el-option-->
<!--v-for="item in entryName"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<el-input v-model="customerName" clearable size="small" style="width:220px;" placeholder="请输入客户名称或项目名称"/>
<el-select v-show="false" v-model="customerName" filterable placeholder="请输入客户名称" style="margin: 3px;width: 220px " size="small" clearable>
<el-option
v-for="item in customerNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;margin-left: 10px">签订日期</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
style="width: 240px;margin: 3px 0"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="PageSize = 30;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button>
<!--<el-badge :value="value" :max="99" class="item">-->
<!--<el-button size="small" plain @click="AccountsReceivable">查看收款信息</el-button>-->
<!--</el-badge>-->
</el-card>
<el-card>
<el-col :span="14">
<el-col :span="17">
<el-table
v-loading="listLoading"
:row-key="getRowKeys"
:expand-row-keys="expands"
:header-cell-style="{fontFamily:'YouYuan',fontSize:'13px',fontWeight:200}"
:data="tableData1"
style="width: 100%;"
style="width: 970px;"
height="600px"
highlight-current-row
border
stripe
size="mini"
@expand-change="selectMachine"
@sort-change="sortChange"
@row-click="getTableData2">
<el-table-column type="expand" label="详情">
<template slot-scope="scope">
<el-table :data="tableData3" class="subTableHeader" border stripe style="width: 600px; text-align: center" size="mini">
<el-table-column label="发货单号" align="center" >
<template slot-scope="scope">
{{ scope.row.发货单号 }}
</template>
</el-table-column>
<el-table-column label="发货日期" align="center">
<template slot-scope="scope">
{{ scope.row.发货日期 }}
</template>
</el-table-column>
<el-table-column label="运输状态" align="center">
<template slot-scope="scope">
{{ parseInt(scope.row.运输状态) === 0 ? '运输中' : '已签收' }}
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column align="center" label="合同编号" prop="合同编号" width="140">
<!--@expand-change="selectMachine"-->
<!--<el-table-column type="expand" label="详情" width="50">-->
<!--<template slot-scope="scope">-->
<!--<el-table :data="tableData3" class="subTableHeader" border stripe style="width: 600px; text-align: center" size="mini">-->
<!--<el-table-column label="发货单号" align="center" >-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.发货单号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="发货日期" align="center">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.发货日期 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="运输状态" align="center">-->
<!--<template slot-scope="scope">-->
<!--{{ parseInt(scope.row.运输状态) === 0 ? '运输中' : '已签收' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="合同编号" prop="合同编号" sortable="custom" width="118">
<template slot-scope="scope">
{{ scope.row.合同编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" prop="项目名称" width="100" show-overflow-tooltip>
<el-table-column align="center" label="项目名称" prop="项目名称" width="118" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="客户名称" prop="客户名称" min-width="160" show-overflow-tooltip>
<el-table-column align="center" label="客户名称" prop="客户名称" width="160" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="付款方式" width="80">
<el-table-column align="center" label="付款方式" width="78">
<template slot-scope="scope">
{{ scope.row.付款方式 }}
</template>
</el-table-column>
<el-table-column align="right" label="合同总额(万元)" width="130">
<el-table-column align="right" label="合同金额(万元)" prop="合同总金额" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ Number(scope.row.合同总金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="center" label="销售经理" prop="姓名" width="100">
<el-table-column align="right" label="已收(万元)" prop="已支付" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ Number(scope.row.已收金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="right" label="未收(万元)" prop="未支付金额" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ Number(scope.row.未收金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="center" label="营销经理" prop="姓名" width="80">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="70" fixed="right">
<el-table-column label="操作" align="center" width="66">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-circle-plus-outline" @click.stop="addMoney(scope.row)">收款</el-button>
</template>
@@ -137,11 +163,13 @@
@current-change="handleCurrentChange"/>
</div>
</el-col>
<el-col :span="10">
<el-col :span="7">
<el-table
:data="tableData2"
style="width: 500px;max-height: 440px;text-align: center"
:summary-method="getSummaries1"
style="width: 395px;max-height: 440px;text-align: center"
highlight-current-row
show-summary
border
size="mini">
<el-table-column
@@ -149,25 +177,25 @@
label="序号"
type="index"
width="70"/>
<el-table-column align="right" label="收款金额" width="125">
<el-table-column align="right" label="收款金额(万元)" width="120" prop="收款金额">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input-number v-model="scope.row.收款金额" :min="0" :step="1" style="width:100px" clearable size="mini"/>
<el-input v-model="scope.row.收款金额" :min="0" style="width:100px" clearable size="mini"/>
</template>
<span v-else>{{ Number(scope.row.收款金额).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="收款时间" align="center" width="150px">
<el-table-column label="收款时间" align="center" width="85" prop="收款时间">
<template slot-scope="scope">
{{ scope.row.收款时间 ? scope.row.收款时间.split(' ')[0] : '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="150">
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="updateMoney(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="updateMoney(scope.row, scope.$index)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="!scope.row.edit" type="text" size="mini" icon="el-icon-delete" @click="deleteMoney(scope.row)">删除</el-button>
<el-button v-else type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="!scope.row.edit" type="text" size="mini" icon="el-icon-delete" @click="deleteMoney(scope.row)"/>
</template>
</el-table-column>
</el-table>
@@ -186,9 +214,37 @@ export default {
},
data() {
return {
dateRange: '',
check1: '',
pickerOptions: {
shortcuts: [{
text: '上季度',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 30 * 3)
picker.$emit('pick', [start, end])
}
}, {
text: '过去半年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 366 / 2)
picker.$emit('pick', [start, end])
}
}, {
text: '过去一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 365)
picker.$emit('pick', [start, end])
}
}]
},
customerNames: [],
customerName: '',
pickerOptions: {},
timetime: '',
name: '',
moneyValue: '',
@@ -247,6 +303,82 @@ export default {
this.getCustomerName()
},
methods: {
// 2020 02 20 刘路加新增怕徐
sortChange(column, prop, order) {
console.log(column + '-' + column.prop + '-' + column.order, 11111)
if (column.prop === '合同编号') {
this.ordername = 1
} else if (column.prop === '合同总金额') {
this.ordername = 2
} else if (column.prop === '已支付') {
this.ordername = 3
} else if (column.prop === '未支付金额') {
this.ordername = 4
} else {
this.ordername = ''
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.getTableData()
},
// 2020 02 18 刘路加新增合计
getSummaries1: function(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 1) {
const values = data.map(item => Number(parseFloat(item['收款金额'])))
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] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = '0'
}
}
})
return sums
},
// getSummaries1(param) { // 合计
// console.log(param)
// const { columns, data } = param
// const sums = []
// columns.forEach((column, index) => {
// if (index === 0) {
// sums[index] = '合计'
// } else if (index === 1) {
// const values = data.map(item => {
// console.log(item, 2222)
// Number(parseFloat(item['收款金额']))
// })
// 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] = sums[index].toFixed(2) + ' 元'
// } else {
// sums[index] = 'N/A'
// }
// }
// })
// },
searchName() { // 模糊查询姓名
SelectMarketingManager(this.name).then(response => {
this.dataPeople = response.data
@@ -279,14 +411,18 @@ export default {
this.value = response.data.length
})
},
updateMoney(row) {
updateMoney(row, index) {
row.edit = false
updateMoney(row.资金明细ID, row.收款金额).then(response => {
if (response.data[0].result !== '0') {
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
this.tableData2[index].收款金额 = 0
}
}).then(() => {
console.log(111111111)
this.getTableData()
})
},
addMoney(row) {
@@ -331,6 +467,7 @@ export default {
})
}
})
this.getTableData()
} else {
this.$message.error('删除失败')
}
@@ -378,7 +515,8 @@ export default {
},
getTableData() {
this.listLoading = true
searchTable1(this.PageCurrent, this.PageSize, this.entryNameValue, this.peopleid, this.customerName).then(response => {
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
searchTable1(this.PageCurrent, this.PageSize, this.entryNameValue, this.peopleid, this.customerName, this.check1, this.dateRange[0], this.dateRange[1], this.ordername, this.order).then(response => {
this.listLoading = false
const data = response.data.rows
for (let i = 0; i < data.length; i++) {
@@ -396,6 +534,7 @@ export default {
this.tableData2 = []
this.moneyID = row.资金id
searchTable2(this.moneyID).then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
收款金额: response.data[i].金额,