160 lines
6.0 KiB
PHP
160 lines
6.0 KiB
PHP
@extends('layouts.base')
|
|
|
|
@section('content')
|
|
@section('title', '打印机信息')
|
|
<link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}" />
|
|
<style>
|
|
.box-top {
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
<div id="app">
|
|
<div class="all">
|
|
<div class="vue-head">
|
|
<div class="vue-main-title">
|
|
<div class="vue-main-title-left"></div>
|
|
<div class="vue-main-title-content">打印机信息</div>
|
|
</div>
|
|
<div style="padding:0 50px ;">
|
|
<el-card class="box-card">
|
|
<div class="top-box">
|
|
USER与UKEY, 请前往飞鹅注册查看
|
|
</div>
|
|
</el-card>
|
|
</div>
|
|
<div style="padding: 50px 100px;">
|
|
<el-form label-position="right" label-width="80px" :model="form">
|
|
<el-form-item label="打印机名称" label-width="100px">
|
|
<el-input placeholder="请输入打印机名称" v-model="form.title" style="width: 700px;;"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="USER" label-width="100px">
|
|
<el-input placeholder="请输入USER" v-model="form.user" style="width: 700px;;"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="UKEY" label-width="100px">
|
|
<el-input placeholder="请输入UKEY" v-model="form.ukey" style="width: 700px;;"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="打印机编号" label-width="100px">
|
|
<el-input placeholder="请输入打印机编号" v-model="form.printer_sn" style="width: 700px;;"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="打印联数" label-width="100px">
|
|
<el-input placeholder="请输入打印联数" v-model="form.times" style="width: 700px;;"></el-input>
|
|
<p class="help-block">打印联数上限为5联</p>
|
|
</el-form-item>
|
|
<el-form-item label="是否开启" label-width="100px">
|
|
<el-switch v-model="form.status" active-color="#29ba9c" inactive-color="#dcdfe6" :active-value="1" :inactive-value="0">
|
|
</el-switch>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<div class="vue-page">
|
|
<div class="vue-center">
|
|
<el-button type="primary" @click="submit">提交</el-button>
|
|
<el-button @click="backTo">返回列表</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script language='javascript'>
|
|
let id = "{{ request()-> id }}"
|
|
//vue
|
|
var app = new Vue({
|
|
el: "#app",
|
|
delimiters: ['[[', ']]'],
|
|
data() {
|
|
return {
|
|
form: {
|
|
title: '',
|
|
user:'',
|
|
ukey:'',
|
|
printer_sn:'',
|
|
times:null,
|
|
status:0
|
|
},
|
|
}
|
|
},
|
|
computed: {
|
|
|
|
},
|
|
mounted() {
|
|
if (id) {
|
|
this.getTempDetail(id)
|
|
}
|
|
},
|
|
methods: {
|
|
//返回列表
|
|
backTo() {
|
|
let url = "{!! yzWebUrl('plugin.printer.admin.list.index') !!}"
|
|
window.location.href = url
|
|
},
|
|
//提交表单
|
|
submit() {
|
|
if (id) {
|
|
this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.list.edit') !!}", {
|
|
printer: {
|
|
id,
|
|
title: this.form.title,
|
|
user: this.form.user,
|
|
ukey: this.form.ukey,
|
|
printer_sn: this.form.printer_sn,
|
|
times: this.form.times,
|
|
status : this.form.status,
|
|
}
|
|
}).then((res) => {
|
|
if (res.data.result) {
|
|
this.$message.success(res.data.msg)
|
|
let url = "{!! yzWebUrl('plugin.printer.admin.list.index') !!}"
|
|
window.location.href = url
|
|
} else {
|
|
this.$message.error(res.data.msg);
|
|
|
|
}
|
|
})
|
|
|
|
} else {
|
|
this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.list.add') !!}", {
|
|
printer: {
|
|
id,
|
|
title: this.form.title,
|
|
user: this.form.user,
|
|
ukey: this.form.ukey,
|
|
printer_sn: this.form.printer_sn,
|
|
times: this.form.times,
|
|
status : this.form.status,
|
|
}
|
|
}).then((res) => {
|
|
if (res.data.result) {
|
|
this.$message.success(res.data.msg)
|
|
let url = "{!! yzWebUrl('plugin.printer.admin.list.index') !!}"
|
|
window.location.href = url
|
|
|
|
} else {
|
|
this.$message.error(res.data.msg);
|
|
|
|
}
|
|
})
|
|
}
|
|
},
|
|
//获取模板详情
|
|
getTempDetail(id) {
|
|
this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.list.info') !!}", {
|
|
id
|
|
}).then((res) => {
|
|
if (res.data.result) {
|
|
let data = res.data.data
|
|
this.form.title = data.title
|
|
this.form.user = data.user
|
|
this.form.ukey = data.ukey
|
|
this.form.printer_sn = data.printer_sn
|
|
this.form.times = data.times
|
|
this.form.status = data.status
|
|
} else {
|
|
this.$message.error(res.data.msg);
|
|
|
|
}
|
|
})
|
|
}
|
|
},
|
|
})
|
|
</script>
|
|
@endsection |