采购管理1
This commit is contained in:
parent
ec899515ac
commit
91305bfd88
|
|
@ -0,0 +1,206 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
|
||||
<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" 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">
|
||||
<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="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPageCanteenApi } from "@/api/base/canteen";
|
||||
|
||||
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,
|
||||
canteenName: undefined,
|
||||
areaNameStr: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
// canteenName: [
|
||||
// { required: true, message: "字典名称不能为空", trigger: "blur" }
|
||||
// ],
|
||||
// dictType: [
|
||||
// { required: true, message: "字典类型不能为空", trigger: "blur" }
|
||||
// ]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let param = {
|
||||
"current": this.queryParams.pageNum,
|
||||
"size": this.queryParams.pageSize,
|
||||
}
|
||||
getPageCanteenApi(param).then(response => {
|
||||
this.tableListData = response.records;
|
||||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "新增";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
// const dictId = row.dictId || this.ids
|
||||
// getType(dictId).then(response => {
|
||||
// this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
// });
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.dictId != undefined) {
|
||||
// updateType(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
} else {
|
||||
// addType(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictIds = row.dictId || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
||||
// return delType(dictIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,382 @@
|
|||
<template>
|
||||
<div style="padding: 10px;background: #E5EBF6;min-height: 830px;">
|
||||
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
|
||||
<el-form :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px">
|
||||
<el-form-item label="合同编号" prop="contractNum">
|
||||
<el-input v-model="baseInfo.contractNum" placeholder="请输入合同编号" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同标题" prop="contractName">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入合同标题" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="baseInfo.areaId"
|
||||
:options="treeAreaOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
}" @change="handleAreaChange">
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属食堂" prop="canteenId">
|
||||
<el-select v-model="baseInfo.canteenId" placeholder="请选择所属食堂" style="width: 240px;">
|
||||
<el-option v-for="item in canteenOptions"
|
||||
:key="item.canteenId"
|
||||
:label="item.canteenName"
|
||||
:value="item.canteenId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="baseInfo.supplierId" placeholder="请选择供应商" style="width: 240px;">
|
||||
<el-option v-for="item in supplierOptions"
|
||||
:key="item.supplierId"
|
||||
:label="item.supplierName"
|
||||
:value="item.supplierId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="签订日期" prop="contractDate">
|
||||
<el-date-picker
|
||||
v-model="baseInfo.contractDate"
|
||||
type="date" align="right"
|
||||
format="yyyy-MM-dd" style="width: 240px;"
|
||||
:picker-options="pickerOptions">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同生效周期">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="datetimerange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd HH:mm:ss" style="width: 400px"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
:picker-options="pickerOptions" >
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款方式" prop="payType">
|
||||
<el-radio-group v-model="baseInfo.payType" >
|
||||
<el-radio :label="1" style="font-size: 14px;">一次性付款</el-radio>
|
||||
<el-radio :label="2" style="font-size: 14px;">分期付款</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款日期" prop="payDate">
|
||||
<el-date-picker
|
||||
v-model="baseInfo.payDate"
|
||||
type="date" align="right"
|
||||
format="yyyy-MM-dd" style="width: 240px;"
|
||||
:picker-options="pickerOptions">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款银行" prop="payDate">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入收款银行" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款账户名称" prop="payDate">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入收款账户名称" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款账号" prop="payDate">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入收款账号" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="payDate">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入备注" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="payDate">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入负责人" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同总金额" prop="payDate">
|
||||
<el-input v-model="baseInfo.contractName" placeholder="请输入合同总金额" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;">
|
||||
|
||||
</div>
|
||||
<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 @click="jumpList">返 回</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 选择菜品 -->
|
||||
<el-dialog title="选择货品" :visible.sync="openDishes" width="90%" append-to-body >
|
||||
<div style="width: 100%;height:640px;display: flex;align-items: center;color: #000;">
|
||||
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openDishes=false">确 定</el-button>
|
||||
<el-button @click="openDishes=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
|
||||
export default {
|
||||
name: "ContractDetail",
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
baseInfo: {
|
||||
contractName:undefined,
|
||||
contractType:undefined,
|
||||
areaId:undefined,
|
||||
canteenId:undefined,
|
||||
stallId:undefined,
|
||||
effId:undefined,
|
||||
},
|
||||
// 表单校验
|
||||
baseRules: {
|
||||
contractName: [
|
||||
{ required: true, message: "菜谱名称不能为空", trigger: "blur" }
|
||||
],
|
||||
areaId: [
|
||||
{ required: true, message: "所属区域不能为空", trigger: "change" }
|
||||
],
|
||||
canteenId: [
|
||||
{ required: true, message: "所属食堂不能为空", trigger: "change" }
|
||||
],
|
||||
stallId: [
|
||||
{ required: true, message: "所属档口不能为空", trigger: "change" }
|
||||
],
|
||||
contractType: [
|
||||
{ required: true, message: "菜谱类型不能为空", trigger: "change" }
|
||||
]
|
||||
},
|
||||
treeAreaOptions:[],
|
||||
canteenOptions:[],
|
||||
supplierOptions:[],
|
||||
stallOptions:[],
|
||||
dateRange:[],
|
||||
// dateRangeRadio:"",
|
||||
// dateRangeList:[],
|
||||
// dateRangeIndex:0,
|
||||
pickerOptions: {
|
||||
disabledDate(v) {
|
||||
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
||||
}
|
||||
},
|
||||
contractDateList:[],
|
||||
weekDateList:[],
|
||||
detailList:[],
|
||||
openDishes:false,
|
||||
// 查询菜品
|
||||
queryDish:{
|
||||
salesMode:null,
|
||||
typeId:null,
|
||||
dishesName:''
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getAreaTreeData()
|
||||
},
|
||||
methods: {
|
||||
// 返回列表页
|
||||
jumpList() {
|
||||
const obj = { path: "foodManage/purchaseManage/contractDetail" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); // 要打开的页面
|
||||
},
|
||||
//区域树
|
||||
getAreaTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeAreaOptions = response.data;
|
||||
if(this.treeAreaOptions.length>0){
|
||||
this.baseInfo.areaId = this.getFirstChild(this.treeAreaOptions[0]).id;
|
||||
this.handleAreaChange()
|
||||
}
|
||||
});
|
||||
},
|
||||
getFirstChild(node) {
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return node; // 没有子节点或子节点为空,返回当前节点
|
||||
} else {
|
||||
return this.getFirstChild(node.children[0]); // 递归调用最后一个子节点
|
||||
}
|
||||
},
|
||||
//选中区域-查询食堂
|
||||
handleAreaChange(e){
|
||||
let param= {
|
||||
areaId:this.baseInfo.areaId
|
||||
}
|
||||
getCanteenByAreaApi(param).then((response) => {
|
||||
this.canteenOptions=response.rows||[]
|
||||
});
|
||||
// getSupplierByAreaApi(param).then((response) => {
|
||||
// this.supplierOptions=response.rows||[]
|
||||
// });
|
||||
},
|
||||
|
||||
|
||||
//选择日期范围
|
||||
changeDateRange(e){
|
||||
//this.formatDate(e[0])
|
||||
},
|
||||
// 提交按钮
|
||||
confirmSubmit(){
|
||||
this.$refs["baseInfo"].validate(valid => {
|
||||
if (valid) {
|
||||
// let param = this.baseInfo
|
||||
// if(this.baseInfo.contractType==1){
|
||||
// param.contractDateList = this.dateRangeList;
|
||||
// }
|
||||
// if(this.baseInfo.contractType==2){
|
||||
// param.contractDateList = [{
|
||||
// anyone:"repeat",
|
||||
// detailList:this.detailList
|
||||
// }]
|
||||
// }
|
||||
// if(this.baseInfo.contractType==3){
|
||||
// param.contractDateList = this.weekDateList
|
||||
// }
|
||||
// this.noDishes = true;
|
||||
// param.contractDateList.forEach(item=>{
|
||||
// item.detailList.forEach(subItem=>{
|
||||
// if(subItem.dishesList.length>0){
|
||||
// this.noDishes=false
|
||||
// subItem.dishesList.forEach(dishItem=>{
|
||||
// dishItem.price = Number(dishItem.price)
|
||||
// dishItem.salePrice = Number(dishItem.salePrice)
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// if(this.noDishes){
|
||||
// this.$modal.msgError("请选中菜品!");
|
||||
// }else{
|
||||
// this.loading=true
|
||||
// addMenucontractApi(param).then((response) => {
|
||||
// this.loading=false
|
||||
// this.jumpList()
|
||||
// }).catch(() => {
|
||||
// this.loading=false
|
||||
// });
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//日期
|
||||
formatDate(date) {
|
||||
// 格式化为 YYYY-MM-DD
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
//日期时间
|
||||
formatDateTime(date) {
|
||||
// 格式化为 YYYY-MM-DD
|
||||
date = new Date(date)
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
||||
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
||||
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.dishes-card{
|
||||
width: 20%;
|
||||
height: 100%;
|
||||
margin-right: 15px;
|
||||
position: relative;
|
||||
}
|
||||
.body-card{
|
||||
width: 96%;
|
||||
margin: 10px auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bottom-card{
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
.dialog-left{
|
||||
width: 20%;
|
||||
height: 100%;
|
||||
}
|
||||
.dish-name{
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dish-name:hover{
|
||||
background-color:rgba(0, 0, 0, 0.1);
|
||||
color: #4b80fd;
|
||||
}
|
||||
|
||||
.dialog-center{
|
||||
width: 10%;
|
||||
height: 100%;
|
||||
/* background: #4b80fd; */
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
margin: 0 1%;
|
||||
}
|
||||
.dialog-center-header{
|
||||
width: 100%;display: flex;align-items: center;justify-content: center;height: 60px;font-weight: bold;border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.dialog-right{
|
||||
width: 70%;
|
||||
height: 100%;
|
||||
}
|
||||
.primary{
|
||||
background: #1890ff!important;
|
||||
color: #fff!important;
|
||||
}
|
||||
.dateTable{
|
||||
width: 14%;
|
||||
height: 40px;
|
||||
color: #9a9da3;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #e6ebf5;
|
||||
}
|
||||
.dateTable2{
|
||||
width: 14%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
color:#000;
|
||||
border: 1px solid #e6ebf5;
|
||||
cursor: pointer;
|
||||
}
|
||||
.bgBlue{
|
||||
width: 14%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #0c6ccc;
|
||||
color:#fff !important;
|
||||
border: 1px solid #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,297 @@
|
|||
<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="searchValue">
|
||||
<el-input v-model="queryParams.searchValue" placeholder="请输入用户姓名,编号,手机号" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同日期">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" clearable
|
||||
format="yyyy-MM-dd" style="width: 220px"
|
||||
:picker-options="pickerOptions" >
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="queryParams.areaId"
|
||||
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
}" clearable>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交状态" prop="commitStatus">
|
||||
<el-select v-model="queryParams.commitStatus" placeholder="请选择提交状态" style="width: 240px;">
|
||||
<el-option label="待提交" :value="1"></el-option>
|
||||
<el-option label="已提交" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同状态" prop="contractStatus">
|
||||
<el-select v-model="queryParams.contractStatus" placeholder="请选择合同状态" style="width: 240px;">
|
||||
<el-option label="待生效" :value="1"></el-option>
|
||||
<el-option label="履行中" :value="2"></el-option>
|
||||
<el-option label="已失效" :value="3"></el-option>
|
||||
<el-option label="已终止" :value="4"></el-option>
|
||||
</el-select>
|
||||
</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" 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="contractNum" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="合同标题" align="center" prop="contractName" :show-overflow-tooltip="true" width="120" />
|
||||
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="签订日期" align="center" prop="areaName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="合同状态" align="center" prop="areaName" :show-overflow-tooltip="true" width="100"/>
|
||||
<el-table-column label="提交状态" align="center" prop="areaName" :show-overflow-tooltip="true" width="100"/>
|
||||
<el-table-column label="合同总金额(元)" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="供应商" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="合同周期" align="center" prop="areaName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="制表人" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
|
||||
<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="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
|
||||
import { getPageCanteenApi } from "@/api/base/canteen";
|
||||
|
||||
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,
|
||||
},
|
||||
treeOptions:[],//区域树
|
||||
dateRange:[],//区域树
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const start = new Date();
|
||||
const end = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},{
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const start = new Date();
|
||||
const end = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},{
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const start = new Date();
|
||||
const end = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
// canteenName: [
|
||||
// { required: true, message: "字典名称不能为空", trigger: "blur" }
|
||||
// ],
|
||||
// dictType: [
|
||||
// { required: true, message: "字典类型不能为空", trigger: "blur" }
|
||||
// ]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getTreeData();
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
//区域树
|
||||
getTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let param = {
|
||||
"current": this.queryParams.pageNum,
|
||||
"size": this.queryParams.pageSize,
|
||||
}
|
||||
getPageCanteenApi(param).then(response => {
|
||||
this.tableListData = response.records;
|
||||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/contractEdit" });
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleView(row) {
|
||||
// this.$router.push({ path: "/foodManage/purchaseManage/contractDetail",query: {pageJson:JSON.stringify(row)} });
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
// this.$router.push({ path: "/foodManage/purchaseManage/contractEdit",query: {pageJson:JSON.stringify(row)} });
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.dictId != undefined) {
|
||||
// updateType(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
} else {
|
||||
// addType(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictIds = row.dictId || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
||||
// return delType(dictIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//日期
|
||||
formatDate(date) {
|
||||
// 格式化为 YYYY-MM-DD
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,235 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<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="areaId">
|
||||
<el-cascader v-model="queryParams.areaId"
|
||||
:options="treeOptions" :filterable="true" style="width: 240px;" :show-all-levels="false"
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
}" clearable>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="queryParams.supplierId" placeholder="请选择供应商" style="width: 240px;">
|
||||
<el-option label="供应商1" :value="1"></el-option>
|
||||
<el-option label="供应商2" :value="2"></el-option>
|
||||
<el-option label="供应商3" :value="2"></el-option>
|
||||
</el-select>
|
||||
</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
|
||||
size="mini"
|
||||
@click=""
|
||||
>录入</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" width="80" type="index" fixed="left">
|
||||
<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="materialCode" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" width="120" />
|
||||
<el-table-column label="货品类别" align="center" prop="categoryName" :show-overflow-tooltip="true" width="120" />
|
||||
<el-table-column label="计量单位" align="center" prop="" :show-overflow-tooltip="true" width="120" />
|
||||
<el-table-column label="货品规格" align="center" prop="" :show-overflow-tooltip="true" width="120" />
|
||||
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="最近一次采购" align="center">
|
||||
<el-table-column label="价格" align="center" prop="" width="100" :show-overflow-tooltip="true" >
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ (scope.row.lastOrderGoodsPrice/100).toFixed(2) }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="时间" align="center" prop="" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="供应商" align="center" prop="" width="100" :show-overflow-tooltip="true" />
|
||||
</el-table-column>
|
||||
<el-table-column label="市场价格" align="center">
|
||||
<el-table-column label="录入/抓取时间" align="center" prop="" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="价格" align="center" prop="" width="100" :show-overflow-tooltip="true" >
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ (scope.row.lastOrderGoodsPrice/100).toFixed(2) }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="来源" align="center" prop="" width="100" :show-overflow-tooltip="true" />
|
||||
</el-table-column>
|
||||
<el-table-column label="价格浮动比(%)" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="首选供应商" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="当前最新中标供应商" align="center">
|
||||
<el-table-column label="供应商名称" align="center" prop="" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="中标价(元)" align="center" prop="" width="100" :show-overflow-tooltip="true" >
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ (scope.row.lastOrderGoodsPrice/100).toFixed(2) }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
</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="handleView(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="评分规则配置" :visible.sync="open" width="800px" append-to-body>
|
||||
|
||||
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { systemAreaTreeApi } from "@/api/base/stall";
|
||||
import { systemMaterialTreeApi } from "@/api/dish/material";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
//表格数据
|
||||
tableListData: [
|
||||
{supplierName:'111',areaName:'111'},{supplierName:'222',areaName:'222'},
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
supplierName: undefined,
|
||||
areaId: undefined,
|
||||
linkman: undefined,
|
||||
status: undefined,
|
||||
categoryIdList: []
|
||||
},
|
||||
treeTypeOptions:[],//类别树
|
||||
treeOptions:[],//区域树
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
areaId: [
|
||||
{ required: true, message: "所属区域不能为空", trigger: "change" }
|
||||
],
|
||||
ruleType: [
|
||||
{ required: true, message: "周期配置不能为空", trigger: "change" }
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getTypeTreeData();
|
||||
this.getTreeData();
|
||||
// this.getList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
//类型树
|
||||
getTypeTreeData() {
|
||||
let param = {
|
||||
// categoryType:1,
|
||||
}
|
||||
systemMaterialTreeApi(param).then((response) => {
|
||||
this.treeTypeOptions = response.data;
|
||||
});
|
||||
},
|
||||
//区域树
|
||||
getTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
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,
|
||||
"supplierName": this.queryParams.supplierName,
|
||||
"categoryIdList": this.queryParams.categoryIdList,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"linkman": this.queryParams.linkman,
|
||||
"status": this.queryParams.status
|
||||
}
|
||||
// getPageCanteenApi(param).then(response => {
|
||||
// this.tableListData = response.rows;
|
||||
// this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
// });
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
handleView(row){
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue