采购合同接口对接

This commit is contained in:
zzyuan 2025-07-01 18:14:48 +08:00
parent 718e0394de
commit 283fb472de
4 changed files with 313 additions and 136 deletions

View File

@ -20,11 +20,72 @@ export function getMaterialListApi(data) {
params: 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",
}
})
}

View File

@ -2,11 +2,11 @@
<div style="padding: 10px;background: #E5EBF6;min-height: 830px;"> <div style="padding: 10px;background: #E5EBF6;min-height: 830px;">
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;"> <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 :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px">
<el-form-item label="合同编号" prop="contractNum"> <el-form-item label="合同编号" prop="contractCode">
<el-input v-model="baseInfo.contractNum" placeholder="请输入合同编号" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.contractCode" placeholder="合同编号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="合同标题" prop="contractName"> <el-form-item label="合同标题" prop="contractTitle">
<el-input v-model="baseInfo.contractName" placeholder="请输入合同标题" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.contractTitle" placeholder="请输入合同标题" maxlength="20" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="所属区域" prop="areaId"> <el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="baseInfo.areaId" <el-cascader v-model="baseInfo.areaId"
@ -36,17 +36,17 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="签订日期" prop="contractDate"> <el-form-item label="签订日期" prop="contractSigningTime">
<el-date-picker <el-date-picker
v-model="baseInfo.contractDate" v-model="baseInfo.contractSigningTime"
type="date" align="right" type="date" align="right"
format="yyyy-MM-dd" style="width: 240px;" format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions"> :picker-options="pickerOptions" @change="baseInfo.contractSigningTime=formatDate(baseInfo.contractSigningTime)">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="合同生效周期"> <el-form-item label="合同生效周期" prop="dateRange">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="baseInfo.dateRange"
type="datetimerange" type="datetimerange"
align="right" align="right"
unlink-panels unlink-panels
@ -58,37 +58,37 @@
:picker-options="pickerOptions" > :picker-options="pickerOptions" >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="付款方式" prop="payType"> <el-form-item label="付款方式" prop="payMoneyStyle">
<el-radio-group v-model="baseInfo.payType" > <el-radio-group v-model="baseInfo.payMoneyStyle" >
<el-radio :label="1" style="font-size: 14px;">一次性付款</el-radio> <el-radio label="1" style="font-size: 14px;">一次性付款</el-radio>
<el-radio :label="2" style="font-size: 14px;">分期付款</el-radio> <el-radio label="2" style="font-size: 14px;">分期付款</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="付款日期" prop="payDate"> <el-form-item label="付款日期" prop="payMoneyDate">
<el-date-picker <el-date-picker
v-model="baseInfo.payDate" v-model="baseInfo.payMoneyDate"
type="date" align="right" type="date" align="right"
format="yyyy-MM-dd" style="width: 240px;" format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions"> :picker-options="pickerOptions" @change="baseInfo.payMoneyDate=formatDate(baseInfo.payMoneyDate)">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="收款银行" prop="payDate"> <el-form-item label="收款银行" prop="collectMoneyBank">
<el-input v-model="baseInfo.contractName" placeholder="请输入收款银行" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.collectMoneyBank" placeholder="请输入收款银行" maxlength="20" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="收款账户名称" prop="payDate"> <el-form-item label="收款账户名称" prop="collectMoneyAccountName">
<el-input v-model="baseInfo.contractName" placeholder="请输入收款账户名称" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.collectMoneyAccountName" placeholder="请输入收款账户名称" maxlength="20" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="收款账号" prop="payDate"> <el-form-item label="收款账号" prop="collectMoneyAccount">
<el-input v-model="baseInfo.contractName" placeholder="请输入收款账号" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.collectMoneyAccount" placeholder="请输入收款账号" maxlength="20" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="payDate"> <el-form-item label="备注" prop="remark">
<el-input v-model="baseInfo.contractName" placeholder="请输入备注" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.remark" placeholder="请输入备注" maxlength="30" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="负责人" prop="payDate"> <el-form-item label="负责人" prop="contractPerson">
<el-input v-model="baseInfo.contractName" placeholder="请输入负责人" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.contractPerson" placeholder="请输入负责人" maxlength="20" clearable style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="合同总金额" prop="payDate"> <el-form-item label="合同总金额" prop="contractAmount">
<el-input v-model="baseInfo.contractName" placeholder="请输入合同总金额" maxlength="20" clearable style="width: 240px"/> <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-item>
</el-form> </el-form>
</div> </div>
@ -103,7 +103,7 @@
</div> </div>
</div> </div>
<div style="width: 100%;height: 400px;overflow-y: auto;"> <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 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" 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" /> -->
@ -117,14 +117,26 @@
<span v-if="scope.row.salesMode==2">称重</span> <span v-if="scope.row.salesMode==2">称重</span>
</template> </template>
</el-table-column> </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"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" prop="" :show-overflow-tooltip="true" /> <el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true" /> <template slot-scope="scope">
<el-table-column label="备注" align="center" prop="" :show-overflow-tooltip="true" /> <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> </el-table>
</div> </div>
</div> </div>
@ -201,26 +213,26 @@
<script> <script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall"; 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 { export default {
name: "ContractDetail", name: "ContractDetail",
dicts: [], dicts: [],
data() { data() {
return { return {
pageJson:{},//
loading:false, loading:false,
loadingBtn:false, loadingBtn:false,
baseInfo: { baseInfo: {
contractName:undefined, contractTitle:undefined,
contractType:undefined, contractType:undefined,
areaId:undefined, areaId:undefined,
canteenId:undefined, canteenId:undefined,
stallId:undefined, dateRange:[],
effId:undefined,
}, },
// //
baseRules: { baseRules: {
contractName: [ contractTitle: [
{ required: true, message: "菜谱名称不能为空", trigger: "blur" } { required: true, message: "菜谱名称不能为空", trigger: "blur" }
], ],
areaId: [ areaId: [
@ -229,18 +241,21 @@ export default {
canteenId: [ canteenId: [
{ required: true, message: "所属食堂不能为空", trigger: "change" } { required: true, message: "所属食堂不能为空", trigger: "change" }
], ],
stallId: [ supplierId: [
{ required: true, message: "所属档口不能为空", trigger: "change" } { required: true, message: "供应商不能为空", trigger: "change" }
], ],
contractType: [ contractSigningTime: [
{ required: true, message: "菜谱类型不能为空", trigger: "change" } { required: true, message: "签订日期不能为空", trigger: "change" }
],
dateRange: [
{ required: true, message: "合同生效周期不能为空", trigger: "change" }
] ]
}, },
treeAreaOptions:[], treeAreaOptions:[],
canteenOptions:[], canteenOptions:[],
supplierOptions:[], supplierOptions:[],
stallOptions:[], stallOptions:[],
dateRange:[],
pickerOptions: { pickerOptions: {
disabledDate(v) { disabledDate(v) {
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000 return v.getTime() < (new Date().getTime() - 86400000);// - 86400000
@ -259,11 +274,16 @@ export default {
// //
tableListData: [], tableListData: [],
batchChosenMaterial:[], batchChosenMaterial:[],
noMaterial:false,
}; };
}, },
created() { created() {
this.getAreaTreeData() this.getAreaTreeData()
this.getTypeTreeData() this.getMaterialTree()
if(this.$route.query.pageJson){
this.pageJson = JSON.parse(this.$route.query.pageJson)
this.getContractInfo()
}
}, },
methods: { methods: {
// //
@ -272,6 +292,27 @@ export default {
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); // 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() { getAreaTreeData() {
systemAreaTreeApi({}).then((response) => { systemAreaTreeApi({}).then((response) => {
@ -290,36 +331,51 @@ export default {
} }
}, },
//- //-
handleAreaChange(e){ handleAreaChange(e){
this.getCanteenData()
this.getSupplierData()
},
/** 查询查询食堂下拉结构 */
getCanteenData() {
let param= { let param= {
areaId:this.baseInfo.areaId areaId:this.baseInfo.areaId
} }
getCanteenByAreaApi(param).then((response) => { 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||[] /** 查询供应商下拉结构 */
// }); getSupplierData() {
}, supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
/** 查询原料类别下拉树结构 */ this.supplierOptions = response.rows||[];
getTypeTreeData() { this.$set(this.baseInfo,"supplierId",null)
let param = { });
},
/** 查询货品类别下拉树结构 */
getMaterialTree() {
let param = {
// goodsType:1 // goodsType:1
} }
systemMaterialTreeApi(param).then((response) => { systemMaterialTreeApi(param).then((response) => {
this.materialTreeOptions = response.data; this.materialTreeOptions = response.data;
}); });
}, },
// //
changeDateRange(e){ changeDateRange(e){
//this.formatDate(e[0]) //this.formatDate(e[0])
}, },
addMaterial(){ addMaterial(){
this.openDialog=true if(this.baseInfo.areaId!=undefined){
this.resetQuery() this.openDialog=true
setTimeout(()=>{ this.resetQuery()
this.$refs.multipleTable1.clearSelection() setTimeout(()=>{
},300) this.$refs.multipleTable1.clearSelection()
},300)
}else{
this.$modal.msgError("请先选择区域");
}
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -350,50 +406,68 @@ export default {
}, },
handleSelectionChange2(selection) { handleSelectionChange2(selection) {
this.batchChosenMaterial = selection; this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
this.$set(item,"orderNum",0)
this.$set(item,"singlePrice",item.unitPrice/100)
})
}, },
confirmChosen(){ 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(){ confirmSubmit(){
this.$refs["baseInfo"].validate(valid => { this.$refs["baseInfo"].validate(valid => {
if (valid) { if (valid) {
// let param = this.baseInfo console.log(this.baseInfo)
// if(this.baseInfo.contractType==1){ let param = Object.assign({},this.baseInfo);
// param.contractDateList = this.dateRangeList; param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
// } param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
// if(this.baseInfo.contractType==2){ param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
// param.contractDateList = [{ param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
// anyone:"repeat", param.contractAmount = this.baseInfo.contractAmount*100
// detailList:this.detailList param.purchaseContractDetailList = []
// }] console.log(this.contractMaterialList)
// } this.noMaterial = true;
// if(this.baseInfo.contractType==3){ if(this.contractMaterialList.length>0){
// param.contractDateList = this.weekDateList this.noMaterial = false;
// } this.contractMaterialList.forEach(item=>{
// this.noDishes = true; let obj = Object.assign({}, item)
// param.contractDateList.forEach(item=>{ obj.singlePrice = Number(obj.singlePrice)*100
// item.detailList.forEach(subItem=>{ param.purchaseContractDetailList.push(obj)
// if(subItem.dishesList.length>0){ })
// this.noDishes=false }
// subItem.dishesList.forEach(dishItem=>{ console.log(param)
// dishItem.price = Number(dishItem.price) if(this.noMaterial){
// dishItem.salePrice = Number(dishItem.salePrice) this.$modal.msgError("请添加货品!");
// }) }else{
// } this.loadingBtn=true;
// }) if (this.baseInfo.contractId != undefined) {
// }) editPurchaseContractApi(param).then((response) => {
// if(this.noDishes){ this.$modal.msgSuccess("修改成功");
// this.$modal.msgError(""); this.loadingBtn=false
// }else{ this.jumpList()
// this.loadingBtn=true }).catch(() => {
// addMenucontractApi(param).then((response) => { this.loadingBtn=false
// this.loadingBtn=false });
// this.jumpList() } else {
// }).catch(() => { addPurchaseContractApi(param).then((response) => {
// this.loadingBtn=false this.$modal.msgSuccess("保存成功");
// }); this.loadingBtn=false
// } this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
}
}
} }
}); });
}, },
@ -407,6 +481,7 @@ export default {
// //
formatDate(date) { formatDate(date) {
// YYYY-MM-DD // YYYY-MM-DD
date = new Date(date)
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0 const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0');

View File

@ -7,15 +7,16 @@
<el-form-item label="合同日期"> <el-form-item label="合同日期">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
type="daterange" type="datetimerange"
align="right" align="right"
unlink-panels unlink-panels
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" clearable end-placeholder="结束日期"
format="yyyy-MM-dd" style="width: 220px" format="yyyy-MM-dd HH:mm:ss" style="width: 400px"
:default-time="['00:00:00', '23:59:59']"
:picker-options="pickerOptions" > :picker-options="pickerOptions" >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="所属区域" prop="areaId"> <el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams.areaId" <el-cascader v-model="queryParams.areaId"
@ -66,16 +67,41 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合同编号" align="center" prop="contractNum" :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="contractName" :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" width="120"/>
<el-table-column label="签订日期" align="center" prop="areaName" :show-overflow-tooltip="true"/> <el-table-column label="签订日期" align="center" prop="contractSigningTime" :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="contractStatus" :show-overflow-tooltip="true" width="100">
<el-table-column label="提交状态" align="center" prop="areaName" :show-overflow-tooltip="true" width="100"/> <template slot-scope="scope">
<el-table-column label="合同总金额(元)" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/> <span v-if="scope.row.contractStatus==1">待生效</span>
<el-table-column label="供应商" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/> <span v-if="scope.row.contractStatus==2">履行中</span>
<el-table-column label="合同周期" align="center" prop="areaName" :show-overflow-tooltip="true"/> <span v-if="scope.row.contractStatus==3">已失效</span>
<el-table-column label="制表人" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/> <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"> <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -120,8 +146,8 @@
</template> </template>
<script> <script>
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall"; 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 { export default {
name: "", name: "",
@ -195,7 +221,7 @@ export default {
}, },
created() { created() {
this.getTreeData(); this.getTreeData();
// this.getList(); this.getList();
}, },
methods: { methods: {
// //
@ -211,6 +237,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
@ -220,9 +247,20 @@ export default {
let param = { let param = {
"pageNum": this.queryParams.pageNum, "pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize, "pageSize": this.queryParams.pageSize,
"searchValue": this.queryParams.searchValue,
"areaId": this.queryParams.areaId,
"commitStatus": this.queryParams.commitStatus,
"contractStatus": this.queryParams.contractStatus
} }
getPageCanteenApi(param).then(response => { if(this.dateRange.length>0){
this.tableListData = response.records; 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.total = Number(response.total);
this.loading = false; this.loading = false;
}); });
@ -237,7 +275,7 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { 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() { cancel() {
@ -270,10 +308,9 @@ export default {
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() { this.$modal.confirm('是否确认删除数据项?').then(function() {
// return delType(dictIds); return delPurchaseContractApi({contractIds:[row.contractId]});
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
@ -284,13 +321,17 @@ export default {
// //
formatDate(date) { formatDate(date) {
// YYYY-MM-DD // YYYY-MM-DD
date = new Date(date)
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0 const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '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}`;
} }
} }
}; };

View File

@ -612,7 +612,7 @@ export default {
"pageSize": this.queryParams.pageSize, "pageSize": this.queryParams.pageSize,
"supplierName": this.queryParams.supplierName, "supplierName": this.queryParams.supplierName,
"categoryIdList": this.queryParams.categoryIdList, "categoryIdList": this.queryParams.categoryIdList,
"areaId": this.queryParams.areaId, "areaIdList": [this.queryParams.areaId],
"linkman": this.queryParams.linkman, "linkman": this.queryParams.linkman,
"status": this.queryParams.status "status": this.queryParams.status
} }