商超管理接口对接,轮播图管理,app更新

This commit is contained in:
zzyuan 2025-05-12 18:09:20 +08:00
parent 63d955e57c
commit d62b8344b5
15 changed files with 938 additions and 239 deletions

View File

@ -1,5 +1,88 @@
import request from '@/utils/request'
// ---------- 基础设置 ------------------
//基础设置
export function queryBaseSettingApi(data) {
return request({
url: '/smart-canteen/android/baseSetting/getBaseSettingByKey',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
//基础设置
export function saveBaseSettingApi(data) {
return request({
url: '/smart-canteen/android/baseSetting/addBaseSetting',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// ---------- 轮播图 ------------------
// 查询轮播图列表
export function getCarouselListApi(data) {
return request({
url: '/smart-canteen/android/baseSetting/getCarouselImage',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 新增轮播图
export function addCarouselApi(data) {
return request({
url: '/smart-canteen/android/baseSetting/addCarouseImage',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 编辑轮播图
export function updateCarouselApi(data) {
return request({
url: '/smart-canteen/android/baseSetting/updateCarouseImageById',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除轮播图
export function removeCarouselApi(data) {
return request({
url: '/smart-canteen/android/baseSetting/delCarouseImageById',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 来源下拉数据
export function getSourceTypeListApi(data) {
return request({

View File

@ -79,7 +79,17 @@ export function getMenuRecipeDetailApi(data) {
// 上传APK
export function uploadApkApi(data) {
return request({
url: '/smart-canteen/doubleScreenMachine/uploadApk',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -1,9 +1,9 @@
import request from '@/utils/request'
// 原料类别
// 商品类别
export function systemMaterialTreeApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterialcategory/tree/list',
url: '/smart-canteen/menu_material_category/getTree',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -11,10 +11,10 @@ export function systemMaterialTreeApi(data) {
data: data
})
}
// 新增原料类别
// 新增商品类别
export function addMaterialTypeApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterialcategory/add',
url: '/smart-canteen/menu_material_category/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -22,10 +22,10 @@ export function addMaterialTypeApi(data) {
data: data
})
}
//修改原料类别
//修改商品类别
export function updateMaterialTypeApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterialcategory/edit',
url: '/smart-canteen/menu_material_category/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -33,10 +33,10 @@ export function updateMaterialTypeApi(data) {
data: data
})
}
//删除原料类别
//删除商品类别
export function removeMaterialTypeApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterialcategory/remove',
url: '/smart-canteen/menu_material_category/del',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -44,35 +44,24 @@ export function removeMaterialTypeApi(data) {
data: data
})
}
// 系统区域权限树
export function systemAreaTreeApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/area/system-auth/tree',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询原料列表
// 查询商品列表
export function getMaterialListApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterial/page',
method: 'post',
url: '/smart-canteen/supermarket_product/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
params: data
})
}
// 新增原料
// 新增商品
export function addMaterialApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterial/add',
url: '/smart-canteen/supermarket_product/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -81,10 +70,10 @@ export function addMaterialApi(data) {
})
}
// 编辑原料
// 编辑商品
export function updateMaterialApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterial/edit',
url: '/smart-canteen/supermarket_product/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -93,20 +82,10 @@ export function updateMaterialApi(data) {
})
}
// 删除原料
// 删除商品
export function removeMaterialApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterial/remove/'+data.materialId,
method: 'post',
headers: {
"merchant-id":"378915229716713472",
}
})
}
// 批量删除原料
export function batchRemoveMaterialApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterial/remove/batch',
url: '/smart-canteen/supermarket_product/del',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -114,7 +93,18 @@ export function batchRemoveMaterialApi(data) {
data: data
})
}
// 批量修改原料
// 批量删除商品
export function batchRemoveMaterialApi(data) {
return request({
url: '/smart-canteen/supermarket_product/dels',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 批量修改商品
export function batchUpdateMaterialApi(data) {
return request({
url: '/smart-canteen/api/v1/menumaterial/material/batch/update/category',
@ -125,15 +115,15 @@ export function batchUpdateMaterialApi(data) {
data: data
})
}
// 根据区域ID-获取原料单位下拉选
// 根据区域ID-获取商品单位下拉选
//{current: 1, size: -1, ifListUse: 1, areaId: '421488254718578688'}
export function getDrpUnitListApi(data) {
return request({
url: '/smart-canteen//api/v1/drpunit/page',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
return request({
url: '/smart-canteen/supermarket_unit/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
params: data
})
}

View File

@ -3,12 +3,12 @@ import request from '@/utils/request'
// 仓库
export function drpWareHousePageApi(data) {
return request({
url: '/smart-canteen/api/v1/drpwarehouse/page',
method: 'post',
url: '/smart-canteen/warehouse_info/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
params: data
})
}
@ -16,18 +16,18 @@ export function drpWareHousePageApi(data) {
// 超市列表
export function supermarketPageListApi(data) {
return request({
url: '/smart-canteen/api/v1/basics-supermarket/page-supermarket',
method: 'post',
url: '/smart-canteen/supermarket_info/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
params: data
})
}
// 超市列表-新增
export function insertSupermarketApi(data) {
return request({
url: '/smart-canteen/api/v1/basics-supermarket/insert-supermarket',
url: '/smart-canteen/supermarket_info/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -38,7 +38,7 @@ export function insertSupermarketApi(data) {
// 超市列表-编辑
export function editSupermarketApi(data) {
return request({
url: '/smart-canteen/api/v1/basics-supermarket/edit-supermarket',
url: '/smart-canteen/supermarket_info/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -50,7 +50,7 @@ export function editSupermarketApi(data) {
// 超市列表-删除
export function deleteSupermarketApi(data) {
return request({
url: '/smart-canteen/api/v1/basics-supermarket/delete-supermarket',
url: '/smart-canteen/supermarket_info/del',
method: 'post',
headers: {
"merchant-id":"378915229716713472",

View File

@ -15,19 +15,19 @@ export function systemAreaTreeApi(data) {
// 单位列表-分页
export function drpUnitPageListApi(data) {
return request({
url: '/smart-canteen/api/v1/drpunit/page',
method: 'post',
url: '/smart-canteen/supermarket_unit/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
params: data
})
}
// 单位列表-新增
export function addDrpUnitApi(data) {
return request({
url: '/smart-canteen/api/v1/drpunit/add',
url: '/smart-canteen/supermarket_unit/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -39,7 +39,7 @@ export function addDrpUnitApi(data) {
// 单位列表-编辑
export function editDrpUnitApi(data) {
return request({
url: '/smart-canteen/api/v1/drpunit/edit',
url: '/smart-canteen/supermarket_unit/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -49,14 +49,14 @@ export function editDrpUnitApi(data) {
}
// 单位列表-删除
export function removeDrpUnitApi(unitId) {
export function removeDrpUnitApi(data) {
return request({
url: '/smart-canteen/api/v1/drpunit/remove/'+unitId,
url: '/smart-canteen/supermarket_unit/del',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
// data: data
data: data
})
}

View File

@ -40,6 +40,11 @@
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="食堂名称" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150" fixed="left"/>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="负责人" align="center" prop="director" :show-overflow-tooltip="true" width="120"/>

View File

@ -22,6 +22,11 @@
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="编号" align="center" prop="canteenNum" :show-overflow-tooltip="true" width="100" fixed="left"/>
<el-table-column label="名称" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150" fixed="left"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">

View File

@ -49,6 +49,11 @@
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true" width="180" fixed="left"/>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" width="160"/>

View File

@ -0,0 +1,382 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称">
<el-input v-model="queryParams.imageName" placeholder="请输入名称" maxlength="20" clearable style="width: 220px"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="名称" align="center" prop="imageName" :show-overflow-tooltip="true"/>
<el-table-column label="外链" align="center" prop="externalUrl" :show-overflow-tooltip="true"/>
<el-table-column label="图片" align="center" prop="imageUrl">
<template slot-scope="scope">
<img :src="scope.row.imageUrl" v-if="scope.row.imageUrl" alt="" style="width: 80px;height: 40px;" @click="openImg(scope.row)">
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="图片地址" align="center" prop="imageUrl" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
<el-table-column label="更新时间" align="center" prop="updateTime" :show-overflow-tooltip="true"/>
<el-table-column label="启用" align="center" prop="isEnabled" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isEnabled"
active-value="0"
inactive-value="2"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="名称" prop="imageName">
<el-input v-model="form.imageName" placeholder="请输入名称" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="外链地址" prop="externalUrl">
<el-input v-model="form.externalUrl" placeholder="请输入外链地址" maxlength="100" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="图片地址">
<el-input v-model="form.imageUrl" placeholder="图片地址" disabled clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="图片" prop="imageUrl">
<el-upload
:http-request="
(obj) => imgUpLoad(obj, 'fileUrl')
"
action="#"
:limit="1"
:file-list="fileList"
:show-file-list="true"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:on-change="handleFileChange"
:on-success="handleAvatarSuccess"
:class="{ disabled: uploadDisabled }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
<span>* 提示图片宽高比例为750px*520px</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { getCarouselListApi,addCarouselApi,updateCarouselApi,removeCarouselApi } from "@/api/base/mobile.js";
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
imageName: undefined,
},
//
form: {},
//
rules: {
imageName: [
{ required: true, message: "名称不能为空", trigger: "blur" }
],
imageUrl: [
{ required: true, message: "图片不能为空", trigger: "change" }
]
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
};
},
created() {
this.getList();
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
// "pageNum": this.queryParams.pageNum,
// "pageSize": this.queryParams.pageSize,
"imageName": this.queryParams.imageName
}
getCarouselListApi(param).then(response => {
this.tableListData = response.data;
// this.total = Number(response.total);
this.loading = false;
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = Object.assign({}, row)
if(this.form.imageUrl){
this.fileList=[{url:this.form.imageUrl}]
this.checkUrlList=[this.form.imageUrl]
}else{
this.fileList=[]
this.checkUrlList=[]
}
this.open = true;
this.title = "修改";
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.checkUrlList=[]
this.checkUrlNameList=[]
this.fileList=[]
this.form = {};
this.resetForm("form");
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.imageUrl = this.checkUrlList[0]
if (this.form.id != undefined) {
updateCarouselApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCarouselApi(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleStatusChange(row){
let param = {
id:row.id,
imageName:row.imageName,
externalUrl:row.externalUrl,
imageUrl:row.imageUrl,
}
if(row.isEnabled==0){
param.isEnabled=2
}else{
param.isEnabled=0
}
console.log(param)
updateCarouselApi(param).then(response => {
this.$modal.msgSuccess("修改成功");
this.getList();
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return removeCarouselApi({id:row.id});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//
imgUpLoad(param, name, index) {
// console.log(param,'image')
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
this.form.imageUrl = this.checkUrlList[0]
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
checkImageSize(file, fileType) {
const reader = new FileReader();
reader.onload = (e) => {
const img = new Image();
img.onload = () => {
const { width, height } = img;
//
const MAX_WIDTH = 750;
const MAX_HEIGHT = 520;
console.log(width)
console.log(height)
if (width <= MAX_WIDTH && height <= MAX_HEIGHT) {
this.form[fileType] = file.raw
this.$refs['form'].validateField(fileType)
this.$message.success(`图片尺寸符合要求: ${width}x${height}`);
} else {
this.$message.error(`图片尺寸不能超过 ${MAX_WIDTH}x${MAX_HEIGHT}`);
//
this.form[fileType] = ''
this.$refs['form'].validateField(fileType)
}
};
img.src = e.target.result;
};
reader.readAsDataURL(file.raw);
},
handleFileChange(file){
this.checkImageSize(file,'imageUrl');
},
handleAvatarSuccess(res, file) {
console.log('success')
},
handleExceed(files, fileList) {
this.$message.warning('最多只可以上传一张图片')
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
},
//
handlePictureCardPreview(file) {
console.log(file)
this.dialogImageUrl = file.url
this.dialogVisible = true
}
}
};
</script>
<style lang="scss" scoped>
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>

View File

@ -0,0 +1,73 @@
<template>
<div class="app-container">
<h2 style="font-weight: bold;">基础设置</h2>
<div style="width: 100%;margin: 10px auto;border: 1px solid #ccc;padding: 10px;border-radius: 10px;">
<h3 style="font-weight: bold;">其他</h3>
<div class="item">
<div>
<div>
<span>首页标题</span>
<el-input
v-model="indexTitle" style="width: 200px;margin-left: 20px;"
auto-complete="off"
placeholder="首页标题"
></el-input>
</div>
<div style="color: #999;">用于移动端修改首页标题默认为智慧食堂可根据需求进行修改</div>
</div>
<div style="padding: 30px 20px;">
<!-- <el-switch
v-model="accBaseSubData.ifSubManualReceive"
active-value="1"
inactive-value="2">
</el-switch> -->
</div>
</div>
</div>
<div style="width: 100%;display: flex;justify-content: center;">
<el-button type="primary" @click="saveBaseSet">保存</el-button>
</div>
</div>
</template>
<script>
import { queryBaseSettingApi,saveBaseSettingApi } from "@/api/base/mobile.js";
export default {
name: "",
dicts: [],
data() {
return {
indexTitle:""
};
},
created() {
this.queryAccBaseSub()
},
methods: {
queryAccBaseSub(){
queryBaseSettingApi({"key": "首页标题"}).then(response => {
this.indexTitle = response.data.value||""
});
},
saveBaseSet(){
let param = {
"key": "首页标题",
"value": this.indexTitle
}
saveBaseSettingApi(param).then(response => {
this.$message.success("保存成功");
this.queryAccBaseSub()
});
}
}
};
</script>
<style scoped>
.item{
width: 96%;margin: 10px auto;border: 1px solid #ccc;padding: 20px 10px;border-radius: 8px;display: flex;justify-content: space-between;align-items: center;
}
</style>

View File

@ -53,6 +53,13 @@
size="mini"
@click="handleAdd"
>新增</el-button>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleApp"
>更新APP</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -255,7 +262,80 @@
</div>
</el-dialog>
<el-dialog title="更新APP" :visible.sync="openApp" width="800px" append-to-body>
<el-form :model="appForm" ref="appForm" size="small" :rules="appFormRules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="APP版本号" prop="version">
<el-input v-model="appForm.version" placeholder="请输入APP版本号" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="版本号名称" prop="versionName">
<el-input v-model="appForm.versionName" placeholder="请输入版本号名称" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="更新内容" prop="updateContent">
<el-input v-model="appForm.updateContent" type="textarea" :rows="3" placeholder="请输入更新内容" maxlength="150" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="APP类型" prop="type">
<el-select v-model="appForm.type" placeholder="请选择" style="width: 100%;">
<el-option label="食堂APP" :value="1"></el-option>
<el-option label="超市APP" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="APP名称" prop="apkName">
<el-input v-model="appForm.apkName" placeholder="请输入APP名称" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="APP路径" prop="apkPath">
<el-input v-model="appForm.apkPath" placeholder="请上传App" readonly clearable style="width: 100%;"/>
</el-form-item>
</el-col>
<el-col :span="4" style="display: flex;justify-content: center;align-items: center;">
<el-upload
ref="upload"
:limit="1"
:headers="upload.headers"
:action="upload.url"
accept=".apk"
:show-file-list="false"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
>
<el-button
type="primary"
size="mini"
>上传App
</el-button>
</el-upload>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmApp"> </el-button>
<el-button @click="openApp=false"> </el-button>
</div>
</el-dialog>
@ -265,8 +345,9 @@
<script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { getDeviceListPageApi,addDeviceApi, updateDeviceApi, deleteDeviceApi,getMenuRecipeDetailApi } from "@/api/device/index";
import { getDeviceListPageApi,addDeviceApi, updateDeviceApi, deleteDeviceApi,getMenuRecipeDetailApi,uploadApkApi } from "@/api/device/index";
import base64 from 'base-64';
import { getToken } from '@/utils/auth'
export default {
name: "",
dicts: ["dev_comm_status","dev_status"],
@ -390,6 +471,41 @@
recipeId:"",
menuData:[],
menuSubData:[],
openApp:false,
appForm:{
version:null,
versionName:null,
apkName:null,
apkPath:null,
updateContent:null,
type:1,//1APP 2APP
},
//
upload: {
//
isUploading: false,
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/file/upload',
},
appFormRules:{
version: [
{ required: true, message: "版本号不能为空", trigger: "blur" }
],
versionName: [
{ required: true, message: "版本号名称不能为空", trigger: "blur" }
],
apkName: [
{ required: true, message: "APP名称不能为空", trigger: "blur" }
],
apkPath: [
{ required: true, message: "APP路径不能为空", trigger: "blur" }
],
updateContent: [
{ required: true, message: "更新内容不能为空", trigger: "blur" }
]
},
};
},
mounted(){
@ -556,7 +672,6 @@
this.$refs['baseForm'].clearValidate(['stallId']);
this.$forceUpdate()
},
/** 提交按钮 */
submitForm: function() {
console.log(this.baseForm)
@ -589,8 +704,7 @@
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
},
/** 今日菜谱按钮操作-打开弹窗 */
openMenuDialog(row){
this.openMenu=true
@ -625,8 +739,45 @@
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
},
handleApp(){
this.appForm = {
version:null,
versionName:null,
apkName:null,
apkPath:null,
updateContent:null,
type:1,//1APP 2APP
};
this.resetForm("appForm");
this.openApp = true;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
//
handleFileSuccess(response, file, fileList) {
console.log(response)
this.upload.isUploading = false
this.$refs.upload.clearFiles()
if(response.code==200){
this.appForm.apkPath=response.data.url
}else{
this.$modal.msgError("上传失败,请重新选择文件!");
}
},
confirmApp(){
console.log(this.appForm)
this.$refs["appForm"].validate(valid => {
if (valid) {
uploadApkApi(this.appForm).then(response => {
this.$modal.msgSuccess("操作成功");
this.openApp = false;
});
}
});
},
}
};

View File

@ -12,9 +12,9 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="商品名称" prop="materialName">
<el-form-item label="商品名称" prop="productName">
<el-input
v-model="form.materialName"
v-model="form.productName"
placeholder="请输入商品名称"
maxlength="40"
show-word-limit
@ -83,24 +83,24 @@
<el-row>
<el-col :span="12">
<el-form-item label="商品类别" prop="categoryId">
<el-cascader v-model="form.categoryId"
<el-form-item label="商品类别" prop="materialId">
<el-cascader v-model="form.materialId"
:options="treeTypeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: true,//
checkStrictly: false,//
value:'id',label:'categoryName'
}" clearable >
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商品进价" prop="unitPrice">
<el-form-item label="商品进价" prop="prefPrice">
<el-input
v-model="form.unitPrice"
v-model="form.prefPrice"
placeholder="请输入商品进价"
@input="handleNumericInput('unitPrice', $event)"
@blur="formatNumericValue('unitPrice')"
@input="handleNumericInput('prefPrice', $event)"
@blur="formatNumericValue('prefPrice')"
>
<template slot="append"></template>
</el-input>
@ -110,38 +110,38 @@
<el-row>
<el-col :span="12">
<el-form-item label="保质期" prop="shelfLifeDays">
<el-select v-model="form.shelfLifeType" style="width: 80px; margin-left: 10px">
<el-form-item label="保质期" prop="qualityNum">
<el-select v-model="form.qualityType" style="width: 80px; margin-left: 10px">
<el-option label="按年" value="1" />
<el-option label="按月" value="2" />
<el-option label="按日" value="3" />
</el-select>
<el-input v-model="form.shelfLifeDays" placeholder="请输入" style="width: 120px;margin-right: 10px;" @input="(v)=>(form.shelfLifeDays=v.replace(/[^\d]/g,''))"/>
<span v-if="form.shelfLifeType==1"></span>
<span v-if="form.shelfLifeType==2"></span>
<span v-if="form.shelfLifeType==3"></span>
<el-input v-model="form.qualityNum" placeholder="请输入" style="width: 120px;margin-right: 10px;" @input="(v)=>(form.qualityNum=v.replace(/[^\d]/g,''))"/>
<span v-if="form.qualityType==1"></span>
<span v-if="form.qualityType==2"></span>
<span v-if="form.qualityType==3"></span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应资格证书" prop="qualificationCert">
<el-select v-model="form.qualificationCert" placeholder="请选择供应资格证书" style="width: 100%">
<el-form-item label="供应资格证书" prop="supplyCertificate">
<el-select v-model="form.supplyCertificate" placeholder="请选择供应资格证书" style="width: 100%">
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="商品简介" prop="synopsis">
<el-form-item label="商品简介" prop="productRemark">
<el-input
type="textarea"
:rows="3"
placeholder="请输入商品简介"
v-model="form.synopsis">
v-model="form.productRemark">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="图片" prop="imageUrl">
<el-form-item label="图片" prop="imgUrl">
<el-upload
:http-request="(obj) => imgUpLoad(obj, 'fileUrl')"
action="#"
@ -195,31 +195,31 @@ export default {
treeTypeOptions:[],//
unitOptions:[],//
form: {
materialName: '',//
productName: '',//
areaId: null,//
categoryId: null,//
materialId: null,//
materialType: 2,
salesMode: '2',//
salesMode: '1',//
salePrice: '',//()
unitId: '',//
unitPrice: '',//()
prefPrice: '',//()
barCode: '',//
nutritionId:null,//
shelfLifeType:"1",//
shelfLifeDays:"",//
qualityType:"1",//
qualityNum:"",//
purPriceCeiling:'',//
size:'',//
taxRate:'',//
qualificationCert: '',
synopsis:"",//
imageUrl:"",//
supplyCertificate: '',
productRemark:"",//
imgUrl:"",//
},
rules: {
materialName: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
productName: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
areaId: [{ required: true, message: '请选择所属区域', trigger: 'change' }],
salePrice: [{ required: true, message: '请输入零售价', trigger: 'change' }],
categoryId: [{ required: true, message: '请选择商品类别', trigger: 'change' }],
materialId: [{ required: true, message: '请选择商品类别', trigger: 'change' }],
salesMode: [{ required: true, message: '请选择计量类型', trigger: 'change' }],
unitId: [{ required: true, message: '请选择商品单位', trigger: 'change' }],
},
@ -236,7 +236,7 @@ export default {
return this.checkUrlList.length > 0
},
},
created() {
mounted() {
this.getAreaTreeData();//
this.getTypeTreeData();//
this.getDrpUnitList();//
@ -246,22 +246,22 @@ export default {
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeAreaOptions = response.data;
console.log(this.treeAreaOptions)
this.getTypeTreeData()
});
},
//-
handleAreaChange(val){
console.log(this.form)
this.form.categoryId=null
this.form.materialId=null
this.getTypeTreeData()
this.getDrpUnitList()
},
//
getTypeTreeData() {
let param = {
categoryType:1,
ifAdd: 1,
areaId:this.form.areaId
categoryType:2,
// ifAdd: 1,
// areaId:this.form.areaId
}
systemMaterialTreeApi(param).then((response) => {
this.treeTypeOptions = response.data;
@ -270,21 +270,22 @@ export default {
//
getDrpUnitList() {
let param = {
areaId: this.form.areaId||"",
ifListUse: 1,
current: 1,
size: -1
weighType:this.form.salesMode,
// areaId: this.form.areaId||""
// ifListUse: 1,
// current: 1,
// size: -1
}
this.form.unitId=null
getDrpUnitListApi(param).then((response) => {
this.unitOptions = [];
if(response.data.records.length>0){
response.data.records.forEach(item => {
if(item.weighType==this.form.salesMode){
this.unitOptions.push(item)
}
});
}
this.unitOptions = response.data;
// if(response.data.records.length>0){
// response.data.records.forEach(item => {
// if(item.weighType==this.form.salesMode){
// this.unitOptions.push(item)
// }
// });
// }
});
},
@ -295,30 +296,30 @@ export default {
this.getTypeTreeData()
this.getDrpUnitList()
this.$set(this.form,"areaName",row.areaName)
this.$set(this.form,"categoryId",row.categoryId)
this.$set(this.form,"materialId",row.materialId)
this.$set(this.form,"categoryName",row.categoryName)
this.$set(this.form,"materialCode",row.materialCode)
this.$set(this.form,"materialId",row.materialId)
this.$set(this.form,"materialName",row.materialName)
this.$set(this.form,"productName",row.productName)
this.$set(this.form,"materialType",row.materialType)
this.$set(this.form,"salesMode",row.salesMode+'')
this.$set(this.form,"unitId",row.unitId)
this.$set(this.form,"salePrice",Number((row.salePrice/100).toFixed(2)))
this.$set(this.form,"unitPrice",Number((row.unitPrice/100).toFixed(2)))
this.$set(this.form,"prefPrice",Number((row.prefPrice/100).toFixed(2)))
this.$set(this.form,"barCode",row.barCode)
if(row.shelfLifeType){
this.$set(this.form,"shelfLifeType",row.shelfLifeType+"")
if(row.qualityType){
this.$set(this.form,"qualityType",row.qualityType+"")
}else{
this.$set(this.form,"shelfLifeType","1")
this.$set(this.form,"qualityType","1")
}
this.$set(this.form,"shelfLifeDays",row.shelfLifeDays)
this.$set(this.form,"qualificationCert","")
this.$set(this.form,"synopsis",row.synopsis)
this.$set(this.form,"imageUrl",row.imageUrl)
this.$set(this.form,"qualityNum",row.qualityNum)
this.$set(this.form,"supplyCertificate","")
this.$set(this.form,"productRemark",row.productRemark)
this.$set(this.form,"imgUrl",row.imgUrl)
//
if(row.imageUrl){
this.fileList=[{url:row.imageUrl}]
this.checkUrlList=[row.imageUrl]
if(row.imgUrl){
this.fileList=[{url:row.imgUrl}]
this.checkUrlList=[row.imgUrl]
}else{
this.fileList=[]
this.checkUrlList=[]
@ -329,7 +330,7 @@ export default {
this.$refs.form.validate(valid => {
if (valid) {
this.form.salePrice = Number(this.form.salePrice)*100;
this.form.unitPrice = Number(this.form.unitPrice)*100;
this.form.prefPrice = Number(this.form.prefPrice)*100;
this.$emit('submit', this.form);
}
});
@ -351,22 +352,22 @@ export default {
reset() {
this.form = {
materialName: '',//
productName: '',//
areaId: null,//
categoryId: null,//
materialId: null,//
materialType: 2,
salesMode: '2',//
salesMode: '1',//
unitId: '',//
salePrice: '',//()
unitPrice: '',//()
prefPrice: '',//()
barCode: '',//
str:[],//
nutritionId:null,//
shelfLifeType:"1",//
shelfLifeDays:"",//
qualificationCert: '',
synopsis:"",//
imageUrl:""
qualityType:"1",//
qualityNum:"",//
supplyCertificate: '',
productRemark:"",//
imgUrl:""
};
},
@ -378,10 +379,10 @@ export default {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
this.$set(this.form,"imageUrl",res.data.url)
this.$set(this.form,"imgUrl",res.data.url)
} else {
this.$modal.msgError(res.msg)
this.$set(this.form,"imageUrl","")
this.$set(this.form,"imgUrl","")
}
})
.catch((error) => {

View File

@ -23,7 +23,7 @@
:data="treeOptions"
:props="defaultProps"
:show-checkbox="true"
:default-expand-all="false"
:default-expand-all="true"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="typeTree"
@ -88,9 +88,9 @@
}" clearable>
</el-cascader>
</el-form-item>
<el-form-item label="商品名称" prop="materialName">
<el-form-item label="商品名称" prop="productName">
<el-input
v-model="queryParams.materialName"
v-model="queryParams.productName"
placeholder="请输入商品名称"
clearable maxlength="30"
style="width: 240px"
@ -106,9 +106,9 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商品编码" prop="materialCode">
<el-form-item label="商品编码" prop="productCode">
<el-input
v-model="queryParams.materialCode"
v-model="queryParams.productCode"
placeholder="请输入商品编码"
clearable maxlength="30"
style="width: 240px"
@ -148,7 +148,7 @@
@click="handleBatchDel"
>批量删除</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
size="mini" plain
@ -156,8 +156,8 @@
@click="handleBatchEdit"
>批量修改类别
</el-button>
</el-col>
<el-col :span="1.5">
</el-col> -->
<!-- <el-col :span="1.5">
<el-upload
ref="upload"
:limit="1"
@ -184,11 +184,11 @@
@click="importTemplate"
>模板下载
</el-button>
</el-col>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableList" height="650" ref="multipleTable" border :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="tableList" height="550" ref="multipleTable" border :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"/>
<el-table-column label="序号" align="center" width="80" type="index">
@ -196,14 +196,14 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="商品编码" align="center" key="materialCode" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="商品名称" align="center" key="materialName" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="商品编码" align="center" key="productCode" prop="productCode" :show-overflow-tooltip="true" />
<el-table-column label="商品名称" align="center" key="productName" prop="productName" :show-overflow-tooltip="true" />
<el-table-column label="所属区域" align="center" key="areaName" prop="areaName" :show-overflow-tooltip="true" />
<el-table-column label="商品类别" align="center" key="categoryName" prop="categoryName" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" key="unitName" prop="unitName" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="商品进价(元)" align="center" key="unitPrice" prop="unitPrice" :show-overflow-tooltip="true">
<el-table-column label="商品进价(元)" align="center" key="prefPrice" prop="prefPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>
<span>{{ (scope.row.prefPrice/100).toFixed(2)||"" }}</span>
</template>
</el-table-column>
<el-table-column label="零售价(元)" align="center" key="salePrice" prop="salePrice" :show-overflow-tooltip="true">
@ -387,9 +387,9 @@ export default {
pageNum: 1,
pageSize: 10,
areaId:null,
materialName:"",
productName:"",
barCode:"",
materialCode:"",
productCode:"",
materialType:2, //(12)
categoryIdList:[]
},
@ -592,18 +592,18 @@ export default {
console.log(this.$refs.typeTree.getCheckedKeys())
this.loading = true;
let params= {
"size": this.queryParams.pageSize,
"current": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
"areaId": this.queryParams.areaId,
"materialName": this.queryParams.materialName,
"productName": this.queryParams.productName,
"barCode": this.queryParams.barCode,
"materialCode": this.queryParams.materialCode,
"productCode": this.queryParams.productCode,
"materialType": this.queryParams.materialType,//(12)
"categoryIdList": this.$refs.typeTree.getCheckedKeys(),
}
getMaterialListApi(params).then((response) => {
this.tableList = response.data.records;
this.total = Number(response.data.total);
this.tableList = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
@ -652,7 +652,7 @@ export default {
this.$modal
.confirm("是否确认删除数据项?")
.then(function () {
return removeMaterialApi({"materialId":row.materialId});
return removeMaterialApi({"productId":row.productId});
})
.then(() => {
this.$modal.msgSuccess("删除成功");
@ -662,16 +662,16 @@ export default {
},
handleSelectionChange(selection){
this.batchIds = []
this.batchIds = selection.map((item) => item.materialId)
this.editForm.categoryNames = "";
this.editForm.categoryNames = selection.map((item) => item.materialName);
this.batchIds = selection.map((item) => item.productId)
// this.editForm.categoryNames = "";
// this.editForm.categoryNames = selection.map((item) => item.materialName);
this.single = selection.length !== 1
this.multiple = !selection.length
},
//
handleBatchDel(){
console.log(this.batchIds)
batchRemoveMaterialApi(this.batchIds).then(response => {
batchRemoveMaterialApi({"productId":this.batchIds.join(",")}).then(response => {
this.$modal.msgSuccess("删除成功");
this.$refs.multipleTable.clearSelection()
this.getList();
@ -689,12 +689,12 @@ export default {
materialIdList:this.batchIds,
categroyId:this.editForm.categroyId
}
batchUpdateMaterialApi(param).then(response => {
this.$modal.msgSuccess("修改成功");
this.openEdit=false
this.$refs.multipleTable.clearSelection()
this.getList();
});
// batchUpdateMaterialApi(param).then(response => {
// this.$modal.msgSuccess("");
// this.openEdit=false
// this.$refs.multipleTable.clearSelection()
// this.getList();
// });
}
});
},

View File

@ -1,9 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属区域" prop="areaIdList">
<el-form-item label="所属区域" prop="areaId">
<el-cascader
v-model="queryParams.areaIdList" :show-all-levels="false" :filterable="true"
v-model="queryParams.areaId" :show-all-levels="false" :filterable="true"
:options="treeOptions" :props="treeProps" collapse-tags clearable
@change="handleTreeChange"></el-cascader>
</el-form-item>
@ -59,7 +59,7 @@
</template>
</el-table-column>
<el-table-column label="联系人" align="center" prop="userName" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="更新时间" align="center" prop="uptime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="更新时间" align="center" prop="updateTime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="收款码" align="center" prop="payCodeUrl" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>未开启</span>
@ -121,7 +121,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="超市仓库" prop="warehouseId">
<el-select v-model="baseForm.warehouseId" placeholder="请选择超市仓库" style="width: 100%;">
<el-select v-model="baseForm.warehouseId" placeholder="请选择超市仓库" clearable style="width: 100%;">
<el-option v-for="item in wareHouseOptions2"
:key="item.warehouseId"
:label="item.warehouseName"
@ -158,8 +158,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="用户类别" prop="psnTypeList">
<el-select v-model="baseForm.psnTypeList" multiple style="width: 100%" clearable>
<el-form-item label="用户类别" prop="userType">
<el-select v-model="baseForm.userType" style="width: 100%" clearable>
<el-option
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
@ -219,8 +219,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配送方式" prop="deliveryWayList">
<el-select v-model="baseForm.deliveryWayList" multiple style="width: 100%" clearable>
<el-form-item label="配送方式" prop="deliveryWay">
<el-select v-model="baseForm.deliveryWay" style="width: 100%" clearable>
<el-option label="自取" value="1"></el-option>
<el-option label="配送" value="2"></el-option>
</el-select>
@ -239,17 +239,7 @@
</el-switch>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="是否开启收款码" prop="ifEnablePayCode">
<el-switch
v-model="baseForm.ifEnablePayCode"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col> -->
</el-row>
@ -341,7 +331,7 @@
pageNum: 1,
pageSize: 10,
warehouseId: undefined,
areaIdList: [],
areaId: undefined,
},
wareHouseOptions:[],
wareHouseOptions2:[],
@ -351,8 +341,7 @@
canteenId:"",//-
canteenData:{},//-
baseForm: {
"areaId": "",
"ifEnablePayCode": 2,
"areaId": "",
"ifRelateDrp": 2,
"imgUrl": "",
},//
@ -431,7 +420,7 @@
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "blur" }
],
deliveryWayList: [
deliveryWay: [
{ required: true, message: "配送方式不能为空", trigger: "change" }
],
mobile: [
@ -460,8 +449,9 @@
},
created() {
this.getTreeData();
this.getWareHouse();
this.getList();
this.mgruserListByRole();
// this.mgruserListByRole();
},
computed: {
@ -480,12 +470,18 @@
},
handleTreeChange(e){
console.log(e)
let param = {
areaIdList:e
}
drpWareHousePageApi(param).then(response => {
this.wareHouseOptions = response.data.records
this.queryParams.warehouseId = null
// let param = {
// areaId:e
// }
// drpWareHousePageApi(param).then(response => {
// this.wareHouseOptions = response.rows
// this.queryParams.warehouseId = null
// });
},
getWareHouse() {
drpWareHousePageApi({}).then(response => {
this.wareHouseOptions = response.rows
this.wareHouseOptions2 = response.rows
});
},
/** 搜索按钮操作 */
@ -502,13 +498,13 @@
getList() {
this.loading = true;
let param = {
"current": this.queryParams.pageNum,
"size": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"warehouseId": this.queryParams.warehouseId,
"areaIdList":this.queryParams.areaIdList
"areaId":this.queryParams.areaId
}
supermarketPageListApi(param).then(response => {
this.tableListData = response.records;
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
@ -532,8 +528,7 @@
this.fileList=[]
this.checkUrlList=[]
this.baseForm = {
"areaId": "",
"ifEnablePayCode": 2,
"areaId": "",
"ifRelateDrp": 2,
"imgUrl": "",
}
@ -545,12 +540,12 @@
console.log(row)
this.reset();
this.baseForm = Object.assign({}, row)
let param = {
areaIdList:[this.baseForm.areaId]
}
drpWareHousePageApi(param).then(response => {
this.wareHouseOptions2 = response.data.records
});
// let param = {
// areaIdList:[this.baseForm.areaId]
// }
// drpWareHousePageApi(param).then(response => {
// this.wareHouseOptions2 = response.rows
// });
if(row.imgUrl){
this.fileList=[{url:row.imgUrl}]
this.checkUrlList=[row.imgUrl]
@ -564,7 +559,7 @@
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return deleteSupermarketApi(row.supermarketId);
return deleteSupermarketApi({supermarketId:row.supermarketId});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
@ -577,7 +572,7 @@
if (valid) {
this.baseForm.imgUrl = this.checkUrlList[0]
let param = this.baseForm
param.configList = this.configList;
// param.configList = this.configList;
if (param.supermarketId) {
editSupermarketApi(param).then(response => {
this.$modal.msgSuccess("修改成功");
@ -596,13 +591,13 @@
},
//-
handleTreeChange2(val){
let param = {
areaIdList:[val]
}
drpWareHousePageApi(param).then(response => {
this.wareHouseOptions2 = response.data.records
this.baseForm.warehouseId = null
});
// let param = {
// areaIdList:[val]
// }
// drpWareHousePageApi(param).then(response => {
// this.wareHouseOptions2 = response.rows
// this.baseForm.warehouseId = null
// });
},
//
mgruserListByRole(){

View File

@ -117,8 +117,7 @@
</div>
</template>
<script>
import { getPageCanteenApi } from "@/api/base/canteen";
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { drpUnitPageListApi,addDrpUnitApi, editDrpUnitApi, removeDrpUnitApi } from "@/api/superStore/superUitId";
export default {
@ -197,14 +196,14 @@
getList() {
this.loading = true;
let param = {
"current": this.queryParams.pageNum,
"size": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"unitName": this.queryParams.unitName,
"areaId": this.queryParams.areaId
}
drpUnitPageListApi(param).then(response => {
this.tableListData = response.data.records;
this.total = Number(response.data.total);
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},