采购合同接口对接
This commit is contained in:
parent
718e0394de
commit
283fb472de
|
|
@ -20,11 +20,72 @@ export function getMaterialListApi(data) {
|
|||
params: data
|
||||
})
|
||||
}
|
||||
//查询供应商列表 isPaging 0不分页 2分页
|
||||
export function supplierPageApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_supplier/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
params:data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//获取采购合同分页列表
|
||||
export function purchaseContractPageApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_purchase_contract/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data:data,
|
||||
params:{
|
||||
pageNum:data.pageNum,
|
||||
pageSize:data.pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取采购合同分页详情
|
||||
export function getPurchaseContractInfoApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_purchase_contract/'+data.contractId,
|
||||
method: 'get',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
}
|
||||
})
|
||||
}
|
||||
// 新增
|
||||
export function addPurchaseContractApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_purchase_contract',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 编辑
|
||||
export function editPurchaseContractApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_purchase_contract/edit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
export function delPurchaseContractApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_purchase_contract/del/'+data.contractIds,
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -2,11 +2,11 @@
|
|||
<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 label="合同编号" prop="contractCode">
|
||||
<el-input v-model="baseInfo.contractCode" placeholder="合同编号自动生成" disabled 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 label="合同标题" prop="contractTitle">
|
||||
<el-input v-model="baseInfo.contractTitle" placeholder="请输入合同标题" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="baseInfo.areaId"
|
||||
|
|
@ -36,17 +36,17 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="签订日期" prop="contractDate">
|
||||
<el-form-item label="签订日期" prop="contractSigningTime">
|
||||
<el-date-picker
|
||||
v-model="baseInfo.contractDate"
|
||||
v-model="baseInfo.contractSigningTime"
|
||||
type="date" align="right"
|
||||
format="yyyy-MM-dd" style="width: 240px;"
|
||||
:picker-options="pickerOptions">
|
||||
:picker-options="pickerOptions" @change="baseInfo.contractSigningTime=formatDate(baseInfo.contractSigningTime)">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同生效周期">
|
||||
<el-form-item label="合同生效周期" prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
v-model="baseInfo.dateRange"
|
||||
type="datetimerange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
|
|
@ -58,37 +58,37 @@
|
|||
: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-form-item label="付款方式" prop="payMoneyStyle">
|
||||
<el-radio-group v-model="baseInfo.payMoneyStyle" >
|
||||
<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-form-item label="付款日期" prop="payMoneyDate">
|
||||
<el-date-picker
|
||||
v-model="baseInfo.payDate"
|
||||
v-model="baseInfo.payMoneyDate"
|
||||
type="date" align="right"
|
||||
format="yyyy-MM-dd" style="width: 240px;"
|
||||
:picker-options="pickerOptions">
|
||||
:picker-options="pickerOptions" @change="baseInfo.payMoneyDate=formatDate(baseInfo.payMoneyDate)">
|
||||
</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 label="收款银行" prop="collectMoneyBank">
|
||||
<el-input v-model="baseInfo.collectMoneyBank" 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 label="收款账户名称" prop="collectMoneyAccountName">
|
||||
<el-input v-model="baseInfo.collectMoneyAccountName" 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 label="收款账号" prop="collectMoneyAccount">
|
||||
<el-input v-model="baseInfo.collectMoneyAccount" 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 label="备注" prop="remark">
|
||||
<el-input v-model="baseInfo.remark" placeholder="请输入备注" maxlength="30" 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 label="负责人" prop="contractPerson">
|
||||
<el-input v-model="baseInfo.contractPerson" 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 label="合同总金额" prop="contractAmount">
|
||||
<el-input v-model="baseInfo.contractAmount" placeholder="请输入合同总金额" maxlength="20" clearable style="width: 240px" @input="(v)=>(baseInfo.contractAmount=v.replace(/[^\d.]/g,''))"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
</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 v-loading="loading" :data="contractMaterialList" ref="multipleTable" height="380" :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" /> -->
|
||||
|
|
@ -117,14 +117,26 @@
|
|||
<span v-if="scope.row.salesMode==2">称重</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
|
||||
<el-table-column label="单价(元)" align="center" prop="singlePrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>
|
||||
<el-input v-model="scope.row.singlePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.singlePrice=v.replace(/[^\d.]/g,''))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d]/g,''))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.orderNum*scope.row.singlePrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入" maxlength="20" clearable/>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -201,26 +213,26 @@
|
|||
|
||||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { systemMaterialTreeApi,getMaterialListApi } from "@/api/foodManage/purchaseManage";
|
||||
|
||||
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { getPurchaseContractInfoApi,addPurchaseContractApi,editPurchaseContractApi,delPurchaseContractApi } from "@/api/foodManage/purchaseManage";
|
||||
export default {
|
||||
name: "ContractDetail",
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
pageJson:{},//页面传参
|
||||
loading:false,
|
||||
loadingBtn:false,
|
||||
baseInfo: {
|
||||
contractName:undefined,
|
||||
contractTitle:undefined,
|
||||
contractType:undefined,
|
||||
areaId:undefined,
|
||||
canteenId:undefined,
|
||||
stallId:undefined,
|
||||
effId:undefined,
|
||||
dateRange:[],
|
||||
},
|
||||
// 表单校验
|
||||
baseRules: {
|
||||
contractName: [
|
||||
contractTitle: [
|
||||
{ required: true, message: "菜谱名称不能为空", trigger: "blur" }
|
||||
],
|
||||
areaId: [
|
||||
|
|
@ -229,18 +241,21 @@ export default {
|
|||
canteenId: [
|
||||
{ required: true, message: "所属食堂不能为空", trigger: "change" }
|
||||
],
|
||||
stallId: [
|
||||
{ required: true, message: "所属档口不能为空", trigger: "change" }
|
||||
supplierId: [
|
||||
{ required: true, message: "供应商不能为空", trigger: "change" }
|
||||
],
|
||||
contractType: [
|
||||
{ required: true, message: "菜谱类型不能为空", trigger: "change" }
|
||||
contractSigningTime: [
|
||||
{ required: true, message: "签订日期不能为空", trigger: "change" }
|
||||
],
|
||||
dateRange: [
|
||||
{ required: true, message: "合同生效周期不能为空", trigger: "change" }
|
||||
]
|
||||
},
|
||||
treeAreaOptions:[],
|
||||
canteenOptions:[],
|
||||
supplierOptions:[],
|
||||
stallOptions:[],
|
||||
dateRange:[],
|
||||
|
||||
pickerOptions: {
|
||||
disabledDate(v) {
|
||||
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
||||
|
|
@ -259,11 +274,16 @@ export default {
|
|||
//表格数据
|
||||
tableListData: [],
|
||||
batchChosenMaterial:[],
|
||||
noMaterial:false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getAreaTreeData()
|
||||
this.getTypeTreeData()
|
||||
this.getMaterialTree()
|
||||
if(this.$route.query.pageJson){
|
||||
this.pageJson = JSON.parse(this.$route.query.pageJson)
|
||||
this.getContractInfo()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 返回列表页
|
||||
|
|
@ -272,6 +292,27 @@ export default {
|
|||
this.$tab.closeOpenPage(obj);
|
||||
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); // 要打开的页面
|
||||
},
|
||||
getContractInfo(){
|
||||
console.log(this.pageJson)
|
||||
let param = {
|
||||
contractId:this.pageJson.contractId
|
||||
}
|
||||
//查询查询食堂下拉结构
|
||||
getPurchaseContractInfoApi(param).then((response) => {
|
||||
this.baseInfo = response.data;
|
||||
this.$set(this.baseInfo,'dateRange',[this.baseInfo.contractStartTime,this.baseInfo.contractEndTime])
|
||||
this.contractMaterialList = this.baseInfo.purchaseContractDetailList;
|
||||
this.$set(this.baseInfo,"contractAmount",this.baseInfo.contractAmount/100)
|
||||
getCanteenByAreaApi({areaId:this.baseInfo.areaId}).then((response) => {
|
||||
this.canteenOptions=response.rows||[];
|
||||
this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId)
|
||||
});
|
||||
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
|
||||
this.supplierOptions = response.rows||[];
|
||||
this.$set(this.baseInfo,'supplierId',this.baseInfo.supplierId)
|
||||
});
|
||||
});
|
||||
},
|
||||
//区域树
|
||||
getAreaTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
|
|
@ -291,18 +332,28 @@ export default {
|
|||
},
|
||||
//选中区域-查询食堂
|
||||
handleAreaChange(e){
|
||||
this.getCanteenData()
|
||||
this.getSupplierData()
|
||||
},
|
||||
/** 查询查询食堂下拉结构 */
|
||||
getCanteenData() {
|
||||
let param= {
|
||||
areaId:this.baseInfo.areaId
|
||||
}
|
||||
getCanteenByAreaApi(param).then((response) => {
|
||||
this.canteenOptions=response.rows||[]
|
||||
this.canteenOptions=response.rows||[];
|
||||
this.$set(this.baseInfo,"canteenId",null)
|
||||
});
|
||||
// getSupplierByAreaApi(param).then((response) => {
|
||||
// this.supplierOptions=response.rows||[]
|
||||
// });
|
||||
},
|
||||
/** 查询原料类别下拉树结构 */
|
||||
getTypeTreeData() {
|
||||
/** 查询供应商下拉结构 */
|
||||
getSupplierData() {
|
||||
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
|
||||
this.supplierOptions = response.rows||[];
|
||||
this.$set(this.baseInfo,"supplierId",null)
|
||||
});
|
||||
},
|
||||
/** 查询货品类别下拉树结构 */
|
||||
getMaterialTree() {
|
||||
let param = {
|
||||
// goodsType:1
|
||||
}
|
||||
|
|
@ -315,11 +366,16 @@ export default {
|
|||
//this.formatDate(e[0])
|
||||
},
|
||||
addMaterial(){
|
||||
if(this.baseInfo.areaId!=undefined){
|
||||
this.openDialog=true
|
||||
this.resetQuery()
|
||||
setTimeout(()=>{
|
||||
this.$refs.multipleTable1.clearSelection()
|
||||
},300)
|
||||
}else{
|
||||
this.$modal.msgError("请先选择区域");
|
||||
}
|
||||
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
|
@ -350,50 +406,68 @@ export default {
|
|||
},
|
||||
handleSelectionChange2(selection) {
|
||||
this.batchChosenMaterial = selection;
|
||||
this.batchChosenMaterial.forEach(item=>{
|
||||
this.$set(item,"orderNum",0)
|
||||
this.$set(item,"singlePrice",item.unitPrice/100)
|
||||
})
|
||||
},
|
||||
confirmChosen(){
|
||||
console.log(this.batchChosenMaterial)
|
||||
if(this.batchChosenMaterial.length>0){
|
||||
this.loading = true
|
||||
this.contractMaterialList = this.batchChosenMaterial;
|
||||
setTimeout(()=>{
|
||||
this.loading = false
|
||||
this.openDialog=false
|
||||
},500)
|
||||
}
|
||||
},
|
||||
// 提交按钮
|
||||
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.loadingBtn=true
|
||||
// addMenucontractApi(param).then((response) => {
|
||||
// this.loadingBtn=false
|
||||
// this.jumpList()
|
||||
// }).catch(() => {
|
||||
// this.loadingBtn=false
|
||||
// });
|
||||
// }
|
||||
console.log(this.baseInfo)
|
||||
let param = Object.assign({},this.baseInfo);
|
||||
param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
|
||||
param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
|
||||
param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
|
||||
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
|
||||
param.contractAmount = this.baseInfo.contractAmount*100
|
||||
param.purchaseContractDetailList = []
|
||||
console.log(this.contractMaterialList)
|
||||
this.noMaterial = true;
|
||||
if(this.contractMaterialList.length>0){
|
||||
this.noMaterial = false;
|
||||
this.contractMaterialList.forEach(item=>{
|
||||
let obj = Object.assign({}, item)
|
||||
obj.singlePrice = Number(obj.singlePrice)*100
|
||||
param.purchaseContractDetailList.push(obj)
|
||||
})
|
||||
}
|
||||
console.log(param)
|
||||
if(this.noMaterial){
|
||||
this.$modal.msgError("请添加货品!");
|
||||
}else{
|
||||
this.loadingBtn=true;
|
||||
if (this.baseInfo.contractId != undefined) {
|
||||
editPurchaseContractApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.loadingBtn=false
|
||||
this.jumpList()
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
} else {
|
||||
addPurchaseContractApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.loadingBtn=false
|
||||
this.jumpList()
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -407,6 +481,7 @@ export default {
|
|||
//日期
|
||||
formatDate(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');
|
||||
|
|
|
|||
|
|
@ -7,13 +7,14 @@
|
|||
<el-form-item label="合同日期">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
type="datetimerange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" clearable
|
||||
format="yyyy-MM-dd" style="width: 220px"
|
||||
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>
|
||||
|
|
@ -66,16 +67,41 @@
|
|||
<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="contractCode" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="合同标题" align="center" prop="contractTitle" :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" prop="contractSigningTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="合同状态" align="center" prop="contractStatus" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.contractStatus==1">待生效</span>
|
||||
<span v-if="scope.row.contractStatus==2">履行中</span>
|
||||
<span v-if="scope.row.contractStatus==3">已失效</span>
|
||||
<span v-if="scope.row.contractStatus==4">已终止</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交状态" align="center" prop="commitStatus" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.commitStatus==1">待提交</span>
|
||||
<span v-if="scope.row.commitStatus==2">已提交</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同总金额(元)" align="center" prop="contractAmount" :show-overflow-tooltip="true" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.contractAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="配送食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="合同周期" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.contractStartTime }} - {{ scope.row.contractEndTime }}</span>
|
||||
</template>
|
||||
</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" prop="contractPerson" :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" width="180" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -121,7 +147,7 @@
|
|||
|
||||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
|
||||
import { getPageCanteenApi } from "@/api/base/canteen";
|
||||
import { purchaseContractPageApi,getPurchaseContractInfoApi,addPurchaseContractApi,editPurchaseContractApi,delPurchaseContractApi } from "@/api/foodManage/purchaseManage";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
|
|
@ -195,7 +221,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getTreeData();
|
||||
// this.getList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//区域树
|
||||
|
|
@ -211,6 +237,7 @@ export default {
|
|||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = []
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
|
@ -220,9 +247,20 @@ export default {
|
|||
let param = {
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
"searchValue": this.queryParams.searchValue,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"commitStatus": this.queryParams.commitStatus,
|
||||
"contractStatus": this.queryParams.contractStatus
|
||||
}
|
||||
getPageCanteenApi(param).then(response => {
|
||||
this.tableListData = response.records;
|
||||
if(this.dateRange.length>0){
|
||||
param.startDateTime = this.formatDate(this.dateRange[0])
|
||||
param.endDateTime = this.formatDate(this.dateRange[1])
|
||||
}else{
|
||||
param.startDateTime = ""
|
||||
param.endDateTime = ""
|
||||
}
|
||||
purchaseContractPageApi(param).then(response => {
|
||||
this.tableListData = response.rows;
|
||||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
@ -237,7 +275,7 @@ export default {
|
|||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
// this.$router.push({ path: "/foodManage/purchaseManage/contractEdit",query: {pageJson:JSON.stringify(row)} });
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/contractEdit",query: {pageJson:JSON.stringify(row)} });
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
@ -271,9 +309,8 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictIds = row.dictId || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
||||
// return delType(dictIds);
|
||||
return delPurchaseContractApi({contractIds:[row.contractId]});
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
|
@ -287,10 +324,14 @@ export default {
|
|||
//日期
|
||||
formatDate(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');
|
||||
return `${year}-${month}-${day}`;
|
||||
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}`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ export default {
|
|||
"pageSize": this.queryParams.pageSize,
|
||||
"supplierName": this.queryParams.supplierName,
|
||||
"categoryIdList": this.queryParams.categoryIdList,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"areaIdList": [this.queryParams.areaId],
|
||||
"linkman": this.queryParams.linkman,
|
||||
"status": this.queryParams.status
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue