原料商品表合并接口修改
This commit is contained in:
parent
9233f2cb36
commit
2ead883af0
|
|
@ -5,9 +5,6 @@ export function systemMaterialTreeApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/cook_material_type/getTree',
|
url: '/smart-canteen/cook_material_type/getTree',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
|
||||||
"merchant-id":"378915229716713472",
|
|
||||||
},
|
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@ import request from '@/utils/request'
|
||||||
// 商品类别
|
// 商品类别
|
||||||
export function shopMaterialTreeApi(data) {
|
export function shopMaterialTreeApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material_type/list',
|
url: '/smart-canteen/cook_material_type/getTree',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
},
|
},
|
||||||
params: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 新增商品类别
|
// 新增商品类别
|
||||||
export function addMaterialTypeApi(data) {
|
export function addMaterialTypeApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material_type',
|
url: '/smart-canteen/cook_material_type/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
@ -25,7 +25,7 @@ export function addMaterialTypeApi(data) {
|
||||||
//修改商品类别
|
//修改商品类别
|
||||||
export function updateMaterialTypeApi(data) {
|
export function updateMaterialTypeApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material_type/edit',
|
url: '/smart-canteen/cook_material_type/edit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
@ -36,7 +36,7 @@ export function updateMaterialTypeApi(data) {
|
||||||
//删除商品类别
|
//删除商品类别
|
||||||
export function removeMaterialTypeApi(data) {
|
export function removeMaterialTypeApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material_type/del/'+data.materialTypeId,
|
url: '/smart-canteen/cook_material_type/del/'+data.id,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
@ -48,7 +48,7 @@ export function removeMaterialTypeApi(data) {
|
||||||
// 查询商品列表
|
// 查询商品列表
|
||||||
export function getMaterialListApi(data) {
|
export function getMaterialListApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material/list',
|
url: '/smart-canteen/cook_material/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
@ -60,7 +60,7 @@ export function getMaterialListApi(data) {
|
||||||
// 新增商品
|
// 新增商品
|
||||||
export function addMaterialApi(data) {
|
export function addMaterialApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material',
|
url: '/smart-canteen/cook_material/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
@ -72,7 +72,7 @@ export function addMaterialApi(data) {
|
||||||
// 编辑商品
|
// 编辑商品
|
||||||
export function updateMaterialApi(data) {
|
export function updateMaterialApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material/edit',
|
url: '/smart-canteen/cook_material/edit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
@ -84,7 +84,7 @@ export function updateMaterialApi(data) {
|
||||||
// 删除商品
|
// 删除商品
|
||||||
export function removeMaterialApi(data) {
|
export function removeMaterialApi(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smart-canteen/supermarket_material/del/'+data.materialId,
|
url: '/smart-canteen/cook_material/del/'+data.materialId,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"merchant-id":"378915229716713472",
|
"merchant-id":"378915229716713472",
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,8 @@ export default {
|
||||||
//类型树
|
//类型树
|
||||||
getTypeTreeData() {
|
getTypeTreeData() {
|
||||||
let param = {
|
let param = {
|
||||||
// areaId:this.form.areaId
|
areaId:this.form.areaId,
|
||||||
|
goodsType:1
|
||||||
}
|
}
|
||||||
systemMaterialTreeApi(param).then((response) => {
|
systemMaterialTreeApi(param).then((response) => {
|
||||||
this.treeTypeOptions = response.data;
|
this.treeTypeOptions = response.data;
|
||||||
|
|
|
||||||
|
|
@ -430,7 +430,10 @@ export default {
|
||||||
},
|
},
|
||||||
/** 查询新增页面-上级类型下拉树结构 */
|
/** 查询新增页面-上级类型下拉树结构 */
|
||||||
getTreeData() {
|
getTreeData() {
|
||||||
systemMaterialTreeApi({categoryType:1}).then((response) => {
|
let param = {
|
||||||
|
goodsType:1
|
||||||
|
}
|
||||||
|
systemMaterialTreeApi(param).then((response) => {
|
||||||
this.treeOptions = response.data;
|
this.treeOptions = response.data;
|
||||||
this.addLevel(this.treeOptions)
|
this.addLevel(this.treeOptions)
|
||||||
console.log("this.treeOptions",this.treeOptions)
|
console.log("this.treeOptions",this.treeOptions)
|
||||||
|
|
@ -549,6 +552,7 @@ export default {
|
||||||
"areaId": this.queryParams.areaId,
|
"areaId": this.queryParams.areaId,
|
||||||
"materialName": this.queryParams.materialName,
|
"materialName": this.queryParams.materialName,
|
||||||
"materialCode": this.queryParams.materialCode,
|
"materialCode": this.queryParams.materialCode,
|
||||||
|
"goodsType": 1,
|
||||||
"materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
|
"materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
|
||||||
}
|
}
|
||||||
getMaterialListApi(params).then((response) => {
|
getMaterialListApi(params).then((response) => {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
:props="{
|
:props="{
|
||||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||||
value:'materialTypeId',label:'materialTypeName'
|
value:'id',label:'categoryName'
|
||||||
}" clearable >
|
}" clearable >
|
||||||
</el-cascader>
|
</el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -264,40 +264,10 @@ export default {
|
||||||
},
|
},
|
||||||
//类型树
|
//类型树
|
||||||
getTypeTreeData() {
|
getTypeTreeData() {
|
||||||
shopMaterialTreeApi().then((response) => {
|
shopMaterialTreeApi({areaId:this.form.areaId,goodsType:2}).then((response) => {
|
||||||
this.treeTypeOptions = this.handleTree(response.rows,'materialTypeId');
|
this.treeTypeOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleTree(data, idKey, parentIdKey = 'parentId', childrenKey = 'children') {
|
|
||||||
// 用于存储节点数据的Map,以idKey为键
|
|
||||||
const nodeMap = new Map();
|
|
||||||
// 用于存储根节点的数组
|
|
||||||
const rootNodes = [];
|
|
||||||
|
|
||||||
// 遍历数据,构建nodeMap并找到根节点
|
|
||||||
data.forEach(node => {
|
|
||||||
// 将节点添加到nodeMap中,并初始化children为空数组
|
|
||||||
if(node.parentId==0){
|
|
||||||
nodeMap.set(node[idKey], { ...node, [childrenKey]: [] });
|
|
||||||
}else{
|
|
||||||
nodeMap.set(node[idKey], { ...node });
|
|
||||||
}
|
|
||||||
// 如果parentId为null或父节点不存在于nodeMap中,则该节点为根节点
|
|
||||||
if (node[parentIdKey] === null || !nodeMap.has(node[parentIdKey])) {
|
|
||||||
// 将根节点添加到rootNodes数组中
|
|
||||||
rootNodes.push(nodeMap.get(node[idKey]));
|
|
||||||
} else {
|
|
||||||
// 否则,将当前节点添加到其父节点的children列表中
|
|
||||||
// 获取父节点
|
|
||||||
const parentNode = nodeMap.get(node[parentIdKey]);
|
|
||||||
// 将当前节点添加到父节点的children列表中
|
|
||||||
parentNode[childrenKey].push(nodeMap.get(node[idKey]));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 返回根节点数组,它现在包含了完整的树形结构
|
|
||||||
return rootNodes;
|
|
||||||
},
|
|
||||||
//单位类型拉下选
|
//单位类型拉下选
|
||||||
getDrpUnitList() {
|
getDrpUnitList() {
|
||||||
let param = {
|
let param = {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
ref="typeTree"
|
ref="typeTree"
|
||||||
node-key="materialTypeId"
|
node-key="id"
|
||||||
highlight-current
|
highlight-current
|
||||||
@node-click="handleNodeClick"
|
@node-click="handleNodeClick"
|
||||||
@check-change="handleCheckChange"
|
@check-change="handleCheckChange"
|
||||||
|
|
@ -312,7 +312,7 @@ export default {
|
||||||
isMousemoveId: null,
|
isMousemoveId: null,
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: "children",
|
children: "children",
|
||||||
label: "materialTypeName",
|
label: "categoryName",
|
||||||
},
|
},
|
||||||
keyWord:"",//左侧树-关键字查询
|
keyWord:"",//左侧树-关键字查询
|
||||||
isEditType:false,//是否编辑
|
isEditType:false,//是否编辑
|
||||||
|
|
@ -383,8 +383,11 @@ export default {
|
||||||
},
|
},
|
||||||
/** 查询新增页面-上级类型下拉树结构 */
|
/** 查询新增页面-上级类型下拉树结构 */
|
||||||
getTreeData() {
|
getTreeData() {
|
||||||
shopMaterialTreeApi().then((response) => {
|
let param = {
|
||||||
this.treeOptions = this.handleTree(response.rows,'materialTypeId');
|
goodsType:2
|
||||||
|
}
|
||||||
|
shopMaterialTreeApi(param).then((response) => {
|
||||||
|
this.treeOptions = response.data;
|
||||||
this.addLevel(this.treeOptions)
|
this.addLevel(this.treeOptions)
|
||||||
console.log("this.treeOptions",this.treeOptions)
|
console.log("this.treeOptions",this.treeOptions)
|
||||||
if(this.treeOptions && this.treeOptions.length > 0){
|
if(this.treeOptions && this.treeOptions.length > 0){
|
||||||
|
|
@ -442,7 +445,8 @@ export default {
|
||||||
this.isEditType=false;
|
this.isEditType=false;
|
||||||
this.form={}
|
this.form={}
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
this.$set(this.form,"parentId",data.materialTypeId)
|
this.$set(this.form,"parentId",data.id)
|
||||||
|
this.$set(this.form,"goodsType",data.categoryType)
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "新增";
|
this.title = "新增";
|
||||||
},
|
},
|
||||||
|
|
@ -454,33 +458,19 @@ export default {
|
||||||
this.form = {
|
this.form = {
|
||||||
...data
|
...data
|
||||||
};
|
};
|
||||||
console.log(this.form)
|
this.$set(this.form,"materialTypeId",data.id)
|
||||||
|
this.$set(this.form,"materialTypeName",data.categoryName)
|
||||||
|
this.$set(this.form,"goodsType",data.categoryType)
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改";
|
this.title = "修改";
|
||||||
},
|
},
|
||||||
// 获取父节点的类别名称
|
|
||||||
getParentCategoryName(parentId) {
|
|
||||||
const findNode = (nodes) => {
|
|
||||||
for (let node of nodes) {
|
|
||||||
if (node.materialTypeId === parentId) {
|
|
||||||
return node.materialTypeName;
|
|
||||||
}
|
|
||||||
if (node.children) {
|
|
||||||
const result = findNode(node.children);
|
|
||||||
if (result) return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
return findNode(this.treeOptions);
|
|
||||||
},
|
|
||||||
/* 树节点删除 */
|
/* 树节点删除 */
|
||||||
removeTreeNode(data) {
|
removeTreeNode(data) {
|
||||||
console.log(data, "删除时的数据源--");
|
console.log(data, "删除时的数据源--");
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm("是否确认删除数据项?")
|
.confirm("是否确认删除数据项?")
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return removeMaterialTypeApi({"materialTypeId":data.materialTypeId});
|
return removeMaterialTypeApi({"id":data.id});
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
|
@ -540,6 +530,7 @@ export default {
|
||||||
"materialName": this.queryParams.materialName,
|
"materialName": this.queryParams.materialName,
|
||||||
"barCode": this.queryParams.barCode,
|
"barCode": this.queryParams.barCode,
|
||||||
"materialCode": this.queryParams.materialCode,
|
"materialCode": this.queryParams.materialCode,
|
||||||
|
"goodsType": 2,
|
||||||
"materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
|
"materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
|
||||||
}
|
}
|
||||||
getMaterialListApi(params).then((response) => {
|
getMaterialListApi(params).then((response) => {
|
||||||
|
|
|
||||||
|
|
@ -92,22 +92,79 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;">
|
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;">
|
||||||
|
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
|
||||||
|
<div>
|
||||||
|
货品信息
|
||||||
|
</div>
|
||||||
|
<div style="display: flex;align-items: center;">
|
||||||
|
<el-button type="primary" plain @click="addMaterial">添加货品</el-button>
|
||||||
|
<el-button type="danger" plain @click="">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 100%;height: 400px;overflow-y: auto;">
|
||||||
|
<el-table :data="contractMaterialList" ref="multipleTable" :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" />
|
||||||
|
<el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品编码" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品名称" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品类别" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="计量单位" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品规格" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="单价(元)" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="数量" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="备注" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%;height: 80px;padding: 10px;background: #FFF;border-radius: 10px;display: flex;align-items: center;justify-content: center;">
|
<div style="width: 100%;height: 80px;padding: 10px;background: #FFF;border-radius: 10px;display: flex;align-items: center;justify-content: center;">
|
||||||
<el-button type="primary" @click="confirmSubmit" :loading="loading">提 交</el-button>
|
<el-button type="primary" @click="confirmSubmit" :loading="loadingBtn">提 交</el-button>
|
||||||
<el-button @click="jumpList">返 回</el-button>
|
<el-button @click="jumpList">返 回</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 选择菜品 -->
|
<!-- 选择菜品 -->
|
||||||
<el-dialog title="选择货品" :visible.sync="openDishes" width="90%" append-to-body >
|
<el-dialog title="选择货品" :visible.sync="openDialog" width="65%" append-to-body >
|
||||||
<div style="width: 100%;height:640px;display: flex;align-items: center;color: #000;">
|
<div style="width: 100%;height:620px;">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="货品编码" prop="searchValue">
|
||||||
|
<el-input v-model="queryParams.searchValue" placeholder="请输入货品编码" maxlength="20" clearable style="width: 240px"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="货品名称" prop="searchValue">
|
||||||
|
<el-input v-model="queryParams.searchValue" placeholder="请输入货品名称" maxlength="20" clearable style="width: 240px"/>
|
||||||
|
</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-table v-loading="loading" :data="tableListData" ref="multipleTable1" height="520" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange2">
|
||||||
|
<el-table-column type="selection" width="50" align="center" :reserve-selection="true" />
|
||||||
|
<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="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品编码" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品名称" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品类别" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="计量单位" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="货品规格" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="单价(元)" align="center" prop="" :show-overflow-tooltip="true" />
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="openDishes=false">确 定</el-button>
|
<el-button type="primary" @click="">确 定</el-button>
|
||||||
<el-button @click="openDishes=false">取 消</el-button>
|
<el-button @click="openDialog=false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -122,6 +179,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
|
loadingBtn:false,
|
||||||
baseInfo: {
|
baseInfo: {
|
||||||
contractName:undefined,
|
contractName:undefined,
|
||||||
contractType:undefined,
|
contractType:undefined,
|
||||||
|
|
@ -153,24 +211,22 @@ export default {
|
||||||
supplierOptions:[],
|
supplierOptions:[],
|
||||||
stallOptions:[],
|
stallOptions:[],
|
||||||
dateRange:[],
|
dateRange:[],
|
||||||
// dateRangeRadio:"",
|
|
||||||
// dateRangeList:[],
|
|
||||||
// dateRangeIndex:0,
|
|
||||||
pickerOptions: {
|
pickerOptions: {
|
||||||
disabledDate(v) {
|
disabledDate(v) {
|
||||||
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
contractDateList:[],
|
contractMaterialList:[],
|
||||||
weekDateList:[],
|
openDialog:false,
|
||||||
detailList:[],
|
// 查询参数
|
||||||
openDishes:false,
|
queryParams: {
|
||||||
// 查询菜品
|
pageNum: 1,
|
||||||
queryDish:{
|
pageSize: 10,
|
||||||
salesMode:null,
|
|
||||||
typeId:null,
|
|
||||||
dishesName:''
|
|
||||||
},
|
},
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
//表格数据
|
||||||
|
tableListData: [],
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -213,12 +269,39 @@ export default {
|
||||||
// this.supplierOptions=response.rows||[]
|
// this.supplierOptions=response.rows||[]
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
//选择日期范围
|
//选择日期范围
|
||||||
changeDateRange(e){
|
changeDateRange(e){
|
||||||
//this.formatDate(e[0])
|
//this.formatDate(e[0])
|
||||||
},
|
},
|
||||||
|
addMaterial(){
|
||||||
|
this.openDialog=true
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.$refs.multipleTable1.clearSelection()
|
||||||
|
},300)
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
getPageCanteenApi(param).then(response => {
|
||||||
|
this.tableListData = response.records;
|
||||||
|
this.total = Number(response.total);
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
confirmSubmit(){
|
confirmSubmit(){
|
||||||
this.$refs["baseInfo"].validate(valid => {
|
this.$refs["baseInfo"].validate(valid => {
|
||||||
|
|
@ -251,18 +334,28 @@ export default {
|
||||||
// if(this.noDishes){
|
// if(this.noDishes){
|
||||||
// this.$modal.msgError("请选中菜品!");
|
// this.$modal.msgError("请选中菜品!");
|
||||||
// }else{
|
// }else{
|
||||||
// this.loading=true
|
// this.loadingBtn=true
|
||||||
// addMenucontractApi(param).then((response) => {
|
// addMenucontractApi(param).then((response) => {
|
||||||
// this.loading=false
|
// this.loadingBtn=false
|
||||||
// this.jumpList()
|
// this.jumpList()
|
||||||
// }).catch(() => {
|
// }).catch(() => {
|
||||||
// this.loading=false
|
// this.loadingBtn=false
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
// this.batchIds1 = selection.map(item => item.tradeId)
|
||||||
|
// this.single = selection.length !== 1
|
||||||
|
// this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
handleSelectionChange2(selection) {
|
||||||
|
// this.batchIds1 = selection.map(item => item.tradeId)
|
||||||
|
// this.single = selection.length !== 1
|
||||||
|
// this.multiple = !selection.length
|
||||||
|
},
|
||||||
//日期
|
//日期
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
// 格式化为 YYYY-MM-DD
|
// 格式化为 YYYY-MM-DD
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let param = {
|
let param = {
|
||||||
"current": this.queryParams.pageNum,
|
"pageNum": this.queryParams.pageNum,
|
||||||
"size": this.queryParams.pageSize,
|
"pageSize": this.queryParams.pageSize,
|
||||||
}
|
}
|
||||||
getPageCanteenApi(param).then(response => {
|
getPageCanteenApi(param).then(response => {
|
||||||
this.tableListData = response.records;
|
this.tableListData = response.records;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue