Commit c529d15a authored by huai.li's avatar huai.li

基本设置

parent c6289de3
const type = 'setting'
const setting = {
saveEditBasic: {
url: '/vue/setting/save-edit-basic'
},
getEditBasic: {
url: '/vue/setting/get-edit-basic'
},
getListImportFile: {
url: '/vue/setting/list-import-file'
},
......
......@@ -203,7 +203,6 @@ export default {
},
updateForm (search) {
debugger
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
......
<template>
<section class="ec-page-wrapper" style="overflow: hidden; padding-bottom: 0px;">
<el-alert title="" type="info">
<BreadCrumb name="基本设置"></BreadCrumb>
</el-alert>
<br />
<el-form label-width="120px" ref="form" :rules="rules" :model="model" class="ec-create-form">
<el-form-item label="Logo图标" prop="attachment_id" class="ec-clear-left ec-form-item-lg">
<el-form-item label="财年起始日" prop="data" class="ec-clear-left ec-form-item-lg">
<el-date-picker
v-model="value11"
v-model="model.data"
type="date"
placeholder="选择日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
format="MM-dd"
value-format="MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="Logo图标" prop="attachment_id" class="ec-clear-left ec-form-item-lg">
<el-form-item label="Logo图标" prop="logoId" class="ec-clear-left ec-form-item-lg">
<single-upload
label=""
:file-name="getFileName('receiptScan')"
:file-name="model.logoName"
tips="建议上传一张透明背景的PNG文件,最大高度140像素,最大宽度200像素。"
:form-item="model.attachment_id"
@update:item="val => {model.attachment_id = val}">
:form-item="model.logoId"
@update:item="val => {model.logoId = val}">
</single-upload>
</el-form-item>
<el-form-item label="首页内容" prop="attachment_id" class="ec-clear-left ec-form-item-lg">
<el-form-item label="首页内容" prop="contentId" class="ec-clear-left ec-form-item-lg">
<single-upload
label=""
:file-name="getFileName('receiptScan')"
:file-name="model.contentName"
tips="建议上传一张JPG文件,最大高度600像素,最大宽度1140像素。"
:form-item="model.attachment_id"
@update:item="val => {model.attachment_id = val}">
:form-item="model.contentId"
@update:item="val => {model.contentId = val}">
</single-upload>
</el-form-item>
<el-form-item label="" prop="contentId" class="ec-clear-left ec-form-item-lg">
<div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click.stop.prevent="_resetFields" size="mini">重 置</el-button>
<el-button type="confirm" @click.stop.prevent="_validate" size="mini">保存修改</el-button>
</div>
</el-form-item>
</el-form>
</section>
</template>
......@@ -36,17 +46,26 @@ import {
requestAPI,
api
} from '@/lib/commonMixin'
import singleUpload from '../common/singleUploadPic'
import singleUpload from '../../common/singleUploadPic'
import BreadCrumb from '../BreadCrumb'
export default {
name: 'basicForm',
components: {
singleUpload
singleUpload,
BreadCrumb
},
data () {
return {
model: {},
model: {
data: '',
dataId: '',
logoId: '',
logoName: '',
contentId: '',
contentName: ''
},
rules: {}
}
},
......@@ -55,31 +74,42 @@ export default {
},
mounted () {
this.getEdit()
},
computed: {
},
methods: {
getNew () {
},
getEdit (id) {
// return requestAPI(api[`getEdit${this.t}${this.tt}`], {id})
// .then((res) => {
// return res.model
// })
getEdit () {
return requestAPI(api.getEditBasic, {})
.then((res) => {
this.model.id = res.model[0].id
this.model.data = res.model[0].setting_value
this.model.logoId = res.model[1].id
this.model.logoName = res.model[1].setting_value
this.model.contentId = res.model[2].id
this.model.contentName = res.model[2].setting_value
})
},
_validate (cb) {
this.$refs['form'].validate((valid) => {
if (valid) {
let _params = {}
_params['setting[' + this.model.id + ']'] = this.model.data
_params['setting[' + this.model.logoId + ']'] = this.model.logoName
_params['setting[' + this.model.contentId + ']'] = this.model.contentName
requestAPI(Object.assign(api.saveEditBasic, {method: 'POST'}), _params)
.then((res) => {
this.$message.success('操作成功')
})
}
})
},
_resetFields () {
this.$refs['form'].resetFields()
// this.$refs['form'].resetFields()
}
}
}
......
......@@ -31,6 +31,7 @@ import TaxonomyTerm10List from '../components/setting_list/taxonomy_term_10/taxo
import TaxonomyTerm13List from '../components/setting_list/taxonomy_term_13/taxonomy_term_13'
import ProjectProgressList from '../components/setting_list/project_progress/project_progress_list'
import ImportHistoryList from '../components/setting_list/import-history/import_history_list.vue'
import Basic from '../components/setting_list/basic/form.vue'
const projectTitle = '金畅逍BMS - '
const routes = [{
......@@ -264,5 +265,12 @@ const routes = [{
meta: {
title: projectTitle + '系统设置'
}
}, {
path: '/setting/basic',
name: 'basic',
component: Basic,
meta: {
title: projectTitle + '系统设置'
}
}]
export default routes
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