采购计划生成采购订单3
This commit is contained in:
parent
47e858fe33
commit
f13d6e4f7a
|
|
@ -150,12 +150,12 @@
|
|||
icon="el-icon-edit" v-if="scope.row.orderStatus==2"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<!-- <el-button
|
||||
size="mini" v-if="scope.row.orderStatus==1"
|
||||
type="text" :disabled="loadingBtn"
|
||||
icon="el-icon-top"
|
||||
@click="confirmSubmit(scope.row)"
|
||||
>提交</el-button> -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit" v-if="scope.row.orderStatus==2"
|
||||
@click="handlePurchaseInspection(scope.row)"
|
||||
>生成采购验货</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -194,7 +194,7 @@
|
|||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { purchaseOrderPageApi,editPurchaseOrderApi,delPurchaseOrderApi } from "@/api/foodManage/purchaseManage";
|
||||
import { purchaseOrderPageApi,getPurchaseOrderInfoApi,delPurchaseOrderApi } from "@/api/foodManage/purchaseManage";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
|
|
@ -397,18 +397,57 @@ export default {
|
|||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 提交按钮
|
||||
confirmSubmit(row){
|
||||
let param = Object.assign({},row);
|
||||
this.loadingBtn=true
|
||||
param.orderStatus=2
|
||||
editPurchaseOrderApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.getList()
|
||||
this.loadingBtn=false
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
handlePurchaseInspection(row){
|
||||
//获取订单详情
|
||||
getPurchaseOrderInfoApi({orderGoodsId:row.orderGoodsId}).then((response) => {
|
||||
var orderGoodsDetailList = response.data.orderGoodsDetailList
|
||||
console.log(orderGoodsDetailList)
|
||||
console.log(row)
|
||||
this.$modal.confirm('是否确认生成采购验货?').then(function() {
|
||||
let param = {
|
||||
status:1,
|
||||
relateOrderGoodsId:row.orderGoodsCode,
|
||||
deliveryDate:null,
|
||||
areaId:row.areaId,
|
||||
deliveryWarehouseId:row.warehouseId,
|
||||
deliverySupplierId:row.supplierId,
|
||||
deliveryMan:null,
|
||||
deliveryPhone:null,
|
||||
inspectDate:null,
|
||||
inspector:null,
|
||||
inspectGoodsDetails: [],
|
||||
remark:"采购订单生成采购验货",
|
||||
}
|
||||
param.deliveryTotalNum = 0;//送货总数量
|
||||
param.inspectQualifiedNum = 0;//验货合格总数量
|
||||
param.contractAttachment = ""
|
||||
orderGoodsDetailList.forEach(item=>{
|
||||
let obj = Object.assign({}, item)
|
||||
console.log(obj)
|
||||
obj.unitPrice = Number(item.singlePrice)
|
||||
// obj.orderNum = Number(item.purchaseNum)
|
||||
// obj.totalPrice = (Number(obj.singlePrice)*Number(obj.orderNum))
|
||||
// param.orderAmount = param.orderAmount+obj.totalPrice;
|
||||
// param.totalNum = param.totalNum+Number(obj.orderNum)
|
||||
// param.orderGoodsDetailList.push(obj)
|
||||
})
|
||||
// return addPurchaseOrderApi(param);//新增采购订单
|
||||
}).then((res) => {
|
||||
this.getList();
|
||||
this.$router.push({ path: "/foodManage/purchaseManage/inspectionEdit",query: {purchaseInspectionRowData:JSON.stringify(res.data)} });
|
||||
}).catch(() => {});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
defaultDateRange() {
|
||||
const end = new Date(new Date().toLocaleDateString());
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@
|
|||
type="text"
|
||||
icon="el-icon-edit" v-if="scope.row.status==2"
|
||||
@click="handlePurchaseOrder(scope.row)"
|
||||
>生成采购计划</el-button>
|
||||
>生成采购订单</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -362,7 +362,7 @@ export default {
|
|||
var purchasePlanDetailList = response.data.purchasePlanDetailList
|
||||
this.$modal.confirm('是否确认生成采购订单?').then(function() {
|
||||
let param = {
|
||||
orderTitle:"采购计划单生成采购订单",
|
||||
orderTitle:"采购计划生成采购订单",
|
||||
purchasePlanCode:row.planCode,
|
||||
requestArrivalTime:null,
|
||||
warehouseId:null,
|
||||
|
|
@ -374,7 +374,7 @@ export default {
|
|||
totalNum: 0,
|
||||
orderStatus: 1,
|
||||
orderGoodsDetailList: [],
|
||||
remark:"采购计划单生成采购订单",
|
||||
remark:"采购计划生成采购订单",
|
||||
}
|
||||
purchasePlanDetailList.forEach(item=>{
|
||||
let obj = Object.assign({}, item)
|
||||
|
|
|
|||
Loading…
Reference in New Issue