bztang-admin/plugins/printer/views/admin/set.blade.php

147 lines
6.3 KiB
PHP

@extends('layouts.base')
@section('content')
@section('title', '打印设置')
<link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}" />
<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: 50px 100px;">
<el-form ref="form" :model="form" label-width="10%">
<el-form-item label="打印机">
<el-row :gutter="3">
<el-col :span="12">
<div class="grid-content bg-purple">
<template>
<el-select v-model="form.printer_id" placeholder="请选择">
<el-option
v-for="item in printers"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</template>
</div>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="打印模板">
<el-row :gutter="3">
<el-col :span="12">
<template>
<el-select style="width: 100%" v-model="form.temp_id" placeholder="请选择打印模板">
<el-option
v-for="item in temps"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</template>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="订单打印方式" >
<el-row :gutter="3">
<el-col :span="12">
<template>
<el-checkbox-group v-model="form.print_type">
<el-checkbox label="1">订单下单</el-checkbox>
<el-checkbox label="2">订单支付</el-checkbox>
</el-checkbox-group>
</template>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="打印订单类型" v-if="show.show">
<template>
<el-checkbox-group v-model="form.print_order_type">
<el-checkbox label="1" v-if="show.is_store?show.is_store:false">门店</el-checkbox>
<el-checkbox label="2"v-if="show.is_store?show.is_store:false">收银台</el-checkbox>
<el-checkbox label="3" v-if="show['has_fight-groups']?show['has_fight-groups']:false">拼团</el-checkbox>
<el-checkbox label="4" v-if="show['has_lease-toy']?show['has_lease-toy']:false">租赁</el-checkbox>
<el-checkbox label="5" v-if="show.has_supplier?show.has_supplier:false">供应商</el-checkbox>
</el-checkbox-group>
</template>
</el-form-item>
</el-form>
</div>
</div>
<div class="vue-page">
<div class="vue-center">
<el-button type="primary" @click.native.prevent="onSubmit"
>提交
</el-button>
</div>
</div>
</div>
</div>
<script>
var app = new Vue({
el: '#app',
delimiters: ['[[', ']]'],
data() {
return {
form: {
id:'',
printer_id: null,
print_type: [],
temp_id:null,
print_order_type:[]
},
printers: [],
temps: [],
show:{}
}
},
mounted(){
this.getSet()
},
methods: {
onSubmit() {
this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.set.update') !!}", {
setdata:{
...this.form
}
}).then(res => {
if (res.data.result) {
this.$message.success(res.data.msg);
this.getSet()
} else {
this.$message.error(res.data.msg);
}
})
},
//获取设置数据
getSet(){
this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.set.detail') !!}", {
}).then(res => {
if (res.data.result) {
this.show = res.data.data.show
this.temps = res.data.data.temps
this.printers =res.data.data.printers
this.form.print_type = res.data.data.print_set?res.data.data.print_set.print_type:[]
this.form.printer_id=res.data.data.print_set?res.data.data.print_set.printer_id:null
this.form.temp_id=res.data.data.print_set?res.data.data.print_set.temp_id:null
this.form.id=res.data.data.print_set?res.data.data.print_set.id:null
this.form.print_order_type = res.data.data.print_set.print_order_type?res.data.data.print_set.print_order_type:[]
} else {
this.$message.error(res.data.msg);
}
})
}
}
});
</script>
@endsection