Merge branch 'dwb' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into test
This commit is contained in:
commit
c52422d4f6
|
|
@ -15,7 +15,6 @@ export function tbPrintMachine(data, method = 'post') {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 打印机切换
|
// 打印机切换
|
||||||
|
|
||||||
export function switchtbPrintMachine(data, method = 'post') {
|
export function switchtbPrintMachine(data, method = 'post') {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/shop-config/printer/update-status',
|
url: '/api/shop-config/printer/update-status',
|
||||||
|
|
@ -26,6 +25,14 @@ export function switchtbPrintMachine(data, method = 'post') {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 打印机部分
|
||||||
|
export function tbShopCategory(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/tbShopCategory',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 打印机列表
|
* 打印机列表
|
||||||
* @returns
|
* @returns
|
||||||
|
|
@ -35,7 +42,6 @@ export function tbPrintMachineGet(params) {
|
||||||
url: '/api/shop-config/printer/list',
|
url: '/api/shop-config/printer/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
|
|
||||||
...params
|
...params
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,13 @@
|
||||||
<el-radio label="1">部分分类</el-radio>
|
<el-radio label="1">部分分类</el-radio>
|
||||||
<!-- <el-radio label="2">部分商品</el-radio> -->
|
<!-- <el-radio label="2">部分商品</el-radio> -->
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
<div v-if="forms.classifyPrint == 1" style="margin-left:70px">
|
||||||
|
<el-tree :data="partList" show-checkbox node-key="id" ref="tree" :default-checked-keys="this.forms.categoryIds"
|
||||||
|
:props="{ children: 'childrenList', label: 'name' }">
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- <el-form-item label="桌台打印">
|
<!-- <el-form-item label="桌台打印">
|
||||||
<el-radio-group v-model="forms.tablePrint">
|
<el-radio-group v-model="forms.tablePrint">
|
||||||
<el-radio label="0">打印所有</el-radio>
|
<el-radio label="0">打印所有</el-radio>
|
||||||
|
|
@ -66,17 +72,18 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="打印方式">
|
<el-form-item label="打印方式">
|
||||||
<el-radio-group v-model="forms.printMethod">
|
<el-radio-group v-model="forms.printMethod">
|
||||||
<el-radio label="1">普通</el-radio>
|
<el-radio label="normal">普通出菜</el-radio>
|
||||||
<el-radio label="2">单个菜</el-radio>
|
<el-radio label="one">一菜一品</el-radio>
|
||||||
|
<el-radio label="callTicket">排队取号</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="打印类型">
|
<!-- <el-form-item label="打印类型">
|
||||||
<el-checkbox-group v-model="forms.printType">
|
<el-checkbox-group v-model="forms.printType">
|
||||||
<el-checkbox label="1">确认退款单</el-checkbox>
|
<el-checkbox label="1">确认退款单</el-checkbox>
|
||||||
<el-checkbox label="2">交班单</el-checkbox>
|
<el-checkbox label="2">交班单</el-checkbox>
|
||||||
<el-checkbox label="3">排队取号</el-checkbox>
|
<el-checkbox label="3">排队取号</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="打印单据">
|
<el-form-item label="打印单据">
|
||||||
<el-radio-group v-model="forms.printReceipt">
|
<el-radio-group v-model="forms.printReceipt">
|
||||||
<el-radio label="0">全部打印</el-radio>
|
<el-radio label="0">全部打印</el-radio>
|
||||||
|
|
@ -97,7 +104,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { configprinter, printerd } from '@/api/devices'
|
import { configprinter, printerd, tbShopCategory } from '@/api/devices'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
|
|
@ -107,7 +114,8 @@ export default {
|
||||||
sort: "0",
|
sort: "0",
|
||||||
status: "0",
|
status: "0",
|
||||||
connectionType: "network", printType: []
|
connectionType: "network", printType: []
|
||||||
}
|
},
|
||||||
|
partList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
|
@ -116,15 +124,29 @@ export default {
|
||||||
if (this.$route.query.id) {
|
if (this.$route.query.id) {
|
||||||
this.getList(this.$route.query.id)
|
this.getList(this.$route.query.id)
|
||||||
}
|
}
|
||||||
|
this.getpartList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleNodeClick(d) { console.log(d) },
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
|
|
||||||
// 删除时间字段
|
// 删除时间字段
|
||||||
if( this.$route.query.id ){
|
if (this.$route.query.id) {
|
||||||
delete this.forms.createdAt
|
delete this.forms.createdAt
|
||||||
delete this.forms.updatedAt
|
delete this.forms.updatedAt
|
||||||
}
|
}
|
||||||
|
// 处理打印部分分类
|
||||||
|
if (this.forms.classifyPrint == 1) {
|
||||||
|
let data = this.$refs.tree.getCheckedNodes()
|
||||||
|
let idstr = ''
|
||||||
|
let arr = []
|
||||||
|
data.forEach(element => {
|
||||||
|
idstr += element.id + ','
|
||||||
|
arr.push({ id: element.id, name: element.name })
|
||||||
|
});
|
||||||
|
this.forms.categoryList = JSON.stringify(arr)
|
||||||
|
this.forms.categoryIds = idstr.substring(0, idstr.length - 1)
|
||||||
|
}
|
||||||
|
|
||||||
const res = await configprinter({
|
const res = await configprinter({
|
||||||
shopId: localStorage.getItem('shopId'),
|
shopId: localStorage.getItem('shopId'),
|
||||||
|
|
@ -134,10 +156,26 @@ if( this.$route.query.id ){
|
||||||
)
|
)
|
||||||
this.$router.go(-1)
|
this.$router.go(-1)
|
||||||
},
|
},
|
||||||
|
async getpartList() {
|
||||||
|
const res = await tbShopCategory({
|
||||||
|
shopId: localStorage.getItem('shopId'),
|
||||||
|
sort: "sort,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 500
|
||||||
|
})
|
||||||
|
this.partList = res.content
|
||||||
|
},
|
||||||
async getList(id) {
|
async getList(id) {
|
||||||
const res = await printerd(id)
|
const res = await printerd(id)
|
||||||
this.forms = res
|
this.forms = res
|
||||||
this.forms.printType = JSON.parse(res.printType)
|
this.forms.categoryIds=this.forms.categoryIds.split(',')
|
||||||
|
console.log(this.forms.categoryIds,'调试11111')
|
||||||
|
if (res.printType) {
|
||||||
|
this.forms.printType = JSON.parse(res.printType)
|
||||||
|
} else {
|
||||||
|
this.forms.printType = []
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue