pull/1/head
lixuan 2 years ago
parent 6cddb7dc33
commit 501deed682
  1. 13
      src/api/order.js
  2. 14
      src/views/order/components/billOfLading.vue
  3. 124
      src/views/order/index.vue
  4. 11
      src/views/product/components/create.vue

@ -27,6 +27,15 @@ const deleteBill = (params) => {
const orderSuccess = (params) => {
return request.postJson("/oil-refinery/xoilRefineryOrder/orderSuccess", params);
};
//订单锁定
const orderLock = (params) => {
return request.postJson("/oil-refinery/xoilRefineryOrder/orderLock", params);
};
//确认下单
const orderComplete = (params) => {
return request.postJson("/oil_refinery/xoilRefineryOrder/orderComplete", params);
};
@ -39,5 +48,7 @@ export default {
findByOrderId,
update,
deleteBill,
orderSuccess
orderSuccess,
orderLock,
orderComplete
};

@ -162,7 +162,7 @@ export default {
orderTagType(val){
switch(val){
case 'SUBMITED': return '订单提交'
case 'ORDER_LOCKED': return '下单中'
case 'ORDER_LOCKED': return '订单锁定'
case 'ORDER_SUCCESS': return '下单成功'
case 'DELIVERING': return '提货中'
case 'COMPLETE': return '提货单完成'
@ -262,7 +262,7 @@ export default {
case 'COMPLETE': return {orderLabel:'订单完成',label:'提货完成',info:'提货完成',type:'success',type1:'info',orderType:'success'}
case 'CANCELED': return {orderLabel:'订单取消',label:'订单取消',info:'订单取消',type:'info',type1:'dark',orderType:'info'}
}
return {label:val?val:'暂无数据',type:'info'}
return {label:val?val:'暂无数据',info:val?val:'暂无数据',type:'info'}
},
//
billAdd(e,index){
@ -337,15 +337,19 @@ export default {
submit() {
this.quantity = 0
this.billData.list.forEach(element => {
this.quantity += element.accDeliveryQuantity
if(element.accDeliveryQuantity){
this.quantity += element.accDeliveryQuantity
}else{
this.$message.error('提货单异常')
throw new Error()
}
});
this.$confirm('确定下单?', '提示', { type: 'success' }).then(() => {
let data={
id:this.controlWindows.addInfo.id,
actQuantity:this.quantity,
customerId:this.controlWindows.addInfo.customerId
}
order.orderSuccess(data).then((res) => {
order.orderComplete(data).then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg);
this.closeWindow();

@ -1,7 +1,13 @@
<template>
<div class="order">
<div class="frame">
<el-select style="margin-right: 20px;" v-model="parameter.params.id" placeholder="用户名称" clearable>
<!-- 公司名称 -->
<autocomplete
class="mr20"
:params="parameter.params"
:config="configAutocomplete"
/>
<!-- <el-select style="margin-right: 20px;" v-model="parameter.params.id" placeholder="用户名称" clearable>
<el-option
v-for="item in refineryList"
:key="item.id"
@ -9,16 +15,13 @@
:value="item.id"
>
</el-option>
</el-select>
<el-select v-model="parameter.params.id" placeholder="炼厂名称" clearable>
<el-option
v-for="item in refineryList"
:key="item.id"
:label="item.refineryName"
:value="item.id"
>
</el-option>
</el-select>
</el-select> -->
<!-- 炼厂名称 -->
<autocomplete
class="mr20"
:params="parameter.params"
:config="configAutocompleteLc"
/>
<el-select v-model="parameter.params.id" placeholder="产品名称" clearable>
<el-option
v-for="item in refineryList"
@ -124,16 +127,25 @@
<el-link type="primary" :underline="false" @click="detail(row)"
>详情</el-link
>
<el-link type="primary" :underline="false" @click="billOfLading(row)"
<el-link v-show="row.orderStatus!=='SUBMITED'&&row.orderStatus!=='ORDER_LOCKED'" type="primary" :underline="false" @click="billOfLading(row)"
>提货单</el-link
>
<el-popconfirm
title="是否确认订单?"
:title="row.orderStatus=='SUBMITED'?'是否确认订单锁定':'是否确认下单?'"
icon-color="red"
@confirm="deleteRow(row)"
@confirm="Locked(row)"
>
<el-link slot="reference" type="primary" :underline="false"
>订单确认</el-link
<el-link v-show="row.orderStatus=='SUBMITED'||row.orderStatus=='ORDER_LOCKED'" slot="reference" type="primary" :underline="false"
>{{row.orderStatus=='SUBMITED'?'订单锁定':'下单确认'}}</el-link
>
</el-popconfirm>
<el-popconfirm
:title="row.orderStatus=='SUBMITED'||row.orderStatus=='ORDER_LOCKED'?'是否确认取消订单?':'是否确认退款?'"
icon-color="red"
@confirm="orderCencle(row)"
>
<el-link v-show="row.orderStatus!=='CANCELED'" slot="reference" type="primary" :underline="false"
>{{row.orderStatus=='SUBMITED'||row.orderStatus=='ORDER_LOCKED'?'订单取消':'订单退款'}}</el-link
>
</el-popconfirm>
</template>
@ -177,8 +189,10 @@
<script>
import serve from "api/refineryInfo.js";
import commonServe from "api/common.js";
import order from "api/order.js";
import generalDetails from "components/generalDetails/index.vue";
import autocomplete from "components/autocomplete/index.vue";
import billOfLading from "./components/billOfLading.vue";
export default {
@ -192,6 +206,22 @@ export default {
detail: false,
bill: false,
},
configAutocomplete: {
serveTarget: commonServe.getRefineryCompanyList,
autocompleteKey: "name",
labelKey: "name",
valueKey: "id",
placeholder: "企业名称",
querykey: "customerId",
},
configAutocompleteLc: {
serveTarget: serve.findByEntity,
autocompleteKey: "name",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
},
refineryTypeEnum: [
{
label: "普通炼厂",
@ -214,15 +244,15 @@ export default {
{
carTitle: "",
carItems: [
{ label: "炼厂名称", value: "refineryName" },
{ label: "炼厂类型", value: "refineryType" },
{ label: "启用状态", value: "enableMark" },
{ label: "炼厂等级", value: "refineryLevel" },
{ label: "炼厂地址", value: "address" },
{ label: "创建用户ID", value: "createUser" },
{ label: "创建时间", value: "createTime" },
{ label: "修改用户ID", value: "updateUser" },
{ label: "修改时间", value: "updateTime" },
{ label: "订单ID", value: "id" },
{ label: "炼厂ID", value: "refineryId" },
{ label: "支付状态", value: "payStatus" },
{ label: "订单状态", value: "orderStatus" },
{ label: "提货单数量", value: "deliveryCount" },
// { label: "ID", value: "createUser" },
// { label: "", value: "createTime" },
// { label: "ID", value: "updateUser" },
// { label: "", value: "updateTime" },
],
},
],
@ -230,7 +260,8 @@ export default {
},
components: {
generalDetails,
billOfLading
billOfLading,
autocomplete
},
mounted() {
this.$nextTick(() => {
@ -262,7 +293,7 @@ export default {
orderTagType(val){
switch(val){
case 'SUBMITED': return {label:'订单提交 ',type:'info'}
case 'ORDER_LOCKED': return {label:'下单中',type:'warning'}
case 'ORDER_LOCKED': return {label:'订单锁定',type:'warning'}
case 'ORDER_SUCCESS': return {label:'下单成功',type:'success',effect:'dark'}
case 'DELIVERING': return {label:'提货中', type: ''}
case 'COMPLETE': return {label:'订单完成',type:'success',effect:'dark'}
@ -294,6 +325,18 @@ export default {
this.refineryList = res.data;
});
},
//
orderCencle(row){
if(row.orderStatus=='SUBMITED'||row.orderStatus=='ORDER_LOCKED'){
order.update({id:row.id,orderStatus:'CANCELED'}).then((res) => {
if(res.code==20000){
this.getByPage()
}
});
}else{
}
},
//
addition() {
this.controlWindows.addInfo.title = "炼厂入驻";
@ -313,19 +356,24 @@ export default {
},
//
detail(row) {
this.oilCompanyMatch = row;
this.oilCompanyMatch = [row];
this.controlWindows.detail = true;
},
//
deleteRow(row) {
// serve
// .deleteRow({
// id: row.id,
// })
// .then((res) => {
// this.$message.success(res.msg);
// this.getByPage();
// });
//
Locked(row) {
if(row.orderStatus=='SUBMITED'){
order.orderLock({id:row.id}).then((res) => {
if(res.code == 20000){
this.getByPage()
}
});
}else{
order.orderSuccess({id:row.id}).then((res) => {
if(res.code == 20000){
this.getByPage()
}
});
}
},
//
switchTrigger(val, row) {

@ -192,7 +192,6 @@ export default {
this.form.salePrice = this.productRowData[0].salePrice2company
this.form.floorPrice = this.productRowData[0].floorPrice
this.form.productMeasurement = this.productRowData[0].measurement
console.log(this.productRowData,'sssssssdddddddddddddd')
},
productChange(){
this.productData()
@ -216,6 +215,7 @@ export default {
serve.getRefineryProductList(data).then((res) => {
this.productNameList = res.data;
})
console.log(this.productRowData,'aaaaaaaaaa')
},
//
customData(value){
@ -234,12 +234,9 @@ export default {
this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName;
this.form.salePrice = this.form.salePrice2company
this.productData()
// this.productDataList(this.form.productName)
this.productRowData = this.productNameList.filter(
(item) => item.id == e
);
console.log("this.form", this.form,this.productRowData,this.productNameList);
this.productChange()
console.log("this.form", this.form);
}
},
submit() {

Loading…
Cancel
Save