修复打印机切换分类打印后,部分分类时无法选择商品分类问题
This commit is contained in:
@@ -7,8 +7,8 @@ VITE_APP_BASE_API=/dev-api
|
||||
# 接口地址
|
||||
|
||||
# VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 测试
|
||||
# VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式
|
||||
VITE_APP_API_URL=http://192.168.1.42/ # 本地
|
||||
VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式
|
||||
# VITE_APP_API_URL=http://192.168.1.42/ # 本地
|
||||
VITE_APP_API_PHP_URL=http://192.168.1.42:8000 #php抖音美团测试环境
|
||||
VITE_APP_API_PHP_IMPORT_URL=http://192.168.1.42:8789 #本地php批量导入
|
||||
# VITE_APP_API_PHP_IMPORT_URL=https://diftcs.sxczgkj.com #本地线上php批量导入
|
||||
|
||||
@@ -2,6 +2,7 @@ import printerApi, { type addRequest } from "@/api/account/printer";
|
||||
import { options } from './config'
|
||||
|
||||
import type { IModalConfig } from "@/components/CURD/types";
|
||||
import { c } from "vite/dist/node/moduleRunnerTransport.d-CXw_Ws6P";
|
||||
|
||||
const modalConfig: IModalConfig<addRequest> = {
|
||||
pageName: "sys:user",
|
||||
@@ -15,9 +16,13 @@ const modalConfig: IModalConfig<addRequest> = {
|
||||
},
|
||||
formAction: function (data) {
|
||||
let obj = { ...data }
|
||||
console.log("打印类型", data);
|
||||
obj.printType = data.printType.join(',')
|
||||
obj.categoryIds = JSON.stringify(data.categoryIdsArr)
|
||||
obj.categoryList = JSON.stringify(data.categoryIdsArr)
|
||||
if (data.classifyPrint == 0) {
|
||||
obj.categoryIds = ''
|
||||
}
|
||||
// obj.categoryIds = '[' + data.categoryIdsArr.join(',') + ']'
|
||||
return printerApi.add(obj);
|
||||
},
|
||||
|
||||
@@ -20,6 +20,9 @@ const modalConfig: IModalConfig<editRequest> = {
|
||||
obj.categoryIds = JSON.stringify(data.categoryIdsArr)
|
||||
obj.categoryList = JSON.stringify(data.categoryIdsArr)
|
||||
}
|
||||
if (data.classifyPrint == 0) {
|
||||
obj.categoryIds = ''
|
||||
}
|
||||
return printerApi.edit(obj);
|
||||
},
|
||||
beforeSubmit(data) {
|
||||
|
||||
@@ -2,23 +2,35 @@
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<!-- 搜索 -->
|
||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
||||
@reset-click="handleResetClick" />
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="handleQueryClick"
|
||||
@reset-click="handleResetClick"
|
||||
/>
|
||||
|
||||
<!-- 列表 -->
|
||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #contentType="scope">
|
||||
{{ scope.row.contentType == 'yxyPrinter' ? "云想印" : "飞鹅" }}
|
||||
{{ scope.row.contentType == "yxyPrinter" ? "云想印" : "飞鹅" }}
|
||||
</template>
|
||||
<template #subType="scope">
|
||||
{{ scope.row.subType == 'label' ? "标签" : "小票" }}
|
||||
{{ scope.row.subType == "label" ? "标签" : "小票" }}
|
||||
</template>
|
||||
<template #caozuo="scope">
|
||||
{{ scope }}
|
||||
@@ -28,8 +40,12 @@
|
||||
</template>
|
||||
<template #operate="scope">
|
||||
<div v-if="scope.row.connectionType != 'USB'">
|
||||
<el-button @click="handleEditClick(scope.row)" icon="Edit" type="primary" link>编辑</el-button>
|
||||
<el-button @click="handdeleteevent(scope.row)" icon="Delete" type="danger" link>删除</el-button>
|
||||
<el-button @click="handleEditClick(scope.row)" icon="Edit" type="primary" link>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="handdeleteevent(scope.row)" icon="Delete" type="danger" link>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <template #mobile="scope">
|
||||
@@ -55,7 +71,11 @@
|
||||
</page-modal>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
>
|
||||
<template #gender="scope">
|
||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||
</template>
|
||||
@@ -98,11 +118,11 @@ const {
|
||||
onMounted(() => {
|
||||
getPrinterType();
|
||||
});
|
||||
let PrinterTypeList = ref([])
|
||||
let PrinterTypeList = ref([]);
|
||||
// 获取商品分类
|
||||
async function getPrinterType() {
|
||||
let res = await UserAPI.getPrinterType();
|
||||
PrinterTypeList.value = res.records
|
||||
PrinterTypeList.value = res.records;
|
||||
}
|
||||
function handdeleteevent(item) {
|
||||
ElMessageBox.confirm("确认删除?", "警告", {
|
||||
@@ -114,7 +134,6 @@ function handdeleteevent(item) {
|
||||
ElMessage.success("删除成功");
|
||||
handleQueryClick();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
// 新增
|
||||
@@ -127,11 +146,15 @@ async function handleEditClick(row: IObject) {
|
||||
editModalRef.value?.setModalVisible();
|
||||
// 根据id获取数据进行填充
|
||||
let data = await UserAPI.get(row.id);
|
||||
data.printType = data.printType.split(',');
|
||||
data.printType = data.printType.split(",");
|
||||
|
||||
if (data.categoryIds) {
|
||||
data.categoryIdsArr = JSON.parse(data.categoryIds)
|
||||
data.categoryIdsArr = JSON.parse(data.categoryIds);
|
||||
} else {
|
||||
data.categoryIdsArr = [];
|
||||
}
|
||||
console.log(data.categoryIdsArr);
|
||||
console.log(data);
|
||||
|
||||
data.classifyPrint = data.classifyPrint * 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user