食堂管理2
This commit is contained in:
parent
d4e8ec7884
commit
db41f94803
|
|
@ -0,0 +1,88 @@
|
|||
import request from '@/utils/request'
|
||||
//资源图片上传
|
||||
export function imgUpLoad(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
formData.append('fileType', param.type)
|
||||
return request({
|
||||
url: '/system/sys/file/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
header:'multipart/form-data'
|
||||
})
|
||||
}
|
||||
|
||||
export function imgUpLoadTwo(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
formData.append('fileType', param.type)
|
||||
return request({
|
||||
url: '/file/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
header:'multipart/form-data'
|
||||
})
|
||||
}
|
||||
|
||||
export function imgUpLoadThree(param){
|
||||
const formData = new FormData()
|
||||
param.forEach(item => {
|
||||
formData.append('files', item)
|
||||
})
|
||||
// formData.append('files', param)
|
||||
return request({
|
||||
url: '/file/uploadFiles',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
header:'multipart/form-data'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//资源文件上传
|
||||
export function fileUpLoad(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
return request({
|
||||
url: '/system/sys/file/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
})
|
||||
}
|
||||
|
||||
// excel文件上传
|
||||
export function excelUpLoad(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
return request({
|
||||
url: '/material/base/maPartType/readExcel',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
})
|
||||
}
|
||||
|
||||
// excel文件下载
|
||||
export function downloadExcel(param){
|
||||
return request({
|
||||
url: '/material/base/maPartType/downLoad',
|
||||
method: 'post',
|
||||
param
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -261,12 +261,24 @@
|
|||
<el-col :span="12">
|
||||
<el-form-item label="食堂图片">
|
||||
<el-upload
|
||||
action=""
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</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-success="handleAvatarSuccess"
|
||||
:class="{ disabled: uploadDisabled }"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
>
|
||||
<i
|
||||
class="el-icon-plus avatar-uploader-icon"
|
||||
></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -274,11 +286,20 @@
|
|||
</el-form>
|
||||
</el-tab-pane>
|
||||
<!-- 支付设置 -->
|
||||
<el-tab-pane label="支付设置" name="paySetting"></el-tab-pane>
|
||||
<el-tab-pane label="支付设置" name="paySetting">
|
||||
支付设置
|
||||
|
||||
</el-tab-pane>
|
||||
<!-- 配送设置 -->
|
||||
<el-tab-pane label="配送设置" name="deliverySetting"></el-tab-pane>
|
||||
<el-tab-pane label="配送设置" name="deliverySetting">
|
||||
配送设置
|
||||
|
||||
</el-tab-pane>
|
||||
<!-- 预订/点餐/报餐设置 -->
|
||||
<el-tab-pane label="预订/点餐/报餐设置" name="orderSetting"></el-tab-pane>
|
||||
<el-tab-pane label="预订/点餐/报餐设置" name="orderSetting">
|
||||
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
|
@ -343,8 +364,8 @@
|
|||
|
||||
<script>
|
||||
import { systemAreaTreeApi } from "@/api/base/area";
|
||||
import { getPageCanteenApi,getCanteenLabelApi,queryAllCustJobApi,queryCustJobPageApi } from "@/api/base/canteen";
|
||||
|
||||
import { getPageCanteenApi,getCanteenLabelApi,queryAllCustJobApi,queryCustJobPageApi,getMealtimeListApi,addCanteenApi } from "@/api/base/canteen";
|
||||
import { imgUpLoadTwo } from '@/api/system/upload'
|
||||
export default {
|
||||
name: "",
|
||||
dicts: [],
|
||||
|
|
@ -403,13 +424,16 @@
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
jobTableData:[],
|
||||
// 总条数
|
||||
dialogTotal: 0,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fileList: [],
|
||||
checkUrlList: [],
|
||||
checkUrlNameList: [],
|
||||
dialogVisible:false,
|
||||
dialogImageUrl:"",
|
||||
};
|
||||
|
|
@ -419,6 +443,7 @@
|
|||
this.getList();
|
||||
this.getCanteenLabel()
|
||||
this.queryAllCustJob()
|
||||
this.getMealtimeList()
|
||||
},
|
||||
methods: {
|
||||
//区域树
|
||||
|
|
@ -466,11 +491,16 @@
|
|||
this.open = true;
|
||||
this.title = "新增";
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.baseForm = {};
|
||||
this.resetForm("baseForm");
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
|
|
@ -490,37 +520,45 @@
|
|||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.baseForm = {};
|
||||
this.resetForm("baseForm");
|
||||
},
|
||||
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["baseForm"].validate(valid => {
|
||||
this.$refs["baseForm"].validate(valid => {//基本设置表单校验
|
||||
if (valid) {
|
||||
if (this.baseForm.dictId != undefined) {
|
||||
// updateType(this.baseForm).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
} else {
|
||||
// addType(this.baseForm).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.baseForm.dictId != undefined) {
|
||||
// updateType(this.baseForm).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
} else {
|
||||
// addType(this.baseForm).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
//查询食堂标签下拉
|
||||
getCanteenLabel() {
|
||||
let param = { "current": 1,"size": -1}
|
||||
|
|
@ -540,11 +578,12 @@
|
|||
console.log(response)
|
||||
});
|
||||
},
|
||||
//负责人弹窗-查询按钮
|
||||
handleDialogQuery(){
|
||||
this.dialogQueryParams.pageNum=1
|
||||
this.queryCustJobPage()
|
||||
},
|
||||
//负责人弹窗-人员分页查询
|
||||
//负责人弹窗-人员分页查询接口
|
||||
queryCustJobPage() {
|
||||
let param = {
|
||||
"current": this.dialogQueryParams.pageNum,
|
||||
|
|
@ -564,8 +603,53 @@
|
|||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
|
||||
},
|
||||
// 图片上传
|
||||
imgUpLoad(param, name, index) {
|
||||
// console.log(param,'image')
|
||||
param.type = 'canteen'
|
||||
imgUpLoadTwo(param).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.checkUrlList.push(res.data.fileUrl)
|
||||
this.checkUrlNameList.push(res.data.fileName)
|
||||
} else {
|
||||
this.$modal.msgError(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$modal.msgError(error)
|
||||
})
|
||||
},
|
||||
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
|
||||
},
|
||||
//查询餐次时段列表
|
||||
getMealtimeList() {
|
||||
getMealtimeListApi({}).then((response) => {
|
||||
console.log(response)
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue