Commit 15545c98 authored by 高宇's avatar 高宇

完成工作日志;

parent a5056a12
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
let obj = { let obj = {
name: 'ofClient', name: 'ofClient',
params: { params: {
id: item.client_id clientId: item.client_id
} }
} }
return obj return obj
......
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
<Pagenation <Pagenation
@update:pager="pager => {updatePage(pager)}" @update:pager="pager => {updatePage(pager)}"
:pager.sync="pagenation" :pager.sync="pagenation"
:total="totalcount" :total="totalcount">
v-if="totalcount > pagenation.pagesize">
</Pagenation> </Pagenation>
</div> </div>
</div> </div>
...@@ -82,8 +81,7 @@ ...@@ -82,8 +81,7 @@
page: 1 page: 1
}, },
totalcount: 0, totalcount: 0,
tableList: [], tableList: []
options: []
} }
}, },
components: { components: {
...@@ -96,7 +94,7 @@ ...@@ -96,7 +94,7 @@
this.$router.push({name: 'workLogEdit', params: {id: row.id}}) this.$router.push({name: 'workLogEdit', params: {id: row.id}})
}, },
addWorkLog () { addWorkLog () {
this.$router.push({name: 'workLogClientAdd', params: {id: this.$route.params.id}}) this.$router.push({name: 'workLogClientAdd', params: {clientId: this.$route.params.id}})
}, },
updatePage (pager) { updatePage (pager) {
Object.assign(this.pagenation, pager) Object.assign(this.pagenation, pager)
...@@ -126,7 +124,6 @@ ...@@ -126,7 +124,6 @@
id: this.$route.params.id id: this.$route.params.id
} }
}).then(res => { }).then(res => {
this.options = res.options
Object.keys(res.model).forEach(item => { Object.keys(res.model).forEach(item => {
this.$set(this.model, item, res.model[item]) this.$set(this.model, item, res.model[item])
}) })
......
<template> <template>
<section class="pull-right"> <section class="pull-right page-footer">
<el-pagination v-if="total > 0" class="" <el-pagination v-if="total > pager.pagesize" class=""
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
:total="total"> :total="total">
</el-pagination> </el-pagination>
<span v-else>
总计{{total}}条 当前显示第1至第{{total}}
</span>
</section> </section>
</template> </template>
<script> <script>
...@@ -50,5 +53,7 @@ export default { ...@@ -50,5 +53,7 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.page-footer{
padding: 0 30px;
}
</style> </style>
...@@ -219,25 +219,25 @@ ...@@ -219,25 +219,25 @@
this.setScenarioOption(this.WorkLogs.scenario_id) this.setScenarioOption(this.WorkLogs.scenario_id)
}, },
initAdd () { initAdd () {
if (this.$route.params.id) { if (this.$route.params.clientId) {
this.WorkLogs.client_id = this.$route.params.id this.WorkLogs.client_id = this.$route.params.clientId
requestAPI(api.getClient, { requestAPI(api.getClient, {
data: { data: {
id: this.$route.params.id id: this.$route.params.clientId
} }
}).then(res => { }).then(res => {
this.searchText = res.model.name this.searchText = res.model.name
}) })
requestAPI(api.searchContactByClientId, { requestAPI(api.searchContactByClientId, {
data: { data: {
client_id: this.$route.params.id client_id: this.$route.params.clientId
} }
}).then(res => { }).then(res => {
this.options['WorkLogs[workLogContacts]'].value = res this.options['WorkLogs[workLogContacts]'].value = res
}) })
requestAPI(api.searchProjectByClientId, { requestAPI(api.searchProjectByClientId, {
data: { data: {
client_id: this.$route.params.id client_id: this.$route.params.clientId
} }
}).then(res => { }).then(res => {
this.options['WorkLogs[project_id]'].value = res this.options['WorkLogs[project_id]'].value = res
...@@ -253,6 +253,7 @@ ...@@ -253,6 +253,7 @@
this.$set(this.options, key, res.options[key]) this.$set(this.options, key, res.options[key])
}) })
this.$nextTick(() => { this.$nextTick(() => {
// 设置级联默认值
this.WorkLogs.scenario_id = 1 this.WorkLogs.scenario_id = 1
this.setScenarioOption(1) this.setScenarioOption(1)
}) })
...@@ -265,7 +266,6 @@ ...@@ -265,7 +266,6 @@
} }
}).then(res => { }).then(res => {
Object.keys(res.options).forEach(item => { Object.keys(res.options).forEach(item => {
console.log(res.options[item])
if (res.options[item].value) { if (res.options[item].value) {
res.options[item].value.forEach(i => { res.options[item].value.forEach(i => {
if (i.child) { if (i.child) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment