|
@@ -37,16 +37,15 @@
|
|
|
<el-button type="primary" size="small" @click="saveBase">保存基本信息及收获地址</el-button>
|
|
|
</div>
|
|
|
<el-collapse-item title="订单支付情况" name="4" class="add-order-item" v-if="orderValue.id">
|
|
|
- <el-radio-group v-model="radioPay" @input="inputPay" v-if="!orderValue.id" class="payType">
|
|
|
- <el-radio :label="0">待付款</el-radio>
|
|
|
- <el-radio :label="1">快速支付&已付款</el-radio>
|
|
|
- <el-radio :label="2">手工添加支付信息</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- <div class="pay-row" v-else-if="orderValue.status != 'Split' && orderValue.status != 'Merged' && orderValue.status != 'Cancelled'">
|
|
|
+ <div class="pay-row" v-if="orderValue.status != 'Split' && orderValue.status != 'Merged' && orderValue.status != 'Cancelled'">
|
|
|
<el-button type="text" v-if="!orderValue.pays || orderValue.pays.length == 0">快速支付</el-button>
|
|
|
- <el-button type="text" @click="radioPay = 2">添加手工支付</el-button>
|
|
|
+ <el-button type="text" v-if="!showPay" @click="showPay = true">添加手工支付</el-button>
|
|
|
+ <el-button v-else icon="el-icon-close" size="mini" circle @click="showPay = false"></el-button>
|
|
|
+ </div>
|
|
|
+ <by-form v-if="showPay" :propConfig="payConfig" ref="payform"></by-form>
|
|
|
+ <div class="pay-row" v-if="showPay && orderValue.status != 'Split' && orderValue.status != 'Merged' && orderValue.status != 'Cancelled'">
|
|
|
+ <el-button type="primary" size="mini" @click="addPay">添加</el-button>
|
|
|
</div>
|
|
|
- <by-form v-if="radioPay == 2" :propConfig="payConfig" ref="payform"></by-form>
|
|
|
<div class="pay-info">
|
|
|
<el-descriptions v-for="(item,index) of orderValue.pays" :key="index" :title="item.payment" size="mini" :column="4">
|
|
|
<el-descriptions-item label="单号">{{item.outerPayId}}</el-descriptions-item>
|
|
@@ -70,7 +69,7 @@
|
|
|
</div>
|
|
|
|
|
|
<by-table :propConfig="tableConfig" ref="table">
|
|
|
- <template v-slot:t_cont='{ row }'>
|
|
|
+ <!-- <template v-slot:t_cont='{ row }'>
|
|
|
<div class="product-cont">
|
|
|
<div class="product-name">{{ row.name }}</div>
|
|
|
<div class="other-info">
|
|
@@ -79,7 +78,7 @@
|
|
|
<el-tag v-if="row.isGift == 1" size="mini" type="success">赠</el-tag>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
<template v-slot:qty='{ row }'>
|
|
|
<vxe-input v-model="row.qty" placeholder="数量" align="center" size="mini" type="integer" @input="qtyChange($event, row)"></vxe-input>
|
|
|
</template>
|
|
@@ -152,13 +151,14 @@
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
-import { addOrder,saveBaseOrder,single,delItem } from '@/api/omsOrder'
|
|
|
+import { addOrder,saveBaseOrder,single,delItem,addPay } from '@/api/omsOrder'
|
|
|
import { add,multiply,subtract,divide } from '@/benyun/utils/accuracy'
|
|
|
import AddProductModal from "./addProductModal.vue";
|
|
|
@Component({components:{AddProductModal}})
|
|
|
export default class AddOrder extends Vue {
|
|
|
value=false;
|
|
|
num:any=0;
|
|
|
+ showPay = false;
|
|
|
load = false;
|
|
|
freeAmount="";
|
|
|
productTotal:any=0;
|
|
@@ -229,6 +229,8 @@ export default class AddOrder extends Vue {
|
|
|
attr:{
|
|
|
// placeholder:'请输入订单日期',
|
|
|
clearable:true,
|
|
|
+ type:'datetime',
|
|
|
+ format:'yyyy-MM-dd HH:mm:ss',
|
|
|
defaultNow:true
|
|
|
}
|
|
|
}
|
|
@@ -472,14 +474,11 @@ export default class AddOrder extends Vue {
|
|
|
tableConfig:any={
|
|
|
attr:{
|
|
|
size:'small',
|
|
|
- // seq:true,
|
|
|
align:'center',
|
|
|
- // checkbox:true,
|
|
|
},
|
|
|
columns:[{
|
|
|
- title:'名称|款式编码|商品编码',
|
|
|
- field:'t_cont',
|
|
|
- slot:true,
|
|
|
+ title:'名称',
|
|
|
+ field:'name',
|
|
|
width:300
|
|
|
},{
|
|
|
title:'数量',
|
|
@@ -688,9 +687,9 @@ export default class AddOrder extends Vue {
|
|
|
]
|
|
|
}
|
|
|
payConfig:any={
|
|
|
- attr:{
|
|
|
- size:'mini'
|
|
|
- },
|
|
|
+ // attr:{
|
|
|
+ // size:'mini'
|
|
|
+ // },
|
|
|
columns:[
|
|
|
[{
|
|
|
span:6,
|
|
@@ -698,7 +697,7 @@ export default class AddOrder extends Vue {
|
|
|
prop:'payment',
|
|
|
component:'by-select',
|
|
|
rules:[
|
|
|
- { required: true, message: '请选择时间', trigger: 'change' }
|
|
|
+ { required: true, message: '请选择支付方法', trigger: 'change' }
|
|
|
],
|
|
|
compConfig:{
|
|
|
attr:{
|
|
@@ -724,9 +723,12 @@ export default class AddOrder extends Vue {
|
|
|
{ required: true, message: '请选择支付日期', trigger: 'change' }
|
|
|
],
|
|
|
component:'by-date-picker',
|
|
|
- comConfig:{
|
|
|
+ compConfig:{
|
|
|
attr:{
|
|
|
- clearable:true
|
|
|
+ type:'datetime',
|
|
|
+ format:'yyyy-MM-dd HH:mm:ss',
|
|
|
+ clearable:true,
|
|
|
+ defaultNow:true
|
|
|
}
|
|
|
}
|
|
|
},{
|
|
@@ -735,11 +737,11 @@ export default class AddOrder extends Vue {
|
|
|
prop:'outerPayId',
|
|
|
component:'by-input',
|
|
|
rules:[
|
|
|
- { required: true, message: '请选择支付日期', trigger: 'change' }
|
|
|
+ { required: true, message: '请输入支付单号', trigger: 'change' }
|
|
|
],
|
|
|
compConfig:{
|
|
|
attr:{
|
|
|
- placeholder:'支付账号',
|
|
|
+ placeholder:'支付单号',
|
|
|
clearable:true
|
|
|
}
|
|
|
}
|
|
@@ -761,7 +763,7 @@ export default class AddOrder extends Vue {
|
|
|
}
|
|
|
},{
|
|
|
span:6,
|
|
|
- label:'买家收款账号',
|
|
|
+ label:'买家支付账号',
|
|
|
prop:'buyerAccount',
|
|
|
component:'by-input',
|
|
|
compConfig:{
|
|
@@ -854,6 +856,33 @@ export default class AddOrder extends Vue {
|
|
|
this.$emit('handleSuccess');
|
|
|
this.getData();
|
|
|
}
|
|
|
+ //添加手工支付
|
|
|
+ addPay(){
|
|
|
+ (this.$refs.payform as any).validate({noMsg:true}).then(()=>{
|
|
|
+ let payFormValue = (this.$refs.payform as any).getValue();
|
|
|
+ payFormValue.sellerId = this.userInfo.userId;
|
|
|
+ payFormValue.orderId = this.orderValue.id;
|
|
|
+ payFormValue.sourceFrom = this.orderValue.sourceFrom;
|
|
|
+ payFormValue.isOrderPay = 1;
|
|
|
+ payFormValue.buyerId = this.orderValue.buyerId;
|
|
|
+ payFormValue.shopId = this.orderValue.shopId;
|
|
|
+ payFormValue.shopName = this.orderValue.shopName;
|
|
|
+ payFormValue.status = this.orderValue.status;
|
|
|
+ this.load = true;
|
|
|
+ addPay(payFormValue).then(()=>{
|
|
|
+ this.load = false;
|
|
|
+ this.$message({
|
|
|
+ message:'操作成功',
|
|
|
+ type:'success'
|
|
|
+ });
|
|
|
+ this.showPay = false;
|
|
|
+ this.handleSuccess();
|
|
|
+ }).catch(()=>{
|
|
|
+ this.load = false;
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
//添加商品
|
|
|
toolAddProduct(){
|
|
|
if(this.orderValue.id){
|
|
@@ -938,12 +967,6 @@ export default class AddOrder extends Vue {
|
|
|
if(this.orderValue.isPay != 0 || this.orderValue.isPay != 1){
|
|
|
this.radioPay == 2
|
|
|
}
|
|
|
- setTimeout(()=>{
|
|
|
- if(this.$refs.payform && data.pays && data.pays[0]){
|
|
|
- (this.$refs.payform as any).setValue(data.pays[0])
|
|
|
- }
|
|
|
- },500);
|
|
|
-
|
|
|
//发票
|
|
|
if(data.invoices && data.invoices[0]){
|
|
|
(this.$refs.invoicesform as any).setValue(data.invoices[0]);
|
|
@@ -972,7 +995,7 @@ export default class AddOrder extends Vue {
|
|
|
|
|
|
this.totalAmount();
|
|
|
this.amountChange();
|
|
|
- this.payAmountChange();
|
|
|
+ // this.payAmountChange();
|
|
|
this.totalNum();
|
|
|
if(this.stepCon.indexOf(data.status) >=0 ){
|
|
|
this.stepActive = this.stepCon.indexOf(data.status)
|
|
@@ -987,6 +1010,7 @@ export default class AddOrder extends Vue {
|
|
|
(this.$refs.invoicesform as any).setConfig(this.newInvoicesConfig);
|
|
|
}
|
|
|
hide(){
|
|
|
+ this.showPay = false;
|
|
|
this.clearValue();
|
|
|
}
|
|
|
//抵扣金额数值变化
|
|
@@ -1000,7 +1024,7 @@ export default class AddOrder extends Vue {
|
|
|
let nowData = (this.$refs.table as any).getValue();
|
|
|
this.productTotal = 0;
|
|
|
for(const item of nowData){
|
|
|
- if(Number(item.amount)){
|
|
|
+ if(Number(item.amount) && item.isGift != 1){
|
|
|
this.productTotal = add(item.amount, this.productTotal)
|
|
|
}
|
|
|
}
|
|
@@ -1161,8 +1185,8 @@ export default class AddOrder extends Vue {
|
|
|
}
|
|
|
//数量的变化
|
|
|
qtyChange(v:any,row:any){
|
|
|
- if(v && row.price){
|
|
|
- row.amount = multiply(v,Number(row.price))
|
|
|
+ if(v.value && row.price){
|
|
|
+ row.amount = multiply(Number(v.value),Number(row.price))
|
|
|
}else{
|
|
|
row.amount = 0
|
|
|
}
|
|
@@ -1173,8 +1197,8 @@ export default class AddOrder extends Vue {
|
|
|
}
|
|
|
//单价的变化
|
|
|
priceChange(v:any,row:any){
|
|
|
- if(v && row.qty){
|
|
|
- row.amount =multiply(v,Number(row.qty))
|
|
|
+ if(v.value && row.qty){
|
|
|
+ row.amount =multiply(Number(v.value),Number(row.qty))
|
|
|
}else{
|
|
|
row.amount = 0
|
|
|
}
|
|
@@ -1212,9 +1236,10 @@ export default class AddOrder extends Vue {
|
|
|
for(const key in baseInfo){
|
|
|
this.orderValue[key] = baseInfo[key]
|
|
|
}
|
|
|
- if(this.orderValue.orderDate){
|
|
|
- this.orderValue.orderDate = this.orderValue.orderDate + ' 00:00:00'
|
|
|
+ if(this.orderValue.freight){
|
|
|
+ this.orderValue.freight = Math.floor(Number(this.orderValue.freight) * 100) / 100;
|
|
|
}
|
|
|
+
|
|
|
//买家信息
|
|
|
(this.$refs.infoform as any).validate({noMsg:true}).then(()=>{
|
|
|
let infoValue = (this.$refs.infoform as any).getValue();
|
|
@@ -1249,9 +1274,6 @@ export default class AddOrder extends Vue {
|
|
|
(this.$refs.payform as any).validate({noMsg:true}).then(()=>{
|
|
|
this.orderValue.pays = [];
|
|
|
let payFormValue = (this.$refs.payform as any).getValue();
|
|
|
- if(payFormValue.payDate){
|
|
|
- payFormValue.payDate = payFormValue.payDate + ' 00:00:00'
|
|
|
- }
|
|
|
payFormValue.sellerId = this.userInfo.userId;
|
|
|
this.orderValue.pays.push(payFormValue);
|
|
|
resolve();
|