pull/1/head
lixuan 2 years ago
parent 1ccc6803e7
commit b3502c348d
  1. 43
      src/api/order.js
  2. 7
      src/utils/axios.js
  3. 449
      src/views/order/components/billOfLading.vue
  4. 157
      src/views/order/index.vue
  5. 53
      src/views/product/components/create.vue
  6. 12
      src/views/product/index.vue

@ -0,0 +1,43 @@
import request from "utils/axios.js";
// table
const getByPage = (params) => {
return request.postJson("/oil-refinery/xoilRefineryOrder/getByPage", params);
};
//查看提货单信息
const findDeliveryByOrderId = (id) => {
return request.get(`/oil-refinery/xoilRefineryDelivery/findDeliveryByOrderId/${id}`);
};
//创建提货单
const billSave = (params) => {
return request.postJson("/oil-refinery/xoilRefineryDelivery/save", params);
};
//修改提货单
const update = (params) => {
return request.putJson("/oil-refinery/xoilRefineryDelivery/update", params);
};
//查看订单信息
const findByOrderId = (id) => {
return request.get(`/oil-refinery/xoilRefineryDelivery/findByOrderId/${id}`);
};
//修改提货单
const deleteBill = (params) => {
return request.putJson("/oil-refinery/xoilRefineryDelivery/delete", params);
};
//下单
const orderSuccess = (params) => {
return request.postJson("/oil-refinery/xoilRefineryOrder/orderSuccess", params);
};
export default {
getByPage,
findDeliveryByOrderId,
billSave,
findByOrderId,
update,
deleteBill,
orderSuccess
};

