'新增业务添加'
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn pull-left" style="padding-left: 20px">
|
||||
<button @click="tipShow('开发中')" :class="['btn']" type="button"> 新建业务</button>
|
||||
<button @click="createService()" :class="['btn']" type="button"> 新建业务</button>
|
||||
</span>
|
||||
|
||||
|
||||
@@ -260,12 +260,54 @@
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<!-- 新建业务 -->
|
||||
<div class="modal fade" id="createServiceDia">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title">新建业务</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3">选择业务主表</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" v-model="createRow.table">
|
||||
<option v-for="x in tables" :value="x.alias" v-text="x.name + ' --- ' + x.comment"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3">业务名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input v-model="createRow.comment" class="form-control" placeholder="请输入 业务名称">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3">业务标识码</label>
|
||||
<div class="col-sm-6">
|
||||
<input v-model="createRow.name" class="form-control" placeholder="请输入 业务标识码,如:user_service">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button @click="saveService()" type="button" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</row>
|
||||
|
||||
<script>
|
||||
//import { login } from '../api/user.js'
|
||||
//import { getServiceInfo, getServiceDetail, getServiceList } from '/api/meta.js'
|
||||
let { getServiceInfo, getServiceDetail, getServiceList } = meta;
|
||||
let { getServiceInfo, getServiceDetail, getServiceList, tableLinkList, serviceSave } = meta;
|
||||
let { showOk } = red
|
||||
|
||||
var vm = new Vue({
|
||||
@@ -309,13 +351,16 @@
|
||||
table: "",//表别名
|
||||
filterArr:[],
|
||||
filterMap:{},
|
||||
|
||||
createRow: {},
|
||||
tables: [],
|
||||
},
|
||||
watch: {
|
||||
status: function (v) {
|
||||
this.setMove(v)
|
||||
},
|
||||
services: function (v) {
|
||||
if(v.length > 0) {
|
||||
if(v.length > 0 && !vm.service) {
|
||||
vm.service = v[0]["name"];
|
||||
}
|
||||
},
|
||||
@@ -555,8 +600,25 @@
|
||||
red.showMsg();
|
||||
}
|
||||
},
|
||||
tipShow() {
|
||||
red.showMsg({msg: '开发中'})
|
||||
createService() {
|
||||
this.createRow = {}
|
||||
if (this.tables.length == 0) {
|
||||
tableLinkList().then(res => {
|
||||
this.tables = res
|
||||
})
|
||||
}
|
||||
$('#createServiceDia').modal()
|
||||
},
|
||||
saveService() {
|
||||
serviceSave({service: this.createRow}).then(res => {
|
||||
red.showOk("创建成功, 请对业务进行配置")
|
||||
$('#createServiceDia').modal('hide')
|
||||
|
||||
this.service = this.createRow.name
|
||||
getServiceList(json => {
|
||||
vm.services = json;
|
||||
})
|
||||
})
|
||||
},
|
||||
showInfo() {
|
||||
$('#f-info').modal({moveable: true})
|
||||
|
||||
Reference in New Issue
Block a user