采购验货接口对接

This commit is contained in:
zzyuan 2025-07-03 16:04:23 +08:00
parent 978c6f7d93
commit c8d55f8cb5
5 changed files with 332 additions and 338 deletions

View File

@ -166,7 +166,7 @@ export function delPurchasePlanApi(data) {
// -------------采购计划---------------
// -------------采购订单---------------
//查询采购订单主列表
export function purchaseOrderPageApi(data) {
return request({
@ -228,7 +228,64 @@ export function delPurchaseOrderApi(data) {
// -------------采购验货---------------
//查询验货单列表
export function purchaseInspectPageApi(data) {
return request({
url: '/smart-canteen/ims_inspect_goods/list',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data:data,
params:{
pageNum:data.pageNum,
pageSize:data.pageSize
}
})
}
//获取采购验货主详细信息
export function getPurchaseInspectInfoApi(data) {
return request({
url: '/smart-canteen/ims_inspect_goods/'+data.inspectGoodsId,
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
}
})
}
// 新增采购验货
export function addPurchaseInspectApi(data) {
return request({
url: '/smart-canteen/ims_inspect_goods',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改采购验货
export function editPurchaseInspectApi(data) {
return request({
url: '/smart-canteen/ims_inspect_goods/edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除采购验货
export function delPurchaseInspectApi(data) {
return request({
url: '/smart-canteen/ims_inspect_goods/del/'+data.inspectGoodsIds,
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
}
})
}

View File

@ -3,66 +3,40 @@
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
<el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border>
<el-descriptions-item>
<template slot="label">合同编号</template>
{{baseInfo.contractCode}}
<template slot="label">验货单编号</template>
{{baseInfo.inspectGoodsCode}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">合同标题</template>
{{ baseInfo.contractTitle }}
<template slot="label">送货日期</template>
{{ baseInfo.deliveryDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">所属区域</template>
{{ baseInfo.areaName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">供应商</template>
{{ baseInfo.supplierName }}
<template slot="label">送货仓库</template>
{{ baseInfo.deliveryWarehouseName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">配送食堂</template>
{{ baseInfo.canteenName }}
<template slot="label">送货供应商</template>
{{ baseInfo.deliverySupplierName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">签订日期</template>
{{ baseInfo.contractSigningTime }}
<template slot="label">送货人</template>
{{ baseInfo.deliveryMan }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">合同生效周期</template>
{{ baseInfo.contractStartTime }} - {{ baseInfo.contractEndTime }}
<template slot="label">送货人电话</template>
{{ baseInfo.deliveryPhone }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">合同状态</template>
{{ baseInfo.deptName }}
<el-tag size="small" v-if="baseInfo.contractStatus==1">待生效</el-tag>
<el-tag size="small" v-if="baseInfo.contractStatus==2">履行中</el-tag>
<el-tag size="small" v-if="baseInfo.contractStatus==3">已失效</el-tag>
<el-tag size="small" v-if="baseInfo.contractStatus==4">已终止</el-tag>
<template slot="label">验货日期</template>
{{ baseInfo.inspectDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">合同附件</template>
<div v-for="(item,index) in baseInfo.contractAttachmentList" :key="index">
<a :href="item" download="demo">{{ item }}</a>
</div>
</el-descriptions-item>
</el-descriptions>
<el-descriptions style="margin-bottom: 20px;" title="付款信息" :column="4" size="medium" border>
<el-descriptions-item>
<template slot="label">付款方式</template>
<span v-if="baseInfo.payMoneyStyle==1">一次性付款</span>
<span v-if="baseInfo.payMoneyStyle==2">分期付款</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">付款日期</template>
{{ baseInfo.payMoneyDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">收款银行</template>
{{ baseInfo.collectMoneyBank }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">收款账户名称</template>
{{ baseInfo.collectMoneyAccountName }}
<template slot="label">验货人</template>
{{ baseInfo.inspector }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">备注</template>
@ -78,7 +52,7 @@
</div>
</div>
<div style="width: 100%;height: 400px;overflow-y: auto;">
<el-table v-loading="loading" :data="contractMaterialList" ref="multipleTable" height="380" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="materialList" 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" /> -->
@ -92,17 +66,19 @@
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="singlePrice" :show-overflow-tooltip="true">
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.singlePrice/100).toFixed(2) }}</span>
<span>{{ (scope.row.unitPrice).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true"></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>
<span>{{ scope.row.orderNum*scope.row.unitPrice }}</span>
</template>
</el-table-column>
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"></el-table-column>
</el-table>
</div>
@ -115,11 +91,11 @@
</template>
<script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseContractInfoApi,addPurchaseContractApi,editPurchaseContractApi,delPurchaseContractApi } from "@/api/foodManage/purchaseManage";
import { getCanteenByAreaApi } from "@/api/base/stall";
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseInspectInfoApi } from "@/api/foodManage/purchaseManage";
export default {
name: "inspectionDetail",
name: "InspectionDetail",
dicts: [],
data() {
return {
@ -164,7 +140,7 @@ export default {
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000
}
},
contractMaterialList:[],
materialList:[],
openDialog:false,
materialTreeOptions:[],
//
@ -189,29 +165,22 @@ export default {
methods: {
//
jumpList() {
const obj = { path: "foodManage/purchaseManage/contractDetail" };
const obj = { path: "foodManage/purchaseManage/inspectionDetail" };
this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); //
this.$router.replace({ path: "/foodManage/purchaseManage/purchaseInspection" }); //
},
getContractInfo(){
console.log(this.pageJson)
let param = {
contractId:this.pageJson.contractId
inspectGoodsId:this.pageJson.inspectGoodsId
}
//
getPurchaseContractInfoApi(param).then((response) => {
getPurchaseInspectInfoApi(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)
});
this.materialList = this.baseInfo.inspectGoodsDetails;
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",Number(item.unitPrice)/100)
})
});
},
//

View File

@ -2,11 +2,16 @@
<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="contractCode">
<el-input v-model="baseInfo.contractCode" placeholder="合同编号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
<el-form-item label="验货单编号" prop="inspectGoodsCode">
<el-input v-model="baseInfo.inspectGoodsCode" placeholder="合同编号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="合同标题" prop="contractTitle">
<el-input v-model="baseInfo.contractTitle" placeholder="请输入合同标题" maxlength="20" clearable style="width: 240px"/>
<el-form-item label="送货日期" prop="deliveryDate">
<el-date-picker
v-model="baseInfo.deliveryDate"
type="date" align="right"
format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.deliveryDate=formatDate(baseInfo.deliveryDate)">
</el-date-picker>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="baseInfo.areaId"
@ -18,17 +23,17 @@
}" @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-form-item label="送货仓库" prop="deliveryWarehouseId">
<el-select v-model="baseInfo.deliveryWarehouseId" clearable placeholder="请选择送货仓库" style="width: 100%;">
<el-option v-for="item in wareHouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select v-model="baseInfo.supplierId" placeholder="请选择供应商" style="width: 240px;">
<el-form-item label="送货供应商" prop="deliverySupplierId">
<el-select v-model="baseInfo.deliverySupplierId" placeholder="请选择供应商" style="width: 240px;">
<el-option v-for="item in supplierOptions"
:key="item.supplierId"
:label="item.supplierName"
@ -36,78 +41,26 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="签订日期" prop="contractSigningTime">
<el-form-item label="送货人" prop="deliveryMan">
<el-input v-model="baseInfo.deliveryMan" placeholder="请输入送货人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="送货人电话" prop="deliveryPhone">
<el-input v-model="baseInfo.deliveryPhone" placeholder="请输入送货人电话" maxlength="11" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="验货日期" prop="inspectDate">
<el-date-picker
v-model="baseInfo.contractSigningTime"
type="date" align="right"
format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.contractSigningTime=formatDate(baseInfo.contractSigningTime)">
v-model="baseInfo.inspectDate"
type="datetime" align="right"
format="yyyy-MM-dd HH:mm:ss" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.inspectDate=formatDateTime(baseInfo.inspectDate)">
</el-date-picker>
</el-form-item>
<el-form-item label="合同生效周期" prop="dateRange">
<el-date-picker
v-model="baseInfo.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="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="payMoneyDate">
<el-date-picker
v-model="baseInfo.payMoneyDate"
type="date" align="right"
format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.payMoneyDate=formatDate(baseInfo.payMoneyDate)">
</el-date-picker>
</el-form-item>
<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="collectMoneyAccountName">
<el-input v-model="baseInfo.collectMoneyAccountName" placeholder="请输入收款账户名称" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="收款账号" prop="collectMoneyAccount">
<el-input v-model="baseInfo.collectMoneyAccount" placeholder="请输入收款账号" maxlength="20" clearable style="width: 240px"/>
<el-form-item label="验货人" prop="inspector">
<el-input v-model="baseInfo.inspector" placeholder="请输入验货人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<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="contractPerson">
<el-input v-model="baseInfo.contractPerson" placeholder="请输入负责人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<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-item label="合同附件" prop="contractAttachmentList">
<el-upload
ref="upload"
:http-request="fileUpLoad"
action="#" :limit="5"
accept=".xlsx, .xls, .png, .jpg, .jpeg, .docx, .doc"
:show-file-list="true"
:file-list="attachmentList"
:on-remove="handleRemoveFile"
>
<el-button
:disabled="attachmentList.length==5"
type="primary"
size="mini"
>上传附件
</el-button>
</el-upload>
</el-form-item>
</el-form>
</div>
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;">
@ -121,7 +74,7 @@
</div>
</div>
<div style="width: 100%;height: 400px;overflow-y: auto;">
<el-table v-loading="loading" :data="contractMaterialList" ref="multipleTable" height="380" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="materialList" 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" /> -->
@ -135,19 +88,29 @@
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="singlePrice" :show-overflow-tooltip="true">
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.singlePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.singlePrice=v.replace(/[^\d.]/g,''))"/>
<el-input v-model="scope.row.unitPrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.unitPrice=v.replace(/[^\d.]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<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>
<span>{{ scope.row.orderNum*scope.row.unitPrice }}</span>
</template>
</el-table-column>
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.deliveryNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.deliveryNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.qualifiedNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.qualifiedNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
@ -233,8 +196,9 @@
<script>
import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseContractInfoApi,addPurchaseContractApi,editPurchaseContractApi,delPurchaseContractApi } from "@/api/foodManage/purchaseManage";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi,drpWareHousePageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseInspectInfoApi,addPurchaseInspectApi,editPurchaseInspectApi } from "@/api/foodManage/purchaseManage";
export default {
name: "InspectionEdit",
dicts: [],
@ -247,33 +211,47 @@ export default {
contractTitle:undefined,
contractType:undefined,
areaId:undefined,
canteenId:undefined,
dateRange:[],
},
//
baseRules: {
contractTitle: [
{ required: true, message: "菜谱名称不能为空", trigger: "blur" }
deliveryDate: [
{ required: true, message: "送货日期不能为空", trigger: "change" }
],
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "change" }
],
canteenId: [
{ required: true, message: "所属食堂不能为空", trigger: "change" }
deliverySupplierId: [
{ required: true, message: "送货供应商不能为空", trigger: "change" }
],
supplierId: [
{ required: true, message: "供应商不能为空", trigger: "change" }
deliveryWarehouseId: [
{ required: true, message: "送货仓库不能为空", trigger: "change" }
],
contractSigningTime: [
{ required: true, message: "签订日期不能为空", trigger: "change" }
deliveryMan: [
{ required: true, message: "送货人不能为空", trigger: "blur" }
],
dateRange: [
{ required: true, message: "合同生效周期不能为空", trigger: "change" }
deliveryPhone: [
{
required: true,
message: '送货人电话不能为空',
trigger: 'blur',
},
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur',
}
],
inspectDate: [
{ required: true, message: "验货日期不能为空", trigger: "change" }
],
inspector: [
{ required: true, message: "验货人不能为空", trigger: "blur" }
]
},
treeAreaOptions:[],
canteenOptions:[],
supplierOptions:[],
wareHouseOptions:[],
stallOptions:[],
pickerOptions: {
disabledDate(v) {
@ -281,7 +259,7 @@ export default {
}
},
attachmentList:[],
contractMaterialList:[],//-
materialList:[],//-
batchIds:[],//--
openDialog:false,
materialTreeOptions:[],
@ -299,7 +277,6 @@ export default {
created() {
this.getAreaTreeData()
this.getMaterialTree()
this.attachmentList=[]
if(this.$route.query.pageJson){
this.pageJson = JSON.parse(this.$route.query.pageJson)
this.getContractInfo()
@ -308,36 +285,29 @@ export default {
methods: {
//
jumpList() {
const obj = { path: "foodManage/purchaseManage/contractDetail" };
const obj = { path: "foodManage/purchaseManage/inspectionEdit" };
this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); //
this.$router.replace({ path: "/foodManage/purchaseManage/purchaseInspection" }); //
},
getContractInfo(){
console.log(this.pageJson)
let param = {
contractId:this.pageJson.contractId
inspectGoodsId:this.pageJson.inspectGoodsId
}
//
getPurchaseContractInfoApi(param).then((response) => {
getPurchaseInspectInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.$set(this.baseInfo,'dateRange',[this.baseInfo.contractStartTime,this.baseInfo.contractEndTime])
this.contractMaterialList = this.baseInfo.purchaseContractDetailList;
this.contractMaterialList.forEach(item=>{
this.$set(item,"singlePrice",Number(item.singlePrice)/100)
this.materialList = this.baseInfo.inspectGoodsDetails;
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",Number(item.unitPrice)/100)
})
if(this.baseInfo.contractAttachmentList.length>0){
this.baseInfo.contractAttachmentList.forEach(item=>{
this.attachmentList.push({name:item,url:item})
})
}
this.$set(this.baseInfo,"contractAmount",Number(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)
this.$set(this.baseInfo,'deliverySupplierId',this.baseInfo.deliverySupplierId)
});
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
this.$set(this.baseInfo,'deliveryWarehouseId',this.baseInfo.deliveryWarehouseId)
});
});
},
@ -345,10 +315,6 @@ export default {
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) {
@ -360,24 +326,21 @@ export default {
},
//-
handleAreaChange(e){
this.getCanteenData()
this.getSupplierData()
},
/** 查询查询食堂下拉结构 */
getCanteenData() {
let param= {
areaId:this.baseInfo.areaId
}
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response.rows||[];
this.$set(this.baseInfo,"canteenId",null)
});
this.getWareHouseData()
},
/** 查询供应商下拉结构 */
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
this.supplierOptions = response.rows||[];
this.$set(this.baseInfo,"supplierId",null)
this.$set(this.baseInfo,"deliverySupplierId",null)
});
},
/** 查询供应商下拉结构 */
getWareHouseData() {
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
this.$set(this.baseInfo,'deliveryWarehouseId',null)
});
},
/** 查询货品类别下拉树结构 */
@ -400,9 +363,9 @@ export default {
//
delMaterial(){
this.batchIds.forEach(ID=>{
let index = this.contractMaterialList.findIndex(v=>v.materialId==ID)
let index = this.materialList.findIndex(v=>v.materialId==ID)
if(index>-1){
this.contractMaterialList.splice(index,1)
this.materialList.splice(index,1)
}
})
},
@ -450,13 +413,18 @@ export default {
this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
this.$set(item,"orderNum",0)
this.$set(item,"singlePrice",item.unitPrice/100)
this.$set(item,"unitPrice",item.unitPrice)
})
},
confirmChosen(){
if(this.batchChosenMaterial.length>0){
this.loading = true
this.contractMaterialList = this.batchChosenMaterial;
this.materialList = []
this.batchChosenMaterial.forEach(item=>{
let obj = Object.assign({}, item)
obj.unitPrice = item.unitPrice/100;
this.materialList.push(obj)
})
setTimeout(()=>{
this.loading = false
this.openDialog=false
@ -468,13 +436,12 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
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.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
param.contractAmount = this.baseInfo.contractAmount*100;
param.commitStatus=1
param.purchaseContractDetailList = []
param.deliveryTotalNum = 0;//
param.inspectQualifiedNum = 0;//
param.status=1
param.inspectGoodsDetails = []
param.contractAttachment = ""
if(this.attachmentList.length>0){
console.log(this.attachmentList)
@ -483,14 +450,17 @@ export default {
console.log(param)
}
this.noMaterial = false;
if(this.contractMaterialList.length>0){
this.contractMaterialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.unitPrice==0 || item.orderNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
obj.singlePrice = Number(obj.singlePrice)*100
param.purchaseContractDetailList.push(obj)
obj.unitPrice = Number(obj.unitPrice)*100
// obj.totalPrice = (Number(obj.unitPrice)*Number(obj.orderNum))
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//
param.inspectGoodsDetails.push(obj)
}
})
}
@ -498,7 +468,7 @@ export default {
this.$modal.msgError("请输入单价和数量!");
}else{
this.noMaterial = true;
if(this.contractMaterialList.length>0){
if(this.materialList.length>0){
this.noMaterial = false;
}
console.log(param)
@ -506,8 +476,8 @@ export default {
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.contractId != undefined) {
editPurchaseContractApi(param).then((response) => {
if (this.baseInfo.inspectGoodsId != undefined) {
editPurchaseInspectApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
@ -515,7 +485,7 @@ export default {
this.loadingBtn=false
});
} else {
addPurchaseContractApi(param).then((response) => {
addPurchaseInspectApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
@ -534,22 +504,31 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
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.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
param.contractAmount = this.baseInfo.contractAmount*100;
param.commitStatus=2
param.purchaseContractDetailList = []
param.deliveryTotalNum = 0;//
param.inspectQualifiedNum = 0;//
param.status=2
param.inspectGoodsDetails = []
param.contractAttachment = ""
if(this.attachmentList.length>0){
console.log(this.attachmentList)
let arr = this.attachmentList.map(item=>item.url)
param.contractAttachment = arr.join(',')
console.log(param)
}
this.noMaterial = false;
if(this.contractMaterialList.length>0){
this.contractMaterialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.unitPrice==0 || item.orderNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
obj.singlePrice = Number(obj.singlePrice)*100
param.purchaseContractDetailList.push(obj)
obj.unitPrice = Number(obj.unitPrice)*100
// obj.totalPrice = (Number(obj.unitPrice)*Number(obj.orderNum))
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//
param.inspectGoodsDetails.push(obj)
}
})
}
@ -557,7 +536,7 @@ export default {
this.$modal.msgError("请输入单价和数量!");
}else{
this.noMaterial = true;
if(this.contractMaterialList.length>0){
if(this.materialList.length>0){
this.noMaterial = false;
}
console.log(param)
@ -565,8 +544,8 @@ export default {
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.contractId != undefined) {
editPurchaseContractApi(param).then((response) => {
if (this.baseInfo.inspectGoodsId != undefined) {
editPurchaseInspectApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
@ -574,7 +553,7 @@ export default {
this.loadingBtn=false
});
} else {
addPurchaseContractApi(param).then((response) => {
addPurchaseInspectApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()

View File

@ -2,9 +2,18 @@
<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-input v-model="queryParams.searchValue" placeholder="请输入验货单号,送货单号,送货人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="合同日期">
<el-form-item label="供应商" prop="supplierId">
<el-select v-model="queryParams.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="验货日期">
<el-date-picker
v-model="dateRange"
type="datetimerange"
@ -18,30 +27,13 @@
: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,// falseid
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-form-item label="提交状态" prop="status">
<el-select v-model="queryParams.status" 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>
@ -67,39 +59,28 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<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="contractSigningTime" :show-overflow-tooltip="true"/>
<el-table-column label="合同状态" align="center" prop="contractStatus" :show-overflow-tooltip="true" width="100">
<el-table-column label="验货单编号" align="center" prop="inspectGoodsCode" :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="inspectDate" :show-overflow-tooltip="true"/>
<el-table-column label="验货人" align="center" prop="inspector" :show-overflow-tooltip="true"/>
<el-table-column label="送货单号" align="center" prop="relateDeliveryGoodsId" :show-overflow-tooltip="true"/>
<el-table-column label="送货供应商" align="center" prop="deliverySupplierName" :show-overflow-tooltip="true"/>
<el-table-column label="送货人" align="center" prop="deliveryMan" :show-overflow-tooltip="true"/>
<el-table-column label="送货人电话" align="center" prop="deliveryPhone" :show-overflow-tooltip="true"/>
<el-table-column label="送货仓库" align="center" prop="deliveryWarehouseId" :show-overflow-tooltip="true"/>
<el-table-column label="送货日期" align="center" prop="deliveryDate" :show-overflow-tooltip="true"/>
<el-table-column label="送货总数量" align="center" prop="deliveryTotalNum" :show-overflow-tooltip="true"/>
<el-table-column label="合格总数量" align="center" prop="inspectQualifiedNum" :show-overflow-tooltip="true"/>
<el-table-column label="提交状态" align="center" prop="status" :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>
<span v-if="scope.row.status==1">待提交</span>
<span v-if="scope.row.status==2">已提交</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="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">
@ -107,17 +88,17 @@
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.commitStatus==1"
icon="el-icon-edit" v-if="scope.row.status==1"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.commitStatus==2"
icon="el-icon-edit" v-if="scope.row.status==2"
@click="handleView(scope.row)"
>详情</el-button>
<!-- <el-button
size="mini" v-if="scope.row.commitStatus==1"
size="mini" v-if="scope.row.status==1"
type="text" :disabled="loadingBtn"
icon="el-icon-top"
@click="confirmSubmit(scope.row)"
@ -159,7 +140,8 @@
<script>
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
import { purchaseContractPageApi,getPurchaseContractInfoApi,addPurchaseContractApi,editPurchaseContractApi,delPurchaseContractApi } from "@/api/foodManage/purchaseManage";
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
import { purchaseInspectPageApi,editPurchaseInspectApi,delPurchaseInspectApi } from "@/api/foodManage/purchaseManage";
export default {
name: "",
@ -191,6 +173,7 @@ export default {
pageSize: 10,
},
treeOptions:[],//
supplierOptions:[],
dateRange:[],//
pickerOptions: {
shortcuts: [{
@ -234,6 +217,7 @@ export default {
},
created() {
this.getTreeData();
this.getSupplierData();
this.getList();
},
methods: {
@ -242,6 +226,12 @@ export default {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response.data;
});
},
/** 查询供应商下拉结构 */
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
},
/** 搜索按钮操作 */
handleQuery() {
@ -261,18 +251,17 @@ export default {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"searchValue": this.queryParams.searchValue,
"areaId": this.queryParams.areaId,
"commitStatus": this.queryParams.commitStatus,
"contractStatus": this.queryParams.contractStatus
"supplierId": this.queryParams.supplierId,
"status": this.queryParams.status,
}
if(this.dateRange.length>0){
param.startDateTime = this.formatDate(this.dateRange[0])
param.endDateTime = this.formatDate(this.dateRange[1])
param.startDateTime = this.formatDateTime(this.dateRange[0])
param.endDateTime = this.formatDateTime(this.dateRange[1])
}else{
param.startDateTime = ""
param.endDateTime = ""
}
purchaseContractPageApi(param).then(response => {
purchaseInspectPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
@ -323,7 +312,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delPurchaseContractApi({contractIds:[row.contractId]});
return delPurchaseInspectApi({inspectGoodsIds:[row.inspectGoodsId]});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
@ -333,8 +322,8 @@ export default {
confirmSubmit(row){
let param = Object.assign({},row);
this.loadingBtn=true
param.commitStatus=2
editPurchaseContractApi(param).then((response) => {
param.status=2
editPurchaseInspectApi(param).then((response) => {
this.$modal.msgSuccess("提交成功");
this.getList()
this.loadingBtn=false

View File

@ -334,8 +334,8 @@ export default {
// "approveStatus": this.queryParams.approveStatus
}
if(this.dateRange.length>0){
param.startDateTime = this.formatDate(this.dateRange[0])
param.endDateTime = this.formatDate(this.dateRange[1])
param.startDateTime = this.formatDateTime(this.dateRange[0])
param.endDateTime = this.formatDateTime(this.dateRange[1])
}else{
param.startDateTime = ""
param.endDateTime = ""