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

完成工作日志;

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