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

基本设置

parent c6289de3
const type = 'setting' const type = 'setting'
const setting = { const setting = {
saveEditBasic: {
url: '/vue/setting/save-edit-basic'
},
getEditBasic: {
url: '/vue/setting/get-edit-basic'
},
getListImportFile: { getListImportFile: {
url: '/vue/setting/list-import-file' url: '/vue/setting/list-import-file'
}, },
......
...@@ -203,7 +203,6 @@ export default { ...@@ -203,7 +203,6 @@ export default {
}, },
updateForm (search) { updateForm (search) {
debugger
let params = this.setParams({ let params = this.setParams({
...this.form, ...this.form,
page: this.pagenation.thispage page: this.pagenation.thispage
......
<template> <template>
<section class="ec-page-wrapper" style="overflow: hidden; padding-bottom: 0px;"> <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 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 <el-date-picker
v-model="value11" v-model="model.data"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
format="yyyy 年 MM 月 dd 日" format="MM-dd"
value-format="yyyy-MM-dd"> value-format="MM-dd">
</el-date-picker> </el-date-picker>
</el-form-item> </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 <single-upload
label="" label=""
:file-name="getFileName('receiptScan')" :file-name="model.logoName"
tips="建议上传一张透明背景的PNG文件,最大高度140像素,最大宽度200像素。" tips="建议上传一张透明背景的PNG文件,最大高度140像素,最大宽度200像素。"
:form-item="model.attachment_id" :form-item="model.logoId"
@update:item="val => {model.attachment_id = val}"> @update:item="val => {model.logoId = val}">
</single-upload> </single-upload>
</el-form-item> </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 <single-upload
label="" label=""
:file-name="getFileName('receiptScan')" :file-name="model.contentName"
tips="建议上传一张JPG文件,最大高度600像素,最大宽度1140像素。" tips="建议上传一张JPG文件,最大高度600像素,最大宽度1140像素。"
:form-item="model.attachment_id" :form-item="model.contentId"
@update:item="val => {model.attachment_id = val}"> @update:item="val => {model.contentId = val}">
</single-upload> </single-upload>
</el-form-item> </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> </el-form>
</section> </section>
</template> </template>
...@@ -36,17 +46,26 @@ import { ...@@ -36,17 +46,26 @@ import {
requestAPI, requestAPI,
api api
} from '@/lib/commonMixin' } from '@/lib/commonMixin'
import singleUpload from '../common/singleUploadPic' import singleUpload from '../../common/singleUploadPic'
import BreadCrumb from '../BreadCrumb'
export default { export default {
name: 'basicForm', name: 'basicForm',
components: { components: {
singleUpload singleUpload,
BreadCrumb
}, },
data () { data () {
return { return {
model: {}, model: {
data: '',
dataId: '',
logoId: '',
logoName: '',
contentId: '',
contentName: ''
},
rules: {} rules: {}
} }
}, },
...@@ -55,31 +74,42 @@ export default { ...@@ -55,31 +74,42 @@ export default {
}, },
mounted () { mounted () {
this.getEdit()
}, },
computed: { computed: {
}, },
methods: { methods: {
getNew () { getEdit () {
}, return requestAPI(api.getEditBasic, {})
.then((res) => {
getEdit (id) { this.model.id = res.model[0].id
// return requestAPI(api[`getEdit${this.t}${this.tt}`], {id}) this.model.data = res.model[0].setting_value
// .then((res) => { this.model.logoId = res.model[1].id
// return res.model 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) { _validate (cb) {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (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 () { _resetFields () {
this.$refs['form'].resetFields() // this.$refs['form'].resetFields()
} }
} }
} }
......
...@@ -31,6 +31,7 @@ import TaxonomyTerm10List from '../components/setting_list/taxonomy_term_10/taxo ...@@ -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 TaxonomyTerm13List from '../components/setting_list/taxonomy_term_13/taxonomy_term_13'
import ProjectProgressList from '../components/setting_list/project_progress/project_progress_list' import ProjectProgressList from '../components/setting_list/project_progress/project_progress_list'
import ImportHistoryList from '../components/setting_list/import-history/import_history_list.vue' 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 projectTitle = '金畅逍BMS - '
const routes = [{ const routes = [{
...@@ -264,5 +265,12 @@ const routes = [{ ...@@ -264,5 +265,12 @@ const routes = [{
meta: { meta: {
title: projectTitle + '系统设置' title: projectTitle + '系统设置'
} }
}, {
path: '/setting/basic',
name: 'basic',
component: Basic,
meta: {
title: projectTitle + '系统设置'
}
}] }]
export default routes 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