jsk 询价管理

This commit is contained in:
skjia 2025-07-20 12:36:08 +08:00
parent 71b4067b19
commit 43f63e365e
3 changed files with 258 additions and 212 deletions

View File

@ -23,7 +23,7 @@ export function getMaterialListApi(data) {
//查询供应商列表 isPaging 0不分页 2分页
export function supplierPageApi(data) {
return request({
url: '/smart-canteen/ims_supplier/list',
url: '/smart-canteen/ims_inquiry_supplier/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
@ -91,7 +91,7 @@ export function addPurchaseContractApi(data) {
},
data: data
})
}
}
// 编辑
export function editPurchaseContractApi(data) {
return request({
@ -118,7 +118,7 @@ export function delPurchaseContractApi(data) {
//获取采购询价分页列表
export function goodsInquiryPageApi(data) {
return request({
url: '/smart-canteen/ims_purchase_inquiry/list',
url: '/smart-canteen/ims_inquiry/list',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -133,28 +133,28 @@ export function goodsInquiryPageApi(data) {
//获取采购询价分页详情
export function getGoodsInquiryInfoApi(data) {
return request({
url: '/smart-canteen/ims_purchase_inquiry/'+data.inquiryId,
method: 'get',
url: '/smart-canteen/ims_inquiry/'+data.inquiryId,
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
}
})
}
}
// 新增采购询价
export function addGoodsInquiryApi(data) {
return request({
url: '/smart-canteen/ims_purchase_inquiry',
url: '/smart-canteen/ims_inquiry',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
}
// 修改采购询价
export function editGoodsInquiryApi(data) {
return request({
url: '/smart-canteen/ims_purchase_inquiry/edit',
url: '/smart-canteen/ims_inquiry/edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -173,7 +173,6 @@ export function delGoodsInquiryApi(data) {
})
}
// -------------生产计划---------------
//获取生产计划分页列表
export function productionPlanPageApi(data) {
@ -199,7 +198,7 @@ export function getProductionPlanInfoApi(data) {
//"merchant-id":"378915229716713472",
}
})
}
}
// 新增生产计划
export function addProductionPlanApi(data) {
return request({
@ -210,7 +209,7 @@ export function addProductionPlanApi(data) {
},
data: data
})
}
}
// 修改生产计划
export function editProductionPlanApi(data) {
return request({
@ -258,7 +257,7 @@ export function getPurchasePlanInfoApi(data) {
//"merchant-id":"378915229716713472",
}
})
}
}
// 新增采购计划
export function addPurchasePlanApi(data) {
return request({
@ -269,7 +268,7 @@ export function addPurchasePlanApi(data) {
},
data: data
})
}
}
// 修改采购计划
export function editPurchasePlanApi(data) {
return request({
@ -319,7 +318,7 @@ export function getPurchaseOrderInfoApi(data) {
//"merchant-id":"378915229716713472",
}
})
}
}
// 新增采购订单
export function addPurchaseOrderApi(data) {
return request({
@ -330,7 +329,7 @@ export function addPurchaseOrderApi(data) {
},
data: data
})
}
}
// 修改采购订单
export function editPurchaseOrderApi(data) {
return request({
@ -381,7 +380,7 @@ export function getPurchaseInspectInfoApi(data) {
//"merchant-id":"378915229716713472",
}
})
}
}
// 新增采购验货
export function addPurchaseInspectApi(data) {
return request({
@ -392,7 +391,7 @@ export function addPurchaseInspectApi(data) {
},
data: data
})
}
}
// 修改采购验货
export function editPurchaseInspectApi(data) {
return request({

View File

@ -4,10 +4,10 @@
<el-form :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px">
<el-form-item label="询价单号" prop="inquiryCode">
<el-input v-model="baseInfo.inquiryCode" placeholder="询价单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item>
</el-form-item>
<el-form-item label="询价标题" prop="title">
<el-input v-model="baseInfo.title" placeholder="请输入询价标题" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
</el-form-item>
<el-form-item label="报价时间" prop="dateRange">
<el-date-picker
v-model="baseInfo.dateRange"
@ -29,17 +29,17 @@
format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.requestArrivalTime=formatDate(baseInfo.requestArrivalTime)">
</el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="baseInfo.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
:props="{
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" @change="handleAreaChange">
</el-cascader>
</el-form-item>
</el-form-item>
<el-form-item label="邀请供应商" prop="supplierIds">
<el-select v-model="baseInfo.supplierIds" multiple placeholder="请选择供应商" style="width: 100%;">
<el-option v-for="item in supplierOptions"
@ -47,22 +47,22 @@
:label="item.supplierName"
:value="item.supplierId"
></el-option>
</el-select>
</el-form-item>
</el-select>
</el-form-item>
<el-form-item label="联系人" prop="linkMan">
<el-input v-model="baseInfo.linkMan" placeholder="请输入联系人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="baseInfo.phone" placeholder="请输入联系电话" maxlength="11" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="收货地址" prop="address">
<el-input v-model="baseInfo.address" placeholder="请输入收货地址" maxlength="30" 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="inquiryNotes">
<el-input v-model="baseInfo.inquiryNotes" placeholder="请输入备注" maxlength="30" clearable style="width: 240px"/>
</el-form-item>
</el-form>
</div>
</div>
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;">
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
<div>
@ -78,22 +78,22 @@
<el-table-column type="selection" width="50" align="center" :reserve-selection="true" />
<el-table-column label="序号" align="center" width="80" type="index" />
<!-- <el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" /> -->
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="采购数量" align="center" prop="purNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.purNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.purNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="备注" align="center" prop="notes" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.notes" placeholder="请输入备注" maxlength="20" clearable/>
</template>
</el-table-column>
</el-table-column>
</el-table>
</div>
</div>
@ -102,7 +102,7 @@
<el-button type="success" plain @click="confirmSubmit" :loading="loadingBtn">提交</el-button>
<el-button @click="jumpList">返回</el-button>
</div>
<!-- 选择菜品 -->
<el-dialog title="选择货品" :visible.sync="openDialog" width="65%" append-to-body >
<div style="width: 100%;height:620px;">
@ -110,11 +110,11 @@
<el-form-item label="货品类别" prop="materialTypeIds">
<el-cascader v-model="queryParams.materialTypeIds"
:options="materialTreeOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
:props="{
:props="{
multiple: true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'categoryName'
value:'id',label:'categoryName'
}" collapse-tags>
</el-cascader>
</el-form-item>
@ -137,21 +137,21 @@
</template>
</el-table-column>
<!-- <el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" /> -->
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
<!-- <template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
@ -159,20 +159,20 @@
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
/>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmChosen"> </el-button>
<el-button @click="openDialog=false"> </el-button>
</div>
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/stockManage";
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/stockManage";
import { getGoodsInquiryInfoApi,addGoodsInquiryApi,editGoodsInquiryApi } from "@/api/foodManage/purchaseManage";
export default {
name: "GoodsInquiryEdit",
@ -182,10 +182,10 @@ export default {
goodsInquiryData:{},//
loading:false,
loadingBtn:false,
baseInfo: {
baseInfo: {
contractType:undefined,
areaId:undefined,
canteenId:undefined,
canteenId:undefined,
},
//
baseRules: {
@ -203,7 +203,7 @@ export default {
],
supplierIds: [
{ required: true, message: "邀请供应商不能为空", trigger: "change" }
],
],
phone: [
{
pattern: /^1[3456789]\d{9}$/,
@ -215,8 +215,8 @@ export default {
treeAreaOptions:[],
canteenOptions:[],
stallOptions:[],
supplierOptions:[],
pickerOptions: {
supplierOptions:[],
pickerOptions: {
disabledDate(v) {
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000
}
@ -224,12 +224,12 @@ export default {
materialList:[],//-
batchIds:[],//--
openDialog:false,
materialTreeOptions:[],
materialTreeOptions:[],
queryParams: { // --
pageNum: 1,
pageSize: 10,
},
pageSize: 10,
},
pickerOptions2: {
disabledDate(v) {
return v.getTime() < (new Date().getTime() - 86400000) ||v.getTime() > (new Date().getTime() + 3600 * 1000 * 24 * 60);// - 86400000
@ -243,19 +243,19 @@ export default {
total: 0, //
tableListData: [],//-
batchChosenMaterial:[],//--
noMaterial:false,
noMaterial:false,
};
},
created() {
this.getAreaTreeData()
this.getMaterialTree()
if(this.$route.query.goodsInquiryData){
this.getAreaTreeData()
this.getMaterialTree()
if(this.$route.query.goodsInquiryData){
this.goodsInquiryData = JSON.parse(this.$route.query.goodsInquiryData)
this.getContractInfo()
}
},
watch:{
watch:{
'$route.query.goodsInquiryData':function(newId, oldId) {
if(newId){
this.goodsInquiryData = JSON.parse(newId)
@ -266,27 +266,29 @@ export default {
}
},
},
methods: {
methods: {
//
jumpList() {
const obj = { path: "/foodManage/purchaseManage/goodsInquiryEdit" };
this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/goodsInquiry" }); //
this.$router.replace({ path: "/foodManage/purchaseManage/goodsInquiry" }); //
},
getContractInfo(){
console.log(this.goodsInquiryData)
console.log(this.goodsInquiryData)
let param = {
inquiryId:this.goodsInquiryData.inquiryId
}
//
getGoodsInquiryInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.$set(this.baseInfo,'dateRange',[this.baseInfo.startTime,this.baseInfo.endTime])
this.materialList = this.baseInfo.detailList;
this.baseInfo = response.data;
console.log("this.baseInfo",this.baseInfo);
this.$set(this.baseInfo,'dateRange',[this.baseInfo.startTime,this.baseInfo.endTime])
this.materialList = this.baseInfo.detailList;
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
});
this.supplierOptions = response.rows||[];
});
this.baseInfo.supplierIds= this.baseInfo.supplierIdstr.split(",");
});
},
//
getAreaTreeData() {
@ -302,14 +304,14 @@ export default {
}
},
//-
handleAreaChange(e){
handleAreaChange(e){
this.getSupplierData()
},
},
/** 查询供应商下拉结构 */
getSupplierData() {
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
this.supplierOptions = response.rows||[];
});
},
/** 查询货品类别下拉树结构 */
getMaterialTree() {
@ -317,19 +319,19 @@ export default {
// goodsType:1
}
systemMaterialTreeApi(param).then((response) => {
this.materialTreeOptions = response.data;
this.materialTreeOptions = response.data;
});
},
},
//
changeDateRange(e){
//this.formatDate(e[0])
changeDateRange(e){
//this.formatDate(e[0])
},
//
handleSelectionChange(selection) {
this.batchIds = selection.map(item => item.materialId)
},
//
delMaterial(){
delMaterial(){
this.batchIds.forEach(ID=>{
let index = this.materialList.findIndex(v=>v.materialId==ID)
if(index>-1){
@ -343,20 +345,20 @@ export default {
this.openDialog=true
this.resetQuery()
setTimeout(()=>{
this.$refs.multipleTable1.clearSelection()
},300)
this.$refs.multipleTable1.clearSelection()
},300)
}else{
this.$modal.msgError("请先选择区域");
}
},
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
@ -368,7 +370,7 @@ export default {
"pageNum": this.queryParams.pageNum,
"areaId": this.baseInfo.areaId,
"materialName": this.queryParams.materialName,
"materialCode": this.queryParams.materialCode,
"materialCode": this.queryParams.materialCode,
"materialTypeIds": this.queryParams.materialTypeIds,
}
getMaterialListApi(param).then(response => {
@ -380,131 +382,175 @@ export default {
handleSelectionChange2(selection) {
this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
this.$set(item,"purNum",0)
this.$set(item,"purNum",0)
})
},
confirmChosen(){
if(this.batchChosenMaterial.length>0){
this.loading = true
this.materialList = this.batchChosenMaterial;
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",item.unitPrice/100)
this.materialList = this.batchChosenMaterial;
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",item.unitPrice/100)
})
setTimeout(()=>{
this.loading = false
this.openDialog=false
},500)
}
},500)
}
},
//稿
confirmSave(){
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
if (valid) {
let param = Object.assign({},this.baseInfo);
param.startTime = this.formatDateTime(this.baseInfo.dateRange[0])
param.endTime = this.formatDateTime(this.baseInfo.dateRange[1])
param.requestArrivalTime = this.formatDateTime(this.baseInfo.requestArrivalTime)
param.requestArrivalTime = this.formatDateTime(this.baseInfo.requestArrivalTime)
param.status=1
param.detailList = []
param.detailList = []
if(param.supplierIds.length==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
this.noMaterial = false;
if(this.materialList.length>0){
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.purNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
param.detailList.push(obj)
}
})
}
}
})
}
if(this.noMaterial){
this.$modal.msgError("表格数据请填写完整!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
this.noMaterial = false;
}
this.noMaterial = false;
}
console.log(param)
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.inquiryId != undefined) {
console.log("param",param);
if(param.supplierIds.length==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
if(param.supplierIds.detailList==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
editGoodsInquiryApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
} else {
console.log("param",param);
if(param.supplierIds.length==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
if(param.supplierIds.detailList==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
addGoodsInquiryApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
}
}
}
}
}
}
});
},
//
confirmSubmit(){
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
if (valid) {
let param = Object.assign({},this.baseInfo);
param.startTime = this.formatDateTime(this.baseInfo.dateRange[0])
param.endTime = this.formatDateTime(this.baseInfo.dateRange[1])
param.requestArrivalTime = this.formatDateTime(this.baseInfo.requestArrivalTime)
param.requestArrivalTime = this.formatDateTime(this.baseInfo.requestArrivalTime)
param.status=2
param.detailList = []
param.detailList = []
if(param.supplierIds.length==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
this.noMaterial = false;
if(this.materialList.length>0){
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.purNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
param.detailList.push(obj)
}
})
}
}
})
}
if(this.noMaterial){
this.$modal.msgError("表格数据请填写完整!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
this.noMaterial = false;
}
this.noMaterial = false;
}
console.log(param)
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.inquiryId != undefined) {
console.log("param",param);
if(param.supplierIds.length==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
if(param.supplierIds.detailList==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
editGoodsInquiryApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
} else {
console.log("param",param);
if(param.supplierIds.length==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
if(param.supplierIds.detailList==0){
this.$modal.msgError("表格数据请填写完整!");
return;
}
addGoodsInquiryApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
}
}
}
}
}
}
});
},
@ -529,7 +575,7 @@ export default {
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
}
}
};
</script>
@ -571,10 +617,10 @@ export default {
align-items: center;
cursor: pointer;
}
.dish-name:hover{
.dish-name:hover{
background-color:rgba(0, 0, 0, 0.1);
color: #4b80fd;
}
}
.dialog-center{
width: 10%;
@ -626,4 +672,4 @@ export default {
border: 1px solid #fff;
cursor: pointer;
}
</style>
</style>

View File

@ -21,35 +21,35 @@
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable @change="handleAreaChange">
</el-cascader>
</el-form-item>
<el-form-item label="询价状态" prop="inquiryState">
</el-form-item>
<el-form-item label="询价状态" prop="inquiryState">
<el-select v-model="queryParams.inquiryState" 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-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 label="中选状态" prop="status">
<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-option label="未中选" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="提交状态" prop="orderStatus">
<el-form-item label="提交状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择提交状态" style="width: 240px;">
<el-option label="待提交" :value="1"></el-option>
<el-option label="已提交" :value="2"></el-option>
</el-select>
<el-option label="已提交" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -65,7 +65,7 @@
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -75,58 +75,58 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="询价单号" align="center" prop="inquiryCode" :show-overflow-tooltip="true" />
<el-table-column label="询价标题" align="center" prop="title" :show-overflow-tooltip="true" />
<el-table-column label="报价开始时间" align="center" prop="startTime" :show-overflow-tooltip="true" />
<el-table-column label="询价单号" align="center" prop="inquiryCode" :show-overflow-tooltip="true" />
<el-table-column label="询价标题" align="center" prop="title" :show-overflow-tooltip="true" />
<el-table-column label="报价开始时间" align="center" prop="startTime" :show-overflow-tooltip="true" />
<el-table-column label="报价结束时间" align="center" prop="endTime" :show-overflow-tooltip="true" />
<el-table-column label="询价状态" align="center" prop="inquiryState" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.inquiryState==1">未开始</span>
<span v-if="scope.row.inquiryState==2">进行中</span>
<span v-if="scope.row.inquiryState==3">已结束</span>
<span v-if="scope.row.inquiryState==4">已取消</span>
</template>
<span v-if="scope.row.status==1">--</span>
<span v-if="scope.row.status==3">进行中</span>
<span v-if="scope.row.status==2">已决价</span>
<span v-if="scope.row.status==5">已取消</span>
</template>
</el-table-column>
<el-table-column label="提交状态" align="center" prop="orderStatus" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.orderStatus==1">待提交</span>
<span v-if="scope.row.orderStatus==2">已提交</span>
</template>
</el-table-column>
<span v-if="scope.row.status==1">待提交</span>
<span v-if="scope.row.status!=1">已提交</span>
</template>
</el-table-column>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="邀请供应商(家)" align="center" prop="" :show-overflow-tooltip="true" />
<el-table-column label="已报价供应商(家)" align="center" prop="" :show-overflow-tooltip="true" />
<el-table-column label="邀请供应商(家)" align="center" prop="inquirySupplierNum" :show-overflow-tooltip="true" />
<el-table-column label="已报价供应商(家)" align="center" prop="supplierNum" :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.status==1">已中选</span>
<span v-if="scope.row.status==2">未中选</span>
</template>
<span v-if="scope.row.status==3">已中选</span>
<span v-if="scope.row.status!=3">未中选</span>
</template>
</el-table-column>
<el-table-column label="中选供应商" align="center" prop="" :show-overflow-tooltip="true" />
<el-table-column label="中选供应商" align="center" prop="" :show-overflow-tooltip="true" />
<el-table-column label="中选金额(元)" align="center" prop="" :show-overflow-tooltip="true" width="120">
<!-- <template slot-scope="scope">
<span>{{ (scope.row.totalAmount/100).toFixed(2) }}</span>
</template> -->
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.orderStatus==1"
@click="handleUpdate(scope.row)"
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.orderStatus==2"
@click="handleView(scope.row)"
>详情</el-button>
icon="el-icon-edit" v-if="scope.row.status==2"
@click="handleView(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete" v-if="scope.row.orderStatus==1"
@click="handleDelete(scope.row)"
icon="el-icon-delete" v-if="scope.row.status==1"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
@ -147,7 +147,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -158,9 +158,9 @@
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemAreaTreeApi } from "@/api/base/stall";
import { drpWareHousePageApi } from "@/api/foodManage/stockManage";
import { goodsInquiryPageApi,delGoodsInquiryApi } from "@/api/foodManage/purchaseManage";
import { goodsInquiryPageApi,delGoodsInquiryApi } from "@/api/foodManage/purchaseManage";
export default {
name: "",
@ -185,11 +185,11 @@ export default {
//
title: "",
//
open: false,
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 10,
},
treeAreaOptions:[],//
wareHouseOptions:[],//
@ -234,8 +234,8 @@ export default {
}
};
},
created() {
this.getAreaTreeData();
created() {
this.getAreaTreeData();
// this.getWareHouseData()
this.getList();
},
@ -243,18 +243,18 @@ export default {
//
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeAreaOptions = response.data;
this.treeAreaOptions = response.data;
});
},
handleAreaChange(e){
// this.getWareHouseData()
},
},
/** 查询货品下拉结构 */
getWareHouseData() {
getWareHouseData() {
drpWareHousePageApi({ areaId:this.queryParams.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
this.$set(this.queryParams,'warehouseId',null)
});
this.$set(this.queryParams,'warehouseId',null)
});
},
/** 搜索按钮操作 */
handleQuery() {
@ -262,7 +262,7 @@ export default {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
resetQuery() {
this.dateRange = this.defaultDateRange()
this.resetForm("queryForm");
this.handleQuery();
@ -271,37 +271,38 @@ export default {
getList() {
this.loading = true;
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"searchValue": this.queryParams.searchValue,
"areaId": this.queryParams.areaId,
"inquiryState": this.queryParams.inquiryState,
"status": this.queryParams.status,
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"searchValue": this.queryParams.searchValue,
"areaId": this.queryParams.areaId,
"inquiryState": this.queryParams.inquiryState,
"status": this.queryParams.status,
"orderStatus": this.queryParams.orderStatus
}
}
if(this.dateRange&&this.dateRange.length>0){
param.startDateTime=this.formatDateTime(this.dateRange[0])
param.endDateTime=this.formatDateTime(this.dateRange[1])
param.startTime=this.formatDateTime(this.dateRange[0])
param.endTime=this.formatDateTime(this.dateRange[1])
}else{
param.startDateTime=undefined;
param.endDateTime=undefined;
}
param.startTime=undefined;
param.endTime=undefined;
}
goodsInquiryPageApi(param).then(response => {
console.log("this.tableListData",response)
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({ path: "/foodManage/purchaseManage/goodsInquiryEdit" });
},
/** 修改按钮操作 */
handleView(row) {
handleView(row) {
this.$router.push({ path: "/foodManage/purchaseManage/goodsInquiryDetail",query: {goodsInquiryData:JSON.stringify(row)} });
},
/** 修改按钮操作 */
handleUpdate(row) {
handleUpdate(row) {
this.$router.push({ path: "/foodManage/purchaseManage/goodsInquiryEdit",query: {goodsInquiryData:JSON.stringify(row)} });
},
//
@ -313,7 +314,7 @@ export default {
reset() {
this.form = {};
this.resetForm("form");
},
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
@ -335,23 +336,23 @@ export default {
});
},
/** 删除按钮操作 */
handleDelete(row) {
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delGoodsInquiryApi({inquiryIds:[row.inquiryId]});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
},
defaultDateRange() {
const end = new Date(new Date().toLocaleDateString());
end.setTime(end.getTime() + 24 * 60 * 60 * 1000 -1);
const start = new Date((new Date().toLocaleDateString()));
start.setTime(start.getTime() - 30 * 24 * 60 * 60 * 1000);
start.setTime(start.getTime() - 30 * 24 * 60 * 60 * 1000);
this.start = parseInt(start.getTime() / 1000)
this.end = parseInt(end.getTime() / 1000)
return [start, end]
},
},
//
formatDate(date) {
// YYYY-MM-DD
@ -372,7 +373,7 @@ export default {
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
}
}
};
</script>