|
@@ -12,11 +12,11 @@
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
<div class="cont">
|
|
|
- <div class="title"><span>* </span>店铺名称:</div>
|
|
|
+ <div class="title"><span>* </span>上游平台:</div>
|
|
|
<div class="right-cont">
|
|
|
- <el-select v-model="shopId" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
|
|
|
+ <el-select v-model="sourceId" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
|
|
|
<el-option
|
|
|
- v-for="item in shopOptions"
|
|
|
+ v-for="item in sourceOptions"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value">
|
|
@@ -33,7 +33,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-if="type == 2">
|
|
|
-
|
|
|
+ <div class="cont">
|
|
|
+ <div class="title"><span>* </span>店铺名称:</div>
|
|
|
+ <div class="right-cont">
|
|
|
+ <el-select v-model="shopid" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in shopOpions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="cont">
|
|
|
<div class="title"><span>* </span>时间类型:</div>
|
|
|
<div class="right-cont">
|
|
@@ -107,20 +119,22 @@
|
|
|
<script lang="ts">
|
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
import { pullOrder } from '@/api/omsOrder'
|
|
|
-import { query } from '@/api/sourceShop'
|
|
|
+import { query,queryShop } from '@/api/sourceShop'
|
|
|
@Component
|
|
|
export default class LoadOrderModal extends Vue {
|
|
|
load = false;
|
|
|
value = false;
|
|
|
type=1;
|
|
|
- shopName = '';
|
|
|
- shopId:any = null;
|
|
|
- shopOptions:Array<any>=[
|
|
|
+ sourceName = '';
|
|
|
+ sourceId:any = null;
|
|
|
+ sourceOptions:Array<any>=[
|
|
|
// {
|
|
|
// label:'犇云聚水潭店铺',
|
|
|
// value:2
|
|
|
// }
|
|
|
]
|
|
|
+ shopid=''
|
|
|
+ shopOpions:Array<any>=[]
|
|
|
sourceIds=''; //线上订单号
|
|
|
dateType:any='';
|
|
|
dateTypeOptions=[{
|
|
@@ -182,24 +196,27 @@ export default class LoadOrderModal extends Vue {
|
|
|
}
|
|
|
shopChange(v:any){
|
|
|
if(v){
|
|
|
- for(const item of this.shopOptions){
|
|
|
+ for(const item of this.sourceOptions){
|
|
|
if(item.value == v){
|
|
|
- this.shopName = item.label
|
|
|
+ this.sourceName = item.label
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ this.getSourceShopList()
|
|
|
}else{
|
|
|
- this.shopName=''
|
|
|
+ this.sourceName=''
|
|
|
+ this.shopid=''
|
|
|
+ this.shopOpions=[]
|
|
|
}
|
|
|
}
|
|
|
btn(){
|
|
|
let value:any={};
|
|
|
let msg = '';
|
|
|
- if(!this.shopId){
|
|
|
- msg = '店铺名称'
|
|
|
+ if(!this.sourceId){
|
|
|
+ msg = '上游平台'
|
|
|
}
|
|
|
- value.sourceId = this.shopId;
|
|
|
- value.soueceName = this.shopName;
|
|
|
+ value.sourceId = this.sourceId;
|
|
|
+ value.soueceName = this.sourceName;
|
|
|
value.type = this.type;
|
|
|
if(this.type == 1){
|
|
|
if(!this.sourceIds){
|
|
@@ -212,6 +229,14 @@ export default class LoadOrderModal extends Vue {
|
|
|
value.sourceIds = this.sourceIds.split('\n');
|
|
|
}else if(this.type == 2){
|
|
|
let isS=false;
|
|
|
+ if(!this.shopid){
|
|
|
+ if(msg){
|
|
|
+ msg = msg + ',店铺名称'
|
|
|
+ }else{
|
|
|
+ msg = '店铺名称'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ value.shopId = this.shopid
|
|
|
for(const item of this.dateTypeOptions){
|
|
|
if(item.value == this.dateType){
|
|
|
isS = true;
|
|
@@ -276,17 +301,19 @@ export default class LoadOrderModal extends Vue {
|
|
|
}
|
|
|
clear(){
|
|
|
this.type = 1;
|
|
|
- this.shopName = '';
|
|
|
- this.shopId = '';
|
|
|
+ this.sourceName = '';
|
|
|
+ this.sourceId = '';
|
|
|
this.sourceIds = '';
|
|
|
this.dateType = '';
|
|
|
this.beginDate = '';
|
|
|
this.endDate = '';
|
|
|
this.time = null;
|
|
|
this.status = '';
|
|
|
+ this.shopid = ''
|
|
|
}
|
|
|
- getShopList() {
|
|
|
- this.shopOptions = []
|
|
|
+ //上游平台
|
|
|
+ getSourceList() {
|
|
|
+ this.sourceOptions = []
|
|
|
this.load = true
|
|
|
query({
|
|
|
pageNo: 1,
|
|
@@ -295,7 +322,7 @@ export default class LoadOrderModal extends Vue {
|
|
|
this.load = false
|
|
|
if (res.data && res.data.records) {
|
|
|
for(const item of res.data.records) {
|
|
|
- this.shopOptions.push({
|
|
|
+ this.sourceOptions.push({
|
|
|
label: item.sourceName,
|
|
|
value: item.id
|
|
|
})
|
|
@@ -305,8 +332,27 @@ export default class LoadOrderModal extends Vue {
|
|
|
this.load = false
|
|
|
})
|
|
|
}
|
|
|
+ //店铺
|
|
|
+ getSourceShopList(){
|
|
|
+ this.shopOpions = []
|
|
|
+ queryShop({
|
|
|
+ sourceId:this.sourceId
|
|
|
+ }).then((res:any) => {
|
|
|
+ this.load = false
|
|
|
+ if (res.data) {
|
|
|
+ for(const item of res.data) {
|
|
|
+ this.shopOpions.push({
|
|
|
+ label: item.shopName,
|
|
|
+ value: item.shopId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(()=>{
|
|
|
+ this.load = false
|
|
|
+ })
|
|
|
+ }
|
|
|
created() {
|
|
|
- this.getShopList()
|
|
|
+ this.getSourceList()
|
|
|
}
|
|
|
}
|
|
|
</script>
|