diff --git a/src/api/superStore/super.js b/src/api/superStore/super.js
index 74ca7048..49315e2f 100644
--- a/src/api/superStore/super.js
+++ b/src/api/superStore/super.js
@@ -57,7 +57,7 @@ export function deleteSupermarketApi(data) {
}
})
}
-
+
// 通过角色查人员
export function userListByRoleApi(data) {
return request({
@@ -69,6 +69,17 @@ export function deleteSupermarketApi(data) {
data: data
})
}
+// 商品列表
+export function shopPageListApi(data) {
+ return request({
+ url: '/smart-canteen/supermarket_product/list',
+ method: 'get',
+ headers: {
+ "merchant-id":"378915229716713472",
+ },
+ params: data
+ })
+ }
@@ -79,4 +90,3 @@ export function deleteSupermarketApi(data) {
-
diff --git a/src/views/superstore/shopMaterial/index.vue b/src/views/superstore/shopMaterial/index.vue
index 3bb573f2..1bd42789 100644
--- a/src/views/superstore/shopMaterial/index.vue
+++ b/src/views/superstore/shopMaterial/index.vue
@@ -78,11 +78,11 @@
:inline="true"
v-show="showSearch"
label-width="68px"
- >
+ >
-
+
批量删除
-
+
@@ -189,22 +189,22 @@
{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}
-
-
-
-
-
-
+
+
+
+
+
+
{{ (scope.row.unitPrice/100).toFixed(2)||"" }}
-
+
-
+
{{ (scope.row.salePrice/100).toFixed(2)||"" }}
-
-
+
+
-
+
-
+
@@ -323,7 +323,7 @@ export default {
areaId:null,
materialName:"",
barCode:"",
- materialCode:"",
+ materialCode:"",
materialTypeIds:[]
},
// 总条数
@@ -351,13 +351,13 @@ export default {
},
]
},
- parentId: undefined,
+ parentId: undefined,
treeAreaOptions:[],//区域树
- batchIds:[],
+ batchIds:[],
//导入参数
- upload: {
+ upload: {
// 是否禁用上传
- isUploading: false,
+ isUploading: false,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
@@ -384,26 +384,26 @@ export default {
/** 查询新增页面-上级类型下拉树结构 */
getTreeData() {
shopMaterialTreeApi().then((response) => {
- this.treeOptions = this.handleTree(response.rows,'materialTypeId');
+ this.treeOptions = this.handleTree(response.rows,'materialTypeId');
this.addLevel(this.treeOptions)
- console.log("this.treeOptions",this.treeOptions)
- if(this.treeOptions && this.treeOptions.length > 0){
+ console.log("this.treeOptions",this.treeOptions)
+ if(this.treeOptions && this.treeOptions.length > 0){
this.getList();
- } else {
+ } else {
this.getList();
}
});
},
handleTree(data, idKey, parentIdKey = 'parentId', childrenKey = 'children') {
// 用于存储节点数据的Map,以idKey为键
- const nodeMap = new Map();
+ const nodeMap = new Map();
// 用于存储根节点的数组
- const rootNodes = [];
+ const rootNodes = [];
// 遍历数据,构建nodeMap并找到根节点
data.forEach(node => {
// 将节点添加到nodeMap中,并初始化children为空数组
- nodeMap.set(node[idKey], { ...node, [childrenKey]: [] });
+ nodeMap.set(node[idKey], { ...node, [childrenKey]: [] });
// 如果parentId为null或父节点不存在于nodeMap中,则该节点为根节点
if (node[parentIdKey] === null || !nodeMap.has(node[parentIdKey])) {
// 将根节点添加到rootNodes数组中
@@ -418,12 +418,12 @@ export default {
});
// 返回根节点数组,它现在包含了完整的树形结构
- return rootNodes;
+ return rootNodes;
},
addLevel(nodes, level = 0) {
nodes.forEach(node => {
- node.level = level; // 设置当前节点的层级
- if (node.children) { // 如果节点有子节点,递归处理子节点
+ node.level = level; // 设置当前节点的层级
+ if (node.children) { // 如果节点有子节点,递归处理子节点
this.addLevel(node.children, level + 1);
}
});
@@ -433,19 +433,19 @@ export default {
console.log(data)
// this.handleQuery();
},
- handleCheckChange(data, checked, indeterminate) {
+ handleCheckChange(data, checked, indeterminate) {
this.handleQuery();
},
/* 树节点增加 */
appendTreeNode(data) {
console.log(data)
- this.isEditType=false;
+ this.isEditType=false;
this.form={}
this.resetForm("form");
- this.$set(this.form,"parentId",data.materialTypeId)
+ this.$set(this.form,"parentId",data.materialTypeId)
this.open = true;
this.title = "新增";
- },
+ },
/* 树节点修改 */
editTreeNode(data) {
this.isEditType=true;
@@ -516,7 +516,7 @@ export default {
}
});
},
-
+
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@@ -526,7 +526,7 @@ export default {
resetQuery() {
this.resetForm("queryForm");
this.queryParams.pageNum = 1;
- this.queryParams.pageSize = 10;
+ this.queryParams.pageSize = 10;
this.handleQuery();
},
/** 查询列表 */
@@ -539,7 +539,7 @@ export default {
"areaId": this.queryParams.areaId,
"materialName": this.queryParams.materialName,
"barCode": this.queryParams.barCode,
- "materialCode": this.queryParams.materialCode,
+ "materialCode": this.queryParams.materialCode,
"materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
}
getMaterialListApi(params).then((response) => {
@@ -551,7 +551,7 @@ export default {
//新增修改弹窗-区域树
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
- this.treeAreaOptions = response.data;
+ this.treeAreaOptions = response.data;
});
},
/** 新增按钮操作 */
@@ -563,7 +563,7 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.title = "修改";
- this.dialogVisible = true;
+ this.dialogVisible = true;
// 在显示对话框后,可以通过 $refs 访问子组件方法设置表单数据
this.$nextTick(() => {
// 假设子组件提供了 setFormData 方法
@@ -600,10 +600,10 @@ export default {
this.getList();
})
.catch(() => {});
- },
+ },
handleSelectionChange(selection){
this.batchIds = []
- this.batchIds = selection.map((item) => item.materialId)
+ this.batchIds = selection.map((item) => item.materialId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
@@ -611,11 +611,11 @@ export default {
handleBatchDel(){
console.log(this.batchIds)
removeMaterialApi({"materialId":this.batchIds.join(",")}).then(response => {
- this.$modal.msgSuccess("删除成功");
+ this.$modal.msgSuccess("删除成功");
this.$refs.multipleTable.clearSelection()
this.getList();
});
- },
+ },
//批量导入
// /api/v1/menumaterial/batch/import/material
@@ -624,7 +624,7 @@ export default {
this.upload.isUploading = true
},
// 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
+ handleFileSuccess(response, file, fileList) {
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$modal.msgSuccess("后台导入中,请稍后刷新列表!");
@@ -637,7 +637,7 @@ export default {
downloadFileByUrl(url)
},
-
+
// getParentName(list, id) {
// try {
// list.forEach((e) => {
@@ -652,7 +652,7 @@ export default {
// });
// } catch (error) {}
// },
-
+
},
};
diff --git a/src/views/superstore/super/index.vue b/src/views/superstore/super/index.vue
index ac518816..c7656c6c 100644
--- a/src/views/superstore/super/index.vue
+++ b/src/views/superstore/super/index.vue
@@ -2,7 +2,7 @@
-
@@ -14,14 +14,14 @@
:label="item.warehouseName"
:value="item.warehouseId"
>
-
-
+
+
搜索
重置
-
+
新增
-
-
+
+
-
+
{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}
-
+
@@ -57,32 +57,36 @@
无
-
+
未开启
-
+
-
商品
+ 编辑
删除
-
+
-
+
@@ -101,13 +105,13 @@
-
+
-
+
-
+
-
+
-
+
-
+
- (baseForm.mobile=v.replace(/[^\d]/g,''))"/>
-
-
-
-
+
-
+
(baseForm.minDeliveryTime=v.replace(/[^\d]/g,''))"/>
-
-
+
+
-
+
-
+
(baseForm.refundLimitTime=v.replace(/[^\d]/g,''))"/>
-
-
+
+
(baseForm.mealCode=v.replace(/[^\d]/g,''))"/>
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
@@ -663,4 +1162,3 @@
}
}
-
\ No newline at end of file