pull/17/head
zhangyouji 2 years ago
parent b8225c5937
commit ba1324b14c
  1. 215
      src/views/order/components/billOfLading.vue

@ -1,25 +1,19 @@
<template> <template>
<el-drawer <el-drawer direction="ltr" size="40%" :visible="controlWindows.bill" @opened="openDrawer" :before-close="closeWindow" :show-close="false">
direction="ltr"
size="40%"
:visible="controlWindows.bill"
@opened="openDrawer"
:before-close="closeWindow"
:show-close = false
>
<div class="create" v-if="controlWindows.bill"> <div class="create" v-if="controlWindows.bill">
<el-form label-width="100px"> <el-form label-width="100px">
<div class="billTop"> <div class="billTop">
<div class="billTop-top"> <div class="billTop-top">
<div class="billTop-top-left"> <div class="billTop-top-left">
<el-form-item label="订单信息"> <el-form-item label="订单信息"> </el-form-item>
</el-form-item>
<el-form-item label="提货单数量:"> <el-form-item label="提货单数量:">
<span>{{ billData.orderInfo.deliveryAccount }}</span> <span>{{ billData.orderInfo.deliveryAccount }}</span>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="订单状态"> <el-form-item label="订单状态">
<el-tag effect='dark' :type="orderTagType(billData.orderInfo.orderStatus).orderType">{{orderTagType(billData.orderInfo.orderStatus).orderLabel}}</el-tag> <el-tag effect="dark" :type="orderTagType(billData.orderInfo.orderStatus).orderType">
{{ orderTagType(billData.orderInfo.orderStatus).orderLabel }}
</el-tag>
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
@ -54,7 +48,7 @@
<span>提货单列表</span> <span>提货单列表</span>
<el-button type="primary" @click="billAdd()">创建提货单</el-button> <el-button type="primary" @click="billAdd()">创建提货单</el-button>
</div> </div>
<div class="" style="height: 58vh;overflow: auto;"> <div class="" style="height: 58vh; overflow: auto">
<div class="billBottom-body" v-for="(item, index) in billData.list" :key="index"> <div class="billBottom-body" v-for="(item, index) in billData.list" :key="index">
<div class="billBottom-body-top"> <div class="billBottom-body-top">
<el-form-item label="提货单"> <el-form-item label="提货单">
@ -83,7 +77,9 @@
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div v-show="item.deliveryStatus=='SUBMITED'" style="text-align: right;color: #409EFF;" @click="billAdd(item,index)">我来修改/锁定</div> <div v-show="item.deliveryStatus == 'SUBMITED'" style="text-align: right; color: #409eff" @click="billAdd(item, index)">
我来修改/锁定
</div>
<div class="billBottom-body-bottom"> <div class="billBottom-body-bottom">
<div> <div>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
@ -94,8 +90,19 @@
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
<el-button v-show="billData.orderInfo.orderStatus=='DELIVERING'&&billData.orderInfo.payStatus!=='REFUNDED'" type="danger" @click="billDelete(item,index)">删除提货单</el-button> <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> v-show="billData.orderInfo.orderStatus == 'DELIVERING' && billData.orderInfo.payStatus !== 'REFUNDED'"
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> </div>
@ -105,13 +112,13 @@
</div> </div>
<div class="buttons"> <div class="buttons">
<el-button @click="closeWindow()">取消 </el-button> <el-button @click="closeWindow()">取消 </el-button>
<el-button v-show="billData.orderInfo&&billData.orderInfo.orderStatus&&billData.orderInfo.orderStatus=='DELIVERING'" @click="submit">订单确认</el-button> <el-button v-show="billData.orderInfo && billData.orderInfo.orderStatus && billData.orderInfo.orderStatus == 'DELIVERING'" @click="submit"
>订单确认</el-button
>
</div> </div>
<el-dialog :close-on-click-modal="false" :append-to-body="true" title="提货单信息" width="400px" :visible.sync="dialogBillAdd"> <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 v-if="dialogBillAdd" :model="billAddData" ref="form" :rules="rules">
<el-form-item label="预约提货量" prop="preDeliveryQuantity"> <el-form-item label="预约提货量" prop="preDeliveryQuantity"> <el-input v-model="billAddData.preDeliveryQuantity"></el-input> </el-form-item>
<el-input v-model="billAddData.preDeliveryQuantity"></el-input>
</el-form-item>
<el-form-item label="提货人" prop="driverName"> <el-form-item label="提货人" prop="driverName">
<el-input v-model="billAddData.driverName"></el-input> <el-input v-model="billAddData.driverName"></el-input>
</el-form-item> </el-form-item>
@ -129,12 +136,7 @@
<el-button v-show="billTitle" type="primary" @click="billAddSave(2)">修改并锁定</el-button> <el-button v-show="billTitle" type="primary" @click="billAddSave(2)">修改并锁定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog destroy-on-close title="提示" :close-on-click-modal="false" :append-to-body="true" :visible.sync="dialogDelivery" width="30%">
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 v-if="dialogDelivery">
<el-form-item label="实际提货量" prop="plateNumber"> <el-form-item label="实际提货量" prop="plateNumber">
<el-input v-model="deliveryQuantity"></el-input> <el-input v-model="deliveryQuantity"></el-input>
@ -149,27 +151,33 @@
</template> </template>
<script> <script>
import serve from "api/product.js"; import serve from 'api/product.js'
import order from "api/order.js"; import order from 'api/order.js'
import refineryInfoServe from "api/refineryInfo.js"; import refineryInfoServe from 'api/refineryInfo.js'
import autocomplete from "components/autocomplete/index.vue"; import autocomplete from 'components/autocomplete/index.vue'
export default { export default {
components: { components: {
autocomplete, autocomplete
}, },
filters: { filters: {
orderTagType(val) { orderTagType(val) {
switch (val) { switch (val) {
case 'SUBMITED': return '订单提交' case 'SUBMITED':
case 'ORDER_LOCKED': return '订单锁定' return '订单提交'
case 'ORDER_SUCCESS': return '下单成功' case 'ORDER_LOCKED':
case 'DELIVERING': return '提货中' return '订单锁定'
case 'COMPLETE': return '提货单完成' case 'ORDER_SUCCESS':
case 'CANCELED': return '订单取消' return '下单成功'
case 'DELIVERING':
return '提货中'
case 'COMPLETE':
return '提货单完成'
case 'CANCELED':
return '订单取消'
} }
return { label: val ? val : '暂无数据', type: 'info' } return { label: val ? val : '暂无数据', type: 'info' }
}, }
}, },
props: { props: {
controlWindows: Object, controlWindows: Object,
@ -193,32 +201,23 @@ export default {
productRowData: {}, productRowData: {},
configAutocomplete: { configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity, serveTarget: refineryInfoServe.findByEntity,
autocompleteKey: "refineryName", autocompleteKey: 'refineryName',
labelKey: "refineryName", labelKey: 'refineryName',
valueKey: "id", valueKey: 'id',
placeholder: "炼厂名称", placeholder: '炼厂名称',
querykey: "refineryId", querykey: 'refineryId',
echoId: "", echoId: '',
echoName: "", echoName: ''
}, },
rules: { rules: {
preDeliveryQuantity: [ preDeliveryQuantity: [{ required: true, message: '请输入预约提货量', trigger: 'blur' }],
{ required: true, message: "请输入预约提货量", trigger: "blur" }, driverName: [{ required: true, message: '请输入提货人', trigger: 'blur' }],
], identityCard: [{ required: true, message: '请输入提货人身份证号', trigger: 'blur' }],
driverName: [ plateNumber: [{ required: true, message: '请输入提货车牌号', trigger: 'blur' }]
{ required: true, message: "请输入提货人", trigger: "blur" }, }
], }
identityCard: [
{ required: true, message: "请输入提货人身份证号", trigger: "blur" },
],
plateNumber: [
{ required: true, message: "请输入提货车牌号", trigger: "blur" },
],
},
};
},
created(){
}, },
created() {},
methods: { methods: {
billdelivery() { billdelivery() {
this.billAddData.deliveryStatus = 'COMPLETE' this.billAddData.deliveryStatus = 'COMPLETE'
@ -230,7 +229,7 @@ export default {
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogDelivery = false this.dialogDelivery = false
this.$forceUpdate() this.$forceUpdate()
this.$emit("closeWindow") this.$emit('closeWindow')
} }
}) })
}, },
@ -250,7 +249,7 @@ export default {
// this.$set(this.billData.list,index,this.billAddData) // this.$set(this.billData.list,index,this.billAddData)
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogBillAdd = false this.dialogBillAdd = false
this.$emit("closeWindow"); this.$emit('closeWindow')
} }
}) })
}) })
@ -258,14 +257,22 @@ export default {
}, },
orderTagType(val) { orderTagType(val) {
switch (val) { switch (val) {
case 'SUBMITED': return {orderLabel:'订单提交',label:'等待信息',info:'等待信息锁定',type:'warning',type1:'info',orderType:'info'} case 'SUBMITED':
case 'PLATENUM_LOCKED': return {orderLabel:'下单中',label:'信息锁定',info:'提货信息确认',type:'info',type1:'success',orderType:'warning'} return { orderLabel: '订单提交', label: '等待信息', info: '等待信息锁定', type: 'warning', type1: 'info', orderType: 'info' }
case 'PLATENUM_SUCCESS': return {orderLabel:'下单成功',label:'提货中',info:'提货量确认',type:'',type1:'warning',orderType:''} case 'PLATENUM_LOCKED':
case 'ORDER_LOCKED': return {orderLabel:'下单中',label:'信息锁定',info:'提货信息确认',type:'info',type1:'success',orderType:'warning'} return { orderLabel: '下单中', label: '信息锁定', info: '提货信息确认', type: 'info', type1: 'success', orderType: 'warning' }
case 'ORDER_SUCCESS': return {orderLabel:'下单成功',label:'提货中',info:'提货量确认',type:'',type1:'warning',orderType:''} case 'PLATENUM_SUCCESS':
case 'DELIVERING': return {orderLabel:'提货中',label:'提货中', type: ''} return { orderLabel: '下单成功', label: '提货中', info: '提货量确认', type: '', type1: 'warning', orderType: '' }
case 'COMPLETE': return {orderLabel:'订单完成',label:'提货完成',info:'提货完成',type:'success',type1:'info',orderType:'success'} case 'ORDER_LOCKED':
case 'CANCELED': return {orderLabel:'订单取消',label:'订单取消',info:'订单取消',type:'info',type1:'dark',orderType:'info'} return { orderLabel: '下单中', label: '信息锁定', info: '提货信息确认', type: 'info', type1: 'success', orderType: 'warning' }
case 'ORDER_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 : '暂无数据', info: val ? val : '暂无数据', type: 'info' } return { label: val ? val : '暂无数据', info: val ? val : '暂无数据', type: 'info' }
}, },
@ -278,7 +285,7 @@ export default {
}, },
// //
billAddSave(e) { billAddSave(e) {
this.$refs["form"].validate((valid) => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (!e) { if (!e) {
this.billAddData.orderId = this.controlWindows.addInfo.id this.billAddData.orderId = this.controlWindows.addInfo.id
@ -309,14 +316,14 @@ export default {
// //
billListMeth() { billListMeth() {
setTimeout(() => { setTimeout(() => {
order.findDeliveryByOrderId(this.controlWindows.addInfo.id).then((res) => { order.findDeliveryByOrderId(this.controlWindows.addInfo.id).then(res => {
this.billData.list = res.data this.billData.list = res.data
this.$forceUpdate() this.$forceUpdate()
}); })
order.findByOrderId(this.controlWindows.addInfo.id).then((res) => { order.findByOrderId(this.controlWindows.addInfo.id).then(res => {
this.billData.orderInfo = res.data this.billData.orderInfo = res.data
this.$forceUpdate() this.$forceUpdate()
}); })
}, 200) }, 200)
}, },
// //
@ -325,20 +332,20 @@ export default {
order.deleteBill({ id: e.id }).then(res => { order.deleteBill({ id: e.id }).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogBillAdd = false; this.dialogBillAdd = false
this.billListMeth() this.billListMeth()
} }
}) })
}) })
}, },
openDrawer() { openDrawer() {
let { id } = this.controlWindows.addInfo; let { id } = this.controlWindows.addInfo
if (id) { if (id) {
// //
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo))
this.configAutocomplete.echoId = id; this.configAutocomplete.echoId = id
this.configAutocomplete.echoName = this.form.refineryName; this.configAutocomplete.echoName = this.form.refineryName
console.log("this.form", this.form.floorPrice); console.log('this.form', this.form.floorPrice)
} }
}, },
submit() { submit() {
@ -350,49 +357,46 @@ export default {
this.$message.error('提货单异常') this.$message.error('提货单异常')
throw new Error() throw new Error()
} }
}); })
let titleConfirm = ['是否确认订单已完成?', '一旦确认,该订单无法再被提货,且未提货的金额将自行退回。'] let titleConfirm = ['是否确认订单已完成?', '一旦确认,该订单无法再被提货,且未提货的金额将自行退回。']
const newDatas = [] const newDatas = []
const h = this.$createElement const h = this.$createElement
for (const i in titleConfirm) { for (const i in titleConfirm) {
newDatas.push(h('p', null, titleConfirm[i])) newDatas.push(h('p', null, titleConfirm[i]))
} }
this.$confirm( this.$confirm('提示', {
'提示',
{
title: '提示', title: '提示',
message: h('div', null, newDatas), message: h('div', null, newDatas),
showCancelButton: true, showCancelButton: true,
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
} }).then(() => {
).then(() => {
let data = { let data = {
id: this.controlWindows.addInfo.id, id: this.controlWindows.addInfo.id,
actQuantity:this.quantity, actQuantity: this.quantity
} }
order.orderComplete(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()
} }
}); })
}) })
}, },
judgeInterface(form) { judgeInterface(form) {
// let { id } = this.controlWindows.addInfo; // let { id } = this.controlWindows.addInfo;
// if (id) return serve.update(form); // if (id) return serve.update(form);
// else // else
return serve.orderSave(form); return serve.orderSave(form)
}, },
closeWindow() { closeWindow() {
this.$emit("closeWindow"); this.$emit('closeWindow')
this.form = {}; this.form = {}
this.controlWindows.bill = false; this.controlWindows.bill = false
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -427,14 +431,17 @@ export default {
padding: 15px 35px; padding: 15px 35px;
border-radius: 5px; border-radius: 5px;
} }
.billTop-top,.billBottom-title,.billBottom-body-top,.billBottom-body-bottom{ .billTop-top,
.billBottom-title,
.billBottom-body-top,
.billBottom-body-bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.billTop-top-left { .billTop-top-left {
display: flex; display: flex;
::v-deep .el-form-item { ::v-deep .el-form-item {
margin-bottom:0 margin-bottom: 0;
} }
} }
.billBottom { .billBottom {
@ -445,7 +452,7 @@ export default {
} }
.billBottom-body-middle { .billBottom-body-middle {
::v-deep .el-form-item { ::v-deep .el-form-item {
margin-bottom:0 margin-bottom: 0;
} }
.billBottom-body-middle-info { .billBottom-body-middle-info {
display: flex; display: flex;
@ -453,12 +460,12 @@ export default {
} }
.billBottom-body { .billBottom-body {
padding: 20px; padding: 20px;
box-shadow: 0 1px 4px rgba(0,21,41,.50); box-shadow: 0 1px 4px rgba(0, 21, 41, 0.5);
margin: 25px 0px; margin: 25px 0px;
} }
.billBottom-body-bottom { .billBottom-body-bottom {
::v-deep .el-form-item { ::v-deep .el-form-item {
margin-bottom:0 margin-bottom: 0;
} }
align-items: center; align-items: center;
margin-top: 20px; margin-top: 20px;

Loading…
Cancel
Save