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) => { const orderSuccess = (params) => {
return request.postJson("/oil-refinery/xoilRefineryOrder/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, findByOrderId,
update, update,
deleteBill, deleteBill,
orderSuccess orderSuccess,
orderLock,
orderComplete
}; };

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

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

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

Loading…
Cancel
Save