Merge branch 'bonus-jyy-smart-canteen' of http://192.168.0.75:3000/bonus/bonus-ui into bonus-jyy-smart-canteen
This commit is contained in:
commit
702c0d6484
|
|
@ -25,35 +25,35 @@
|
|||
:label="item.supplierName"
|
||||
:value="item.supplierId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交状态" prop="orderStatus">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-option label="已验货" :value="3"></el-option>
|
||||
<el-option label="已完成" :value="4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="审批状态" prop="approveStatus">
|
||||
<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="approveStatus">
|
||||
<el-select v-model="queryParams.approveStatus" 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="supplierConfirmStatus">
|
||||
<!-- <el-form-item label="确认状态" prop="supplierConfirmStatus">
|
||||
<el-select v-model="queryParams.supplierConfirmStatus" 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-select>
|
||||
<el-option label="确认通过" :value="2"></el-option>
|
||||
<el-option label="已拒绝" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<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,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
:label="item.canteenName"
|
||||
:value="item.canteenId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属档口" prop="stallId">
|
||||
<el-select v-model="queryParams.stallId" placeholder="请选择所属档口" style="width: 100%;" >
|
||||
|
|
@ -76,10 +76,10 @@
|
|||
:label="item.stallName"
|
||||
:value="item.stallId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</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>
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -109,82 +109,82 @@
|
|||
<el-table-column label="生产计划单号" align="center" prop="productPlanCodeList" :show-overflow-tooltip="true" width="180">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.productPlanCodeList">
|
||||
<div v-for="(item,index) in scope.row.productPlanCodeList" :key="index">{{ item }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<div v-for="(item,index) in scope.row.productPlanCodeList" :key="index">{{ item }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购计划单号" align="center" prop="purchasePlanCodeList" :show-overflow-tooltip="true" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.purchasePlanCodeList">
|
||||
<div v-for="(item,index) in scope.row.purchasePlanCodeList" :key="index">{{ item }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<div v-for="(item,index) in scope.row.purchasePlanCodeList" :key="index">{{ item }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购订单号" align="center" prop="orderGoodsCode" :show-overflow-tooltip="true" width="180"/>
|
||||
<el-table-column label="采购订单标题" align="center" prop="orderTitle" :show-overflow-tooltip="true" width="180"/>
|
||||
<el-table-column label="采购订单时间" align="center" prop="createTime" :show-overflow-tooltip="true" width="160"/>
|
||||
|
||||
<el-table-column label="采购订单标题" align="center" prop="orderTitle" :show-overflow-tooltip="true" width="180"/>
|
||||
<el-table-column label="采购订单时间" align="center" prop="createTime" :show-overflow-tooltip="true" width="160"/>
|
||||
|
||||
<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>
|
||||
<span v-if="scope.row.orderStatus==3">已验货</span>
|
||||
<span v-if="scope.row.orderStatus==4">已完成</span>
|
||||
</template>
|
||||
<span v-if="scope.row.orderStatus==2">已提交</span>
|
||||
<span v-if="scope.row.orderStatus==3">已验货</span>
|
||||
<span v-if="scope.row.orderStatus==4">已完成</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="确认状态" align="center" prop="supplierConfirmStatus" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.supplierConfirmStatus==1">待确认</span>
|
||||
<span v-if="scope.row.supplierConfirmStatus==2">确认通过</span>
|
||||
<span v-if="scope.row.supplierConfirmStatus==3">已拒绝</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<span v-if="scope.row.supplierConfirmStatus==3">已拒绝</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="订单总金额(元)" align="center" prop="orderAmount" :show-overflow-tooltip="true" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.orderAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货品总数量" align="center" prop="totalNum" :show-overflow-tooltip="true" width="100"/>
|
||||
<el-table-column label="货品总数量" align="center" prop="totalNum" :show-overflow-tooltip="true" width="100"/>
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="交货日期" align="center" prop="requestArrivalTime" :show-overflow-tooltip="true" width="150"/>
|
||||
<el-table-column label="交货日期" align="center" prop="requestArrivalTime" :show-overflow-tooltip="true" width="150"/>
|
||||
<el-table-column label="所属区域-食堂-档口" align="center" prop="" :show-overflow-tooltip="true" width="250">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.areaName }}-{{ scope.row.canteenName }}-{{ scope.row.stallName }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150"/>
|
||||
<!-- <el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150"/>
|
||||
<el-table-column label="所属档口" align="center" prop="stallName" :show-overflow-tooltip="true" width="150"/> -->
|
||||
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit" v-if="scope.row.orderStatus==1||scope.row.orderStatus==2"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit" v-if="scope.row.orderStatus==3"
|
||||
@click="handleFinish(scope.row)"
|
||||
@click="handleFinish(scope.row)"
|
||||
>订单完成</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit" v-if="scope.row.orderStatus!=1"
|
||||
@click="handleView(scope.row)"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit" v-if="scope.row.orderStatus==2||scope.row.orderStatus==3"
|
||||
@click="handlePurchaseInspection(scope.row)"
|
||||
>生成采购验货</el-button>
|
||||
@click="handlePurchaseInspection(scope.row)"
|
||||
>生成采购验货</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete" v-if="scope.row.orderStatus==1"
|
||||
@click="handleDelete(scope.row)"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -205,7 +205,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
|
@ -216,8 +216,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { purchaseOrderPageApi,getPurchaseOrderInfoApi,delPurchaseOrderApi,finishPurchaseOrderApi,addPurchaseInspectApi } from "@/api/foodManage/purchaseManage";
|
||||
|
||||
export default {
|
||||
|
|
@ -243,11 +243,11 @@ export default {
|
|||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
},
|
||||
treeAreaOptions:[],//区域树
|
||||
canteenOptions:[],//食堂下拉选
|
||||
|
|
@ -294,7 +294,7 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created() {
|
||||
this.getAreaTreeData();
|
||||
this.getSupplierData();
|
||||
this.getList();
|
||||
|
|
@ -303,7 +303,7 @@ export default {
|
|||
//区域树
|
||||
getAreaTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeAreaOptions = response.data;
|
||||
this.treeAreaOptions = response.data;
|
||||
});
|
||||
},
|
||||
handleAreaChange(e){
|
||||
|
|
@ -312,33 +312,33 @@ export default {
|
|||
}
|
||||
getCanteenByAreaApi(param).then((response) => {
|
||||
this.canteenOptions=response.rows||[]
|
||||
this.$set(this.queryParams,"canteenId",null)
|
||||
this.stallOptions = []
|
||||
this.$set(this.queryParams,"stallId",null)
|
||||
this.$set(this.queryParams,"canteenId",null)
|
||||
this.stallOptions = []
|
||||
this.$set(this.queryParams,"stallId",null)
|
||||
});
|
||||
},
|
||||
handleCanteenChange(e){
|
||||
handleCanteenChange(e){
|
||||
let param= {
|
||||
canteenId:e
|
||||
}
|
||||
getStallByCanteenApi(param).then((response) => {
|
||||
this.stallOptions=response.rows||[]
|
||||
this.$set(this.queryParams,"stallId",null)
|
||||
this.$set(this.queryParams,"stallId",null)
|
||||
});
|
||||
},
|
||||
},
|
||||
/** 查询供应商下拉结构 */
|
||||
getSupplierData() {
|
||||
getSupplierData() {
|
||||
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
|
||||
this.supplierOptions = response.rows||[];
|
||||
});
|
||||
},
|
||||
this.supplierOptions = response.rows||[];
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
resetQuery() {
|
||||
this.dateRange = this.defaultDateRange()
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
|
|
@ -351,15 +351,15 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
let param = {
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
"orderGoodsCode": this.queryParams.orderGoodsCode,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"canteenId": this.queryParams.canteenId,
|
||||
"stallId": this.queryParams.stallId,
|
||||
"supplierId": this.queryParams.supplierId,
|
||||
"orderStatus": this.queryParams.orderStatus,
|
||||
// "supplierConfirmStatus": this.queryParams.supplierConfirmStatus,
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
"orderGoodsCode": this.queryParams.orderGoodsCode,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"canteenId": this.queryParams.canteenId,
|
||||
"stallId": this.queryParams.stallId,
|
||||
"supplierId": this.queryParams.supplierId,
|
||||
"orderStatus": this.queryParams.orderStatus,
|
||||
// "supplierConfirmStatus": this.queryParams.supplierConfirmStatus,
|
||||
// "approveStatus": this.queryParams.approveStatus
|
||||
}
|
||||
if(this.dateRange&&this.dateRange.length>0){
|
||||
|
|
@ -368,27 +368,28 @@ export default {
|
|||
}else{
|
||||
param.startDateTime=undefined;
|
||||
param.endDateTime=undefined;
|
||||
}
|
||||
}
|
||||
param.pageOrForm =2;
|
||||
purchaseOrderPageApi(param).then(response => {
|
||||
this.tableListData = response.rows;
|
||||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/orderEdit" });
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleView(row) {
|
||||
handleView(row) {
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/orderDetail",query: {purchaseOrderRowData:JSON.stringify(row)} });
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
handleUpdate(row) {
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/orderEdit",query: {purchaseOrderRowData:JSON.stringify(row)} });
|
||||
},
|
||||
//订单完成按钮
|
||||
handleFinish(row) {
|
||||
handleFinish(row) {
|
||||
this.$modal.confirm('是否确认该订单已完成?').then(function() {
|
||||
return finishPurchaseOrderApi({orderGoodsId:row.orderGoodsId});
|
||||
}).then(() => {
|
||||
|
|
@ -405,7 +406,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
|
@ -427,7 +428,7 @@ export default {
|
|||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
||||
return delPurchaseOrderApi({orderGoodsIds:[row.orderGoodsId]});
|
||||
}).then(() => {
|
||||
|
|
@ -440,51 +441,51 @@ export default {
|
|||
getPurchaseOrderInfoApi({orderGoodsId:row.orderGoodsId}).then((response) => {
|
||||
var orderGoodsDetailList = response.data.orderGoodsDetailList;
|
||||
var that = this
|
||||
this.$modal.confirm('是否确认生成采购验货?').then(function() {
|
||||
this.$modal.confirm('是否确认生成采购验货?').then(function() {
|
||||
var param = {
|
||||
status:1,
|
||||
relateOrderGoodsId:row.orderGoodsCode,
|
||||
deliveryDate:null,
|
||||
areaId:row.areaId,
|
||||
deliveryWarehouseId:row.warehouseId,
|
||||
deliverySupplierId:row.supplierId,
|
||||
deliverySupplierId:row.supplierId,
|
||||
deliveryMan:null,
|
||||
deliveryPhone:null,
|
||||
inspectDate:that.formatDateTime(row.requestArrivalTime),
|
||||
inspector:null,
|
||||
inspector:null,
|
||||
inspectGoodsDetails: [],
|
||||
deliveryTotalNum:0,
|
||||
inspectQualifiedNum:0,
|
||||
contractAttachment:"",
|
||||
remark:"采购订单生成采购验货",
|
||||
}
|
||||
orderGoodsDetailList.forEach(item=>{
|
||||
}
|
||||
orderGoodsDetailList.forEach(item=>{
|
||||
let obj = Object.assign({}, item)
|
||||
console.log(obj)
|
||||
obj.unitPrice = Number(item.singlePrice)
|
||||
obj.deliveryNum = Number(item.orderNum)
|
||||
obj.qualifiedNum = Number(item.orderNum)
|
||||
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
|
||||
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
|
||||
param.inspectGoodsDetails.push(obj)
|
||||
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
|
||||
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
|
||||
param.inspectGoodsDetails.push(obj)
|
||||
})
|
||||
console.log(param)
|
||||
return addPurchaseInspectApi(param);//新增采购验货
|
||||
}).then((res) => {
|
||||
this.getList();
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/inspectionEdit",query: {purchaseInspectionRowData:JSON.stringify(res.data)} });
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/inspectionEdit",query: {purchaseInspectionRowData:JSON.stringify(res.data)} });
|
||||
}).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
|
||||
|
|
@ -505,7 +506,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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue