<template>
|
<GlobalWindow
|
:title="title"
|
:visible.sync="visible"
|
:confirm-working="isWorking"
|
@confirm="confirm"
|
>
|
<div class="tip-warn" >
|
<i class="el-icon-warning"></i>
|
正在为门店【<span style="color: red;font-weight: 600;">{{form.name}}</span>】设置打印机信息</div>
|
<el-form :model="form" ref="form" :rules="rules">
|
<el-form-item label="打印机序列号" prop="printerSn">
|
<el-input v-model="form.printerSn" placeholder="请输入排序码" v-trim/>
|
</el-form-item>
|
</el-form>
|
</GlobalWindow>
|
</template>
|
|
<script>
|
import BaseOpera from '@/components/base/BaseOpera'
|
import GlobalWindow from '@/components/common/GlobalWindow'
|
import {maintainPrinter} from '@/api/business/shopInfo'
|
export default {
|
name: 'OperaCategoryWindow',
|
extends: BaseOpera,
|
components: { GlobalWindow },
|
data () {
|
return {
|
isUploading: false,
|
// 表单数据
|
form: {
|
id: null,
|
name: null,
|
printerSn: ''
|
},
|
// 验证规则
|
rules: {
|
printerSn: [{ required: true, message: '请输入打印机序列号' }]
|
}
|
}
|
},
|
methods: {
|
open (title, target) {
|
console.log("=======================",target)
|
this.title = title
|
this.visible = true
|
this.form = target
|
|
console.log("=======================", this.form)
|
},
|
__confirmEdit () {
|
this.$refs.form.validate((valid) => {
|
if (!valid) {
|
return
|
}
|
// 调用更新接口
|
this.isWorking = true
|
maintainPrinter(this.form)
|
.then(() => {
|
this.visible = false
|
this.$tip.apiSuccess('修改成功')
|
this.$emit('success')
|
})
|
.catch(e => {
|
this.$tip.apiFailed(e)
|
})
|
.finally(() => {
|
this.isWorking = false
|
})
|
})
|
}
|
}
|
}
|
</script>
|