@ -24,6 +24,13 @@ export default {
data: data,
});
},
putJson(url, data) {
return axios({
url: url,
method: "put",
data: data,
});
},
postFromData(url, data) {
return axios({
url: url,

@ -0,0 +1,449 @@
<template>
<el-drawer
direction="ltr"
size="40%"
:visible="controlWindows.bill"
@opened="openDrawer"
:before-close="closeWindow"
:show-close = false
>
<div class="create" v-if="controlWindows.bill">
<el-form label-width="100px">
<div class="billTop">
<div class="billTop-top">
<div class="billTop-top-left">
<el-form-item label="订单信息">
</el-form-item>
<el-form-item label="提货单数量:">
<span>{{billData.orderInfo.deliveryAccount}}</span>
</el-form-item>
</div>
<el-form-item label="订单状态">
<el-tag effect='dark' :type="orderTagType(billData.orderInfo.orderStatus).orderType">{{orderTagType(billData.orderInfo.orderStatus).orderLabel}}</el-tag>
</el-form-item>
</div>
<div>
<div class="billTop-top-left">
<el-form-item label="预订数量:">
<span>{{billData.orderInfo.preQuantity}}</span>
</el-form-item>
<el-form-item label="订单金额:">
<span>{{billData.orderInfo.preAmount}}</span>
</el-form-item>
</div>
<div class="billTop-top-left">
<el-form-item label="已提数量:">
<span>{{billData.orderInfo.alreadyQuantity}}</span>
</el-form-item>
<el-form-item label="已提金额:">
<span>{{billData.orderInfo.alreadyAmount}}</span>
</el-form-item>
</div>
<div class="billTop-top-left">
<el-form-item label="剩余数量:">
<span>{{billData.orderInfo.surplusQuantity}}</span>
</el-form-item>
<el-form-item label="剩余金额:">
<span>{{billData.orderInfo.surplusAmount}}</span>
</el-form-item>
</div>
</div>
</div>
<div class="billBottom">
<div class="billBottom-title">
<span>提货单列表</span>
<el-button type="primary" @click="billAdd()">创建提货单</el-button>
</div>
<div class="" style="height: 58vh;overflow: auto;">
<div class="billBottom-body" v-for="(item,index) in billData.list" :key="index">
<div class="billBottom-body-top">
<el-form-item label="提货单">
<span>{{item.id}}</span>
</el-form-item>
<el-tag :type="orderTagType(item.deliveryStatus).type">{{orderTagType(item.deliveryStatus).label}}</el-tag>
</div>
<div class="billBottom-body-middle">
<div class="billBottom-body-middle-info">
<el-form-item label="预约提货量">
<span>{{ item.preDeliveryQuantity }}</span>
</el-form-item>
<el-form-item label="提货人">
<span>{{item.driverName}}</span>
</el-form-item>
<el-form-item label="车牌号">
<span>{{ item.plateNumber }}</span>
</el-form-item>
</div>
<div class="billBottom-body-middle-info">
<el-form-item label="实际提货量">
<span>{{ item.accDeliveryQuantity }}</span>
</el-form-item>
<el-form-item label="身份证">
<span>{{ item.identityCard }}</span>
</el-form-item>
</div>
</div>
<div v-show="item.deliveryStatus=='SUBMITED'" style="text-align: right;color: #409EFF;" @click="billAdd(item,index)">我来修改/锁定</div>
<div class="billBottom-body-bottom">
<div>
<el-form-item label="创建时间">
<span>{{ item.createTime }}</span>
</el-form-item>
<el-form-item label="更新时间">
<span>{{ item.updateTime }}</span>
</el-form-item>
</div>
<div>
<el-button v-show="item.deliveryStatus=='SUBMITED'" type="danger" @click="billDelete(item,index)">删除提货单</el-button>
<el-button :disabled="item.deliveryStatus!=='PLATENUM_LOCKED'&&item.deliveryStatus!=='PLATENUM_SUCCESS'" @click="billSubmit(item,index)" :type="orderTagType(item.deliveryStatus).type1">{{orderTagType(item.deliveryStatus).info}}</el-button>
</div>
</div>
</div>
</div>
</div>
</el-form>
</div>
<div class="buttons">
<el-button @click="controlWindows.bill = false">取消 </el-button>
<el-button @click="submit">订单确认</el-button>
</div>
<el-dialog :close-on-click-modal="false" :append-to-body="true" title="提货单信息" width="400px" :visible.sync="dialogBillAdd">
<el-form v-if="dialogBillAdd" :model="billAddData" ref="form" :rules="rules">
<el-form-item label="预约提货量" prop="preDeliveryQuantity">
<el-input v-model="billAddData.preDeliveryQuantity"></el-input>/
</el-form-item>
<el-form-item label="提货人" prop="driverName">
<el-input v-model="billAddData.driverName"></el-input>
</el-form-item>
<el-form-item label="提货人身份证号" prop="identityCard">
<el-input v-model="billAddData.identityCard"></el-input>
</el-form-item>
<el-form-item label="提货车牌号码" prop="plateNumber">
<el-input v-model="billAddData.plateNumber"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="info" @click="dialogBillAdd = false"> </el-button>
<el-button v-show="!billTitle" type="primary" @click="billAddSave()">确定</el-button>
<el-button v-show="billTitle" type="primary" @click="billAddSave(1)">修改</el-button>
<el-button v-show="billTitle" type="primary" @click="billAddSave(2)">修改并锁定</el-button>
</div>
</el-dialog>
<el-dialog
destroy-on-close
title="提示"
:close-on-click-modal="false" :append-to-body="true"
:visible.sync="dialogDelivery"
width="30%">
<el-form v-if="dialogDelivery">
<el-form-item label="实际提货量" prop="plateNumber">
<el-input v-model="deliveryQuantity"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogDelivery = false"> </el-button>
<el-button type="primary" @click="billdelivery()"> </el-button>
</span>
</el-dialog>
</el-drawer>
</template>
<script>
import serve from "api/product.js";
import order from "api/order.js";
import refineryInfoServe from "api/refineryInfo.js";
import autocomplete from "components/autocomplete/index.vue";
export default {
components: {
autocomplete,
},
filters:{
orderTagType(val){
switch(val){
case 'SUBMITED': return '订单提交'
case 'ORDER_LOCKED': return '下单中'
case 'ORDER_SUCCESS': return '下单成功'
case 'DELIVERING': return '提货中'
case 'COMPLETE': return '提货单完成'
case 'CANCELED': return '订单取消'
}
return {label:val?val:'暂无数据',type:'info'}
},
},
props: {
controlWindows: Object,
billData:Array
// refineryTypeEnum: Array,
},
data() {
return {
billTitle:'',
quantity:'',
deliveryQuantity:'',
dialogDelivery:false,
customList:[],
form: {
actAmount:0
},
billAddData:{},
dialogBillAdd:false,
productNameList:[],
refineryList: [],
productRowData:{},
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
echoId: "",
echoName: "",
},
rules: {
preDeliveryQuantity: [
{ required: true, message: "请输入预约提货量", trigger: "blur" },
],
driverName: [
{ required: true, message: "请输入提货人", trigger: "blur" },
],
identityCard: [
{ required: true, message: "请输入提货人身份证号", trigger: "blur" },
],
plateNumber: [
{ required: true, message: "请输入提货车牌号", trigger: "blur" },
],
},
};
},
created(){
},
methods: {
billdelivery(){
this.billAddData.deliveryStatus = 'COMPLETE'
this.billAddData.accDeliveryQuantity = this.deliveryQuantity
order.update(this.billAddData).then(res=>{
if(res.code == 20000){
this.billListMeth()
// this.$set(this.billData.list,this.billData.index,this.billAddData)
this.$message.success(res.msg)
this.dialogDelivery = false
}
})
},
billSubmit(e,index){
if(e.deliveryStatus=='PLATENUM_SUCCESS'){
this.billAddData = JSON.parse(JSON.stringify(e))
this.billData.index = index
this.dialogDelivery = true
}else if(e.deliveryStatus=='PLATENUM_LOCKED'){
this.billAddData = JSON.parse(JSON.stringify(e))
this.billAddData.deliveryStatus = 'PLATENUM_SUCCESS'
this.$confirm('是否确认?', '提示', { type: 'info' }).then(() => {
console.log(this.billData.list,index,this.billAddData,'aaaaaaaaaaa')
order.update(this.billAddData).then(res=>{
if(res.code == 20000){
this.billListMeth()
// this.$set(this.billData.list,index,this.billAddData)
this.$message.success(res.msg)
this.dialogBillAdd = false
}
})
})
}
},
orderTagType(val){
switch(val){
case 'SUBMITED': return {orderLabel:'订单提交',label:'等待信息',info:'等待信息锁定',type:'warning',type1:'info',orderType:'info'}
case 'PLATENUM_LOCKED': return {orderLabel:'下单中',label:'信息锁定',info:'提货信息确认',type:'info',type1:'success',orderType:'warning'}
case 'PLATENUM_SUCCESS': return {orderLabel:'下单成功',label:'提货中',info:'提货量确认',type:'',type1:'warning',orderType:''}
case 'DELIVERING': return {orderLabel:'提货中',label:'提货中', type: ''}
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'}
},
//
billAdd(e,index){
this.billTitle = e?true:false
this.billAddData = e?JSON.parse(JSON.stringify(e)):{}
this.billData.index = index
this.dialogBillAdd = true
},
//
billAddSave(e){
this.$refs["form"].validate((valid) => {
if (valid) {
if(!e){
this.billAddData.orderId=this.controlWindows.addInfo.id
this.billAddData.productMeasurement=this.controlWindows.addInfo.productMeasurement
order.billSave(this.billAddData).then(res=>{
if(res.code == 20000){
this.billAddData.deliveryStatus = 'SUBMITED'
this.billData.list.push(this.billAddData)
this.billListMeth()
this.$message.success(res.msg)
this.dialogBillAdd = false
}
})
}else{
delete this.billAddData.orderId
delete this.billAddData.productMeasurement
this.billAddData.deliveryStatus = e==2?'PLATENUM_LOCKED':''
order.update(this.billAddData).then(res=>{
if(res.code == 20000){
this.billListMeth()
this.$message.success(res.msg)
this.dialogBillAdd = false
}
})
}
}
})
},
//
billListMeth(){
setTimeout(()=>{
order.findDeliveryByOrderId(this.controlWindows.addInfo.id).then((res) => {
this.billData.list = res.data
this.$forceUpdate()
});
},200)
},
//
billDelete(e,index){
this.$confirm('确定删除提货单?', '提示', { type: 'error' }).then(() => {
order.deleteBill({id:e.id}).then(res=>{
if(res.code == 20000){
this.$message.success(res.msg)
this.dialogBillAdd = false;
this.billListMeth()
}
})
this.$set(this.billData.list,index,'')
})
},
openDrawer() {
let { id } = this.controlWindows.addInfo;
if (id) {
//
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName;
console.log("this.form", this.form.floorPrice);
}
},
submit() {
this.quantity = 0
this.billData.list.forEach(element => {
this.quantity += element.accDeliveryQuantity
});
this.$confirm('确定下单?', '提示', { type: 'error' }).then(() => {
let data={
id:this.controlWindows.addInfo.id,
actQuantity:this.quantity
}
order.orderSuccess(data).then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg);
this.closeWindow();
}
});
})
},
judgeInterface(form) {
// let { id } = this.controlWindows.addInfo;
// if (id) return serve.update(form);
// else
return serve.orderSave(form);
},
closeWindow() {
this.$emit("closeWindow");
this.form = {};
this.$refs.form.clearValidate();
this.controlWindows.create = false;
},
},
};
</script>
<style lang="scss" scoped>
.create {
padding: 40px;
.el-input,
.el-select,
.el-textarea,
.el-autocomplete {
width: 300px;
}
}
.buttons {
background: #fff;
position: absolute;
left: 0;
bottom: 0;
padding-right: 40px;
width: 100%;
height: 80px;
line-height: 80px;
text-align: right;
border-top: 1px solid #f2f3f5;
.el-button {
text-align: right;
font-size: 14px;
border-radius: 5px;
}
}
.billTop{
background: #f0f0f0;
padding: 15px 35px;
border-radius: 5px;
}
.billTop-top,.billBottom-title,.billBottom-body-top,.billBottom-body-bottom{
display: flex;
justify-content: space-between;
}
.billTop-top-left{
display: flex;
::v-deep .el-form-item{
margin-bottom:0
}
}
.billBottom{
.billBottom-title{
align-items: center;
margin: 20px 0;
}
}
.billBottom-body-middle {
::v-deep .el-form-item{
margin-bottom:0
}
.billBottom-body-middle-info{
display: flex;
}
}
.billBottom-body{
padding: 20px;
box-shadow: 0 1px 4px rgba(0,21,41,.50);
margin: 25px 0px;
}
.billBottom-body-bottom{
::v-deep .el-form-item{
margin-bottom:0
}
align-items: center;
margin-top: 20px;
}
::v-deep .el-drawer__header{
display: none;
}
::v-deep .billBottom .el-form-item__label{
line-height: 20px;
color: #999;
}
::v-deep .billBottom .el-form-item__content{
line-height: 20px;
}
</style>

@ -46,70 +46,80 @@
:data="tableData"
style="width: 100%"
>
<el-table-column
prop="refineryName"
label="用户名称"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="refineryName"
label="炼厂名称"
<el-table-column
prop="id"
label="订单ID"
show-overflow-tooltip
minWidth="250"
>
</el-table-column>
<el-table-column label="购方客户信息" minWidth="250">
<template slot-scope="{ row }">
<p class="gray">
<span>{{ row.customerName }}</span>
</p>
<p class="gray">
<span>{{ row.customerId || "暂无" }}</span>
</p>
</template>
</el-table-column>
<el-table-column prop="orderSerialNumber" label="产品名称" width="90">
<el-table-column label="炼厂&产品" minWidth="250">
<template slot-scope="{ row }">
{{
refineryTypeEnum.find((item) => item.value === row.refineryType)
.label
}}
<p class="gray">
炼厂名称 <span>{{ row.refineryName }}</span>
</p>
<p class="gray">
产品名称 <span>{{ row.productName }}</span>
</p>
</template>
</el-table-column>
<el-table-column prop="refineryLevel" label="价格" width="90">
<el-table-column
prop="salePrice" label="价格" minWidth="90">
</el-table-column>
<el-table-column prop="address" label="支付状态" show-overflow-tooltip>
<el-table-column prop="payStatus" label="支付状态" minWidth="120" show-overflow-tooltip>
<template slot-scope="{ row }">
<el-tag :effect="payTagType(row.payStatus).effect" :type="payTagType(row.payStatus).type">{{ payTagType(row.payStatus).label }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="orderSerialNumber" label="订单状态" width="80">
<el-table-column prop="orderStatus" label="订单状态" minWidth="120">
<template slot-scope="{ row }">
<el-switch
v-model="row.enableMark"
active-value="ENABLE"
inactive-value="DISABLE"
active-color="#13ce66"
inactive-color="#ff4949"
@change="
(val) => {
switchTrigger(val, row);
}
"
>
</el-switch>
<el-tag :effect="orderTagType(row.orderStatus).effect" :type="orderTagType(row.orderStatus).type">{{ orderTagType(row.orderStatus).label }}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="orderSerialNumber"
label="价格"
width="120"
label="订单提货量(实际/预约)"
minWidth="180"
>
<template slot-scope="{ row }">
<span>{{ row.actQuantity?row.actQuantity:'--' }} / {{ row.preQuantity?row.preQuantity:'--' }} </span>
</template>
</el-table-column>
<el-table-column
prop="orderSerialNumber"
label="价格"
width="120"
label="订单金额(实际/预约)"
minWidth="180"
>
<template slot-scope="{ row }">
<span>{{ row.actAmount }} / {{ row.preAmount }} </span>
</template>
</el-table-column>
<el-table-column label="时间" width="235">
<el-table-column label="时间" minWidth="235">
<template slot-scope="{ row }">
<p class="gray">
创建时间 <span>{{ row.createTime }}</span>
</p>
<p class="gray">
更新时间 <span>{{ row.updateTime || " - -" }}</span>
更新时间 <span>{{ row.updateTime || "暂无" }}</span>
</p>
</template>
</el-table-column>
<el-table-column prop="orderSerialNumber" label="操作" width="250">
<el-table-column prop="orderSerialNumber" fixed="right" label="操作" width="250">
<template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="detail(row)"
>详情</el-link
@ -160,12 +170,16 @@
>
</general-details>
</el-drawer>
<!-- 提货单 -->
<billOfLading :billData="billData" :controlWindows="controlWindows" @closeWindow="handleCurrentChange" />
</div>
</template>
<script>
import serve from "api/refineryInfo.js";
import order from "api/order.js";
import generalDetails from "components/generalDetails/index.vue";
import billOfLading from "./components/billOfLading.vue";
export default {
data() {
@ -173,9 +187,10 @@ export default {
controlWindows: {
add: false,
addInfo: {
title: "炼厂入驻",
},
detail: false,
bill: false,
},
refineryTypeEnum: [
{
@ -190,9 +205,11 @@ export default {
parameter: {
currentPage: 1,
pageSize: 10,
total: 0,
params: {},
},
oilCompanyMatch: {},
billData:[],
mappingData: [
{
carTitle: "",
@ -213,6 +230,7 @@ export default {
},
components: {
generalDetails,
billOfLading
},
mounted() {
this.$nextTick(() => {
@ -228,6 +246,30 @@ export default {
this.getByPage();
},
methods: {
payTagType(val){
switch(val){
case 'PREPAID': return {label:'预支付',type:'info'}
case 'PAYING': return {label:'支付中',type:'warning'}
case 'SUCCESS': return {label:'支付成功',type:'success',effect:'dark'}
case 'FAILURE': return {label:'支付失败',type:'danger',effect:'dark'}
case 'CANCELED': return {label:'支付取消',type:'info'}
case 'REFUNDED': return {label:'退款成功',type:'danger',effect:'dark'}
case 'REFUNDING': return{label:'退款中',type:'warning'}
case 'REFUNDFAIL': return{label:'退款失败',type:'info',effect:'dark'}
}
return {label:val?val:'暂无数据',type:'info',effect:'plain'}
},
orderTagType(val){
switch(val){
case 'SUBMITED': return {label:'订单提交 ',type:'info'}
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'}
case 'CANCELED': return {label:'订单取消',type:'info'}
}
return {label:val?val:'暂无数据',type:'info'}
},
// currentPage change
handleCurrentChange(page) {
this.parameter.currentPage = page;
@ -241,9 +283,9 @@ export default {
},
//table list
getByPage() {
serve.getByPage(this.parameter).then((res) => {
order.getByPage(this.parameter).then((res) => {
this.tableData = res.data.list;
this.total = res.data.totalPage;
this.total = res.data.totalCount;
});
},
//list
@ -257,15 +299,17 @@ export default {
this.controlWindows.addInfo.title = "炼厂入驻";
this.controlWindows.add = true;
},
//
update(row) {
this.controlWindows.addInfo.title = "炼厂修改";
Object.assign(this.controlWindows.addInfo, row);
this.controlWindows.add = true;
},
//
billOfLading(){
async billOfLading(row){
this.controlWindows.addInfo.title = "";
await order.findDeliveryByOrderId(row.id).then((res) => {
this.billData.list = res.data
});
await order.findByOrderId(row.id).then((res) => {
this.billData.orderInfo = res.data
});
this.controlWindows.addInfo = row
this.controlWindows.bill = true
},
//
detail(row) {
@ -274,14 +318,14 @@ export default {
},
//
deleteRow(row) {
serve
.deleteRow({
id: row.id,
})
.then((res) => {
this.$message.success(res.msg);
this.getByPage();
});
// serve
// .deleteRow({
// id: row.id,
// })
// .then((res) => {
// this.$message.success(res.msg);
// this.getByPage();
// });
},
//
switchTrigger(val, row) {
@ -302,6 +346,7 @@ export default {
this.parameter = {
currentPage: 1,
pageSize: 10,
total: 0,
params: {},
};
},

@ -1,16 +1,16 @@
<template>
<el-drawer
title="创建订单"
:title="controlWindows.addInfo.title"
direction="ltr"
size="40%"
:visible="controlWindows.create"
@opened="openDrawer"
:before-close="closeWindow"
>
<div class="create">
<div class="create" v-if="controlWindows.create">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="客户名称" prop="productName">
<el-select v-model="form.customId" reserve-keyword remote :remote-method="customData" filterable placeholder="请选择客户">
<el-form-item label="客户名称" prop="customerId">
<el-select v-model="form.customerId" reserve-keyword remote :remote-method="customData" filterable placeholder="请选择客户">
<el-option
v-for="(item, index) in customList"
:key="index"
@ -46,8 +46,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="产品名称">
<el-select v-model="form.productId" placeholder="请选择产品类型">
<el-form-item label="产品名称" prop="productId">
<el-select v-model="form.productId" @change="productDataList" placeholder="请选择产品类型">
<el-option
v-for="(item, index) in productNameList"
:key="index"
@ -66,6 +66,7 @@
maxlength="50"
v-model="form.salePrice"
placeholder="请输入销售价"
disabled
></el-input>
/
</el-form-item>
@ -80,9 +81,10 @@
<el-form-item label="订单金额">
<el-input
maxlength="50"
v-model="form.actAmount"
v-model="form.preAmount"
disabled
></el-input>
</el-form-item>
</el-form>
</div>
@ -110,14 +112,14 @@ export default {
"form.salePrice": {
handler(n, o) {
if(n){
this.form.actAmount = this.form.salePrice*(this.form.preQuantity?this.form.preQuantity:0)
this.form.preAmount = this.form.salePrice*(this.form.preQuantity?this.form.preQuantity:0)
}
},
},
"form.preQuantity": {
handler(n, o) {
if(n){
this.form.actAmount = this.form.preQuantity*(this.form.salePrice?this.form.salePrice:0)
this.form.preAmount = this.form.preQuantity*(this.form.salePrice?this.form.salePrice:0)
}
},
}
@ -130,10 +132,11 @@ export default {
return {
customList:[],
form: {
actAmount:0
preAmount:0
},
productNameList:[],
refineryList: [],
productRowData:{},
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocompleteKey: "refineryName",
@ -141,6 +144,8 @@ export default {
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
echoId: "",
echoName: "",
},
productTypeList: [
{
@ -161,8 +166,11 @@ export default {
},
],
rules: {
productName: [
{ required: true, message: "请输入产品名称", trigger: "blur" },
customerId: [
{ required: true, message: "请输入客户名称", trigger: "blur" },
],
productId: [
{ required: true, message: "请输入产品名称", trigger: "change" },
],
refineryId: [
{ required: true, validator: validatorRefineryId, trigger: "change" },
@ -177,6 +185,15 @@ export default {
};
},
methods: {
productDataList(e){
this.productRowData = this.productNameList.filter(
(item) => item.id == e
);
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()
},
@ -208,10 +225,20 @@ export default {
});
}
},
openDrawer() {},
openDrawer() {
let { id } = this.controlWindows.addInfo;
if (id) {
//
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName;
console.log("this.form", this.form.floorPrice);
}
},
submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.judgeInterface(this.form).then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg);

@ -137,7 +137,7 @@
<el-dropdown-item command="record">调价记录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<span class="el-dropdown-link">下单</span>
<span class="el-dropdown-link" @click="updateCreate(row)">下单</span>
<el-dropdown
@command="
(val) => {
@ -330,8 +330,16 @@ export default {
//
createOrder(row) {
this.controlWindows.addInfo.title = "创建订单";
this.controlWindows.create = true;
console.log(this.controlWindows.create);
},
//
updateCreate(row){
this.controlWindows.addInfo = {
title: "修改订单",
...row,
};
this.controlWindows.create = true;
},
//
detail(row) {

Loading…
Cancel
Save