| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- @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
|