|
@@ -5,17 +5,46 @@
|
|
|
<span>创建新订单</span>
|
|
|
</template>
|
|
|
<template #default>
|
|
|
+ <div class="order-step" v-if="orderValue.id">
|
|
|
+ <el-steps :active="stepActive" align-center finish-status="success" v-if="stepCon.indexOf(orderValue.status) >= 0" size="mini">
|
|
|
+ <el-step title="1.待付款"></el-step>
|
|
|
+ <el-step title="2.已付款待审核"></el-step>
|
|
|
+ <el-step title="3.已客审待财审"></el-step>
|
|
|
+ <el-step title="4.等供销商|外仓发货"></el-step>
|
|
|
+ <el-step title="5.已发货"></el-step>
|
|
|
+ </el-steps>
|
|
|
+ <div class="other" v-else>{{ stepTypeName(orderValue.status) }}</div>
|
|
|
+ </div>
|
|
|
<el-collapse v-model="activeNames">
|
|
|
<el-collapse-item title="基本信息" name="1" class="add-order-item">
|
|
|
- <by-form :propConfig="baseConfig" ref="baseform" @formChange="formChangeBase"></by-form>
|
|
|
+ <by-form :propConfig="baseConfig" ref="baseform" @formChange="formChangeBase">
|
|
|
+ <template v-slot:sourceFrom='{ value }'>
|
|
|
+ <span v-if="value.sourceFrom == 'ERP'">手工下单</span>
|
|
|
+ <span v-if="value.sourceFrom == 'COPY'">复制</span>
|
|
|
+ <span v-if="value.sourceFrom == 'MERGE'">合并</span>
|
|
|
+ <span v-if="value.sourceFrom == 'SPLIT'">拆分;拆分还原</span>
|
|
|
+ <span v-if="value.sourceFrom == 'MOBILE'">手工下单</span>
|
|
|
+ <span v-if="value.sourceFrom == 'IMPORT'">导入</span>
|
|
|
+ <span v-if="value.sourceFrom == 'drp-s'">供销推送</span>
|
|
|
+ <span v-if="value.sourceFrom == 'drp-d'">分销推送</span>
|
|
|
+ <span v-if="value.sourceFrom == 'KWAISHOP'">快手;微商城</span>
|
|
|
+ <span v-if="value.sourceFrom == 'PINDUODUO'">拼多多</span>
|
|
|
+ <span v-if="value.sourceFrom == 'TOUTIAOFXG'">头条放心购</span>
|
|
|
+ <span v-if="value.sourceFrom == 'JUSHUITAN'">聚水潭</span>
|
|
|
+ </template>
|
|
|
+ </by-form>
|
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="买家信息" name="2" class="add-order-item">
|
|
|
- <by-form :propConfig="buyerInfoConfig" ref="infoform"></by-form>
|
|
|
+ <by-form :propConfig="buyerInfoConfig" ref="infoform">
|
|
|
+ <template v-slot:receiverDistrictCode='{ value }'>
|
|
|
+ {{ value.receiverProvince + '-' + value.receiverCity + '-' + value.receiverDistrict + (value.receiverTown?'-'+value.receiverTown:'') }}
|
|
|
+ </template>
|
|
|
+ </by-form>
|
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="发票信息" name="5" class="add-order-item" v-if="orderValue.id">
|
|
|
- <by-form :propConfig="invoicesConfig" ref="invoicesform"></by-form>
|
|
|
+ <by-form :propConfig="newInvoicesConfig" ref="invoicesform"></by-form>
|
|
|
</el-collapse-item>
|
|
|
- <div class="btn-save" v-if="orderValue.id">
|
|
|
+ <div class="btn-save" v-if="orderValue.id && orderValue.isSubmitted != 1">
|
|
|
<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">
|
|
@@ -95,6 +124,13 @@
|
|
|
<div class="amount-price" style="color:#F00; font-size: 14px;">¥{{orderValue.payAmount?orderValue.payAmount:'0.00'}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="product-row" v-if="orderValue.paidAmount">
|
|
|
+ <div class="p-left"></div>
|
|
|
+ <div class="p-right">
|
|
|
+ <div class="amount-title">实付总金额:</div>
|
|
|
+ <div class="amount-price" style="color:#F00; font-size: 14px;">¥{{orderValue.paidAmount?orderValue.paidAmount:'0.00'}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="订单支付情况" name="4" class="add-order-item" v-if="!orderValue.id">
|
|
|
<el-radio-group v-model="radioPay" @input="inputPay" class="payType">
|
|
@@ -105,7 +141,7 @@
|
|
|
<by-form v-if="radioPay == 2" :propConfig="payConfig" ref="payform"></by-form>
|
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="发票信息" name="5" class="add-order-item" v-if="!orderValue.id">
|
|
|
- <by-form :propConfig="invoicesConfig" ref="invoicesform"></by-form>
|
|
|
+ <by-form :propConfig="newInvoicesConfig" ref="invoicesform"></by-form>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
<product-sku-modal ref="product" @confirm="confirmProduct" />
|
|
@@ -136,12 +172,16 @@ export default class AddOrder extends Vue {
|
|
|
userInfo:any='';//用户信息
|
|
|
orderValue:any={}; //新增订单值
|
|
|
radioPay=0;
|
|
|
+ stepActive:number=0;
|
|
|
+ stepCon=['WaitPay','WaitConfirm','WaitFConfirm','WaitOuterSent','Sent']
|
|
|
activeNames:Array<any> =['1','2','3','4','5','save'];
|
|
|
baseConfig:any={};
|
|
|
buyerInfoConfig:any={};
|
|
|
+ newInvoicesConfig:any={}
|
|
|
config:any={
|
|
|
attr:{
|
|
|
size:'mini',
|
|
|
+ itemCount:4,
|
|
|
rules:{
|
|
|
shopName:[{
|
|
|
required: true, message: '店铺名称不能为空!', trigger: 'blur'
|
|
@@ -225,6 +265,7 @@ export default class AddOrder extends Vue {
|
|
|
span:6,
|
|
|
label:'订单来源',
|
|
|
prop:'sourceFrom',
|
|
|
+ descSlot:true,
|
|
|
component:'by-select',
|
|
|
compConfig:{
|
|
|
attr:{
|
|
@@ -307,6 +348,7 @@ export default class AddOrder extends Vue {
|
|
|
config2:any={
|
|
|
attr:{
|
|
|
size:'mini',
|
|
|
+ itemCount:4,
|
|
|
rules:{
|
|
|
buyerId:[{
|
|
|
required: true, message: '买家账号不能为空!', trigger: 'blur'
|
|
@@ -350,6 +392,8 @@ export default class AddOrder extends Vue {
|
|
|
// slot:true,
|
|
|
prop:'receiverDistrictCode',
|
|
|
component:'by-area',
|
|
|
+ colspan:2,
|
|
|
+ descSlot:true,
|
|
|
compConfig:{
|
|
|
attr:{
|
|
|
province:'receiverProvince', //省
|
|
@@ -481,7 +525,7 @@ export default class AddOrder extends Vue {
|
|
|
}
|
|
|
invoicesConfig:any={
|
|
|
attr:{
|
|
|
- size:'mini'
|
|
|
+ size:'mini',
|
|
|
},
|
|
|
columns:[
|
|
|
[{
|
|
@@ -554,7 +598,7 @@ export default class AddOrder extends Vue {
|
|
|
},{
|
|
|
span:6,
|
|
|
label:'专票银行',
|
|
|
- prop:'account',
|
|
|
+ prop:'bank',
|
|
|
component:'by-input',
|
|
|
compConfig:{
|
|
|
attr:{
|
|
@@ -723,6 +767,22 @@ export default class AddOrder extends Vue {
|
|
|
}]
|
|
|
]
|
|
|
}
|
|
|
+ stepTypeName(n:string){
|
|
|
+ let t = '';
|
|
|
+ if(n == 'Merged'){
|
|
|
+ t = '被合并'
|
|
|
+ }
|
|
|
+ if(n == 'Question'){
|
|
|
+ t = '异常'
|
|
|
+ }
|
|
|
+ if(n == 'Split'){
|
|
|
+ t = '被拆分'
|
|
|
+ }
|
|
|
+ if(n == 'Cancelled'){
|
|
|
+ t = '已取消'
|
|
|
+ }
|
|
|
+ return t;
|
|
|
+ }
|
|
|
setShow(v:boolean){
|
|
|
this.value = v;
|
|
|
}
|
|
@@ -747,7 +807,7 @@ export default class AddOrder extends Vue {
|
|
|
show(){
|
|
|
this.baseConfig = (this as any).$lodash.cloneDeep(this.config);
|
|
|
this.buyerInfoConfig = (this as any).$lodash.cloneDeep(this.config2);
|
|
|
-
|
|
|
+ this.newInvoicesConfig = (this as any).$lodash.cloneDeep(this.invoicesConfig);
|
|
|
if(this.orderValue.id){
|
|
|
let data = this.orderValue;
|
|
|
this.freeAmount = this.orderValue.freeAmount;
|
|
@@ -801,30 +861,48 @@ export default class AddOrder extends Vue {
|
|
|
if(data.invoices && data.invoices[0]){
|
|
|
(this.$refs.invoicesform as any).setValue(data.invoices[0]);
|
|
|
}
|
|
|
-
|
|
|
- for(let col of this.baseConfig.columns){
|
|
|
- for(let item of col){
|
|
|
- let fieldArr = ['freight','buyerMessage','remark']
|
|
|
- if(fieldArr.indexOf(item.prop) == -1){
|
|
|
- if(!item.compConfig.attr) item.compConfig.attr = {};
|
|
|
- item.compConfig.attr.disabled = true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
if(this.orderValue.isSubmitted == 1){
|
|
|
- for(let col of this.buyerInfoConfig.columns){
|
|
|
+ this.baseConfig.attr.showType='desc';
|
|
|
+ this.baseConfig.attr.size='medium';
|
|
|
+ }else{
|
|
|
+ for(let col of this.baseConfig.columns){
|
|
|
for(let item of col){
|
|
|
- if(!item.compConfig.attr) item.compConfig.attr = {};
|
|
|
+ let disField:Array<string>=['freight','buyerMessage','remark']
|
|
|
+ if(disField.indexOf(item.prop) == -1){
|
|
|
+ if(!item.compConfig.attr) item.compConfig.attr = {};
|
|
|
item.compConfig.attr.disabled = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // let disStatus = ['WaitPay','Merged','Question','Split','WaitConfirm','Cancelled'];
|
|
|
+ if(this.orderValue.isSubmitted == 1){
|
|
|
+ this.buyerInfoConfig.attr.showType='desc';
|
|
|
+ this.buyerInfoConfig.attr.size='medium';
|
|
|
+ this.newInvoicesConfig.attr.showType='desc';
|
|
|
+ this.newInvoicesConfig.attr.size='medium';
|
|
|
+ // for(let col of this.buyerInfoConfig.columns){
|
|
|
+ // for(let item of col){
|
|
|
+ // if(!item.compConfig.attr) item.compConfig.attr = {};
|
|
|
+ // item.compConfig.attr.disabled = true;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // for(let col of this.newInvoicesConfig.columns){
|
|
|
+ // for(let item of col){
|
|
|
+ // if(!item.compConfig.attr) item.compConfig.attr = {};
|
|
|
+ // item.compConfig.attr.disabled = true;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }
|
|
|
|
|
|
this.totalAmount();
|
|
|
this.amountChange();
|
|
|
this.payAmountChange();
|
|
|
this.totalNum();
|
|
|
-
|
|
|
+ if(this.stepCon.indexOf(data.status) >=0 ){
|
|
|
+ this.stepActive = this.stepCon.indexOf(data.status)
|
|
|
+ }
|
|
|
}else{
|
|
|
let value:any = (this.$refs.baseform as any).getValue();
|
|
|
value.createBy = this.userInfo.userName;
|
|
@@ -832,7 +910,7 @@ export default class AddOrder extends Vue {
|
|
|
}
|
|
|
(this.$refs.baseform as any).setConfig(this.baseConfig);
|
|
|
(this.$refs.infoform as any).setConfig(this.buyerInfoConfig);
|
|
|
-
|
|
|
+ (this.$refs.invoicesform as any).setConfig(this.newInvoicesConfig);
|
|
|
}
|
|
|
hide(){
|
|
|
this.clearValue();
|
|
@@ -1012,9 +1090,10 @@ export default class AddOrder extends Vue {
|
|
|
this.amountChange();
|
|
|
this.payAmountChange();
|
|
|
}
|
|
|
- //清楚整个订单数据
|
|
|
+ //清除整个订单数据
|
|
|
clearValue(){
|
|
|
this.orderValue = {};
|
|
|
+ this.stepActive = 0;
|
|
|
(this.$refs.baseform as any).clearValue();
|
|
|
(this.$refs.baseform as any).clearValidate();
|
|
|
(this.$refs.infoform as any).clearValue();
|
|
@@ -1254,6 +1333,20 @@ export default class AddOrder extends Vue {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
+.order-step{
|
|
|
+ padding-bottom: 8px;
|
|
|
+ width: 100%;
|
|
|
+ .other{
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 16px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #FFF;
|
|
|
+ background-color: #198cf8;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|