1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- var docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'));
- var NewTemplateForm = {
- template: '<div>\
- <div class="title-name c-f16">\
- <span class="c-vam">模板未命名</span>\
- </div>\
- <div class="c-t-center" style="margin-top: 240px;">\
- <span class="c-vam c-f14 mr5">模板名称: </span>\
- <input v-model="name" placeholder="请输入新模板名称" class="c-vam temp-name-inpt"/>\
- <a @click="save" href="javascript: void(0);" class="ml10 save-temp-name-btn c-f14 c-vam">保存</a>\
- </div>\
- </div>',
- props: [],
- data: function() {
- return {
- name:''
- }
- },
- beforeRouteEnter: function (to, from, next) {
- next(function(vm) {
- vm.name = ""
- })
- },
- mounted: function() {
- var vm = this
- },
- methods: {
- save: function() {
- var vm = this
- if(vm.name) {
- if(vm.name=='系统模板'){
- layer.msg('不能创建系统模板!', {
- icon: 5
- })
- return false
- }
- rehaAPI.createTemplate({
- doctor: docInfo.uid,
- title: vm.name,
- adminTeamCode:vm.$route.query.teamCode
- }).then(function(res) {
- if(res.status == 200) {
- vm.$router.push({
- path:'/template-items',
- query: {
- name: vm.name,
- isNew: true,
- templateId: res.data
- }
- })
- } else {
- toastr && toastr.error(res.msg)
- }
-
- }).catch(function(e) {
- console.error(e)
- })
- }
- }
- }
- }
|