ymy 1 年間 前
コミット
f82e2a033f

+ 37 - 0
src/api/shop.ts

@@ -0,0 +1,37 @@
+import request from '@/benyun/utils/request'
+
+//查询数据
+export function query(params:any) {
+	return request({
+		url: '/omsOrder/omsShop/page',
+		method: 'get',
+		params:params
+	})
+}
+
+//新增数据
+export function save(data:any) {
+	return request({
+		url: '/omsOrder/omsShop/save',
+		method: 'POST',
+		data:data
+	})
+}
+
+//修改数据
+export function update(data:any) {
+	return request({
+		url: '/omsOrder/omsShop/update',
+		method: 'POST',
+		data:data
+	})
+}
+
+//删除数据
+export function del(data:any) {
+	return request({
+		url: '/omsOrder/omsShop/delete',
+		method: 'POST',
+		data:data
+	})
+}

+ 1 - 2
src/benyun/compVue/ModuleViewHandle.ts

@@ -5,6 +5,7 @@ export default class ModuleViewHandle extends VueViews{
   searchID=this.getUuid(); //搜索id
   toolID=this.getUuid(); // 工具栏id
   tableID=this.getUuid(); //表格id
+  viewID=this.getUuid();
   hideSearch=false  // 隐藏/显示搜索
   load=false
   time:any;
@@ -105,8 +106,6 @@ export default class ModuleViewHandle extends VueViews{
 
   //刷新
   onRefresh(){
-    // (this.$refs[this.tableID] as any).setPage({pageNo:1,total:0})
-    // this.getList();
 		this.$emit('onRefresh')
   }
   // onRefresh(){

+ 40 - 2
src/benyun/components/moduleView/moduleView.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="module-view" 
     v-loading="load"
+    :ref="viewID"
     element-loading-text="拼命加载中"
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.5)"
   >
     <div class="search" v-if="searchConfig" v-show="!hideSearch">
-      <by-form :propConfig="searchConfig" :ref="searchID">
-      </by-form>
+      <by-form :propConfig="searchConfig" :ref="searchID"></by-form>
       <div class="search-btn">
         <el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
         <el-button size="mini" icon="el-icon-refresh" @click="resert">重置</el-button>
@@ -51,6 +51,8 @@ export default class ModuleView extends ModuleViewHandle {
     return this.config?.table ? this.config.table : null
   }
 
+  calculateCount=0;
+
   created(){
     if(this.propConfig){
       this.setConfig(this.propConfig)
@@ -58,6 +60,38 @@ export default class ModuleView extends ModuleViewHandle {
   }
   mounted(){
     // this.getList() 
+    // this.$nextTick(()=>{
+    //   this.initTable();
+    // })
+  }
+  initTable(){
+    if(!this.$refs[this.tableID]){
+      this.calculateCount ++;
+      if(this.calculateCount > 5){
+        return
+      }
+      setTimeout(()=>{
+        this.initTable()
+      },500) 
+      return
+    }
+    let fHeight = 0;
+    let tHeight = 0;
+    let vHeight = (this as any).$el.offsetHeight;
+    if(this.$refs[this.searchID]){
+      fHeight = (this.$refs[this.searchID] as any).$el.offsetHeight + 28;
+    }
+    if(this.$refs[this.toolID]){
+      tHeight = (this.$refs[this.toolID] as any).$el.offsetHeight
+    }
+    console.log('aaaaaaa',vHeight);
+    if(this.config.table && vHeight > 0){
+      const h = vHeight - 32 - fHeight - tHeight - 48;
+      this.config.table.attr.height = h;
+      if(this.$refs[this.tableID]){
+        (this.$refs[this.tableID] as any).recalculate();
+      }
+    }
   }
   search(){
     this.$emit('search');
@@ -74,6 +108,10 @@ export default class ModuleView extends ModuleViewHandle {
     this.resertHandle()
   }
   clickHandle(e:string){
+    if(e == 'toggleSearch'){
+      this.calculateCount=0;
+      this.initTable()
+    }
     if((this as any)[e]){
       (this as any)[e]()
     }else{

+ 317 - 4
src/views/oms/shop/index.vue

@@ -1,9 +1,322 @@
 <template>
-  <div></div>
+  <div class="shop">
+    <module-view :propConfig="config" ref="view" v-loading="load" style="height:100%" @pagination="pagination" />
+  </div>
 </template>
 
 <script lang="ts">
-export default {
-  
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { query,save,update,del } from '@/api/shop'
+@Component({components:{}})
+export default class Shop extends Vue {
+  load=false;
+  time:any;
+  timeNum = 0;
+  config:any={
+    search:{
+      attr:{
+        size:'small'
+      },
+      columns:[
+        [{
+          label:'店铺名称',
+          prop:'shopName',
+          component:'by-input',
+          compConfig:{}
+        },{
+          label:'店铺简称',
+          prop:'shortName',
+          component:'by-input',
+          compConfig:{}
+        },{
+          label:'店铺简称',
+          prop:'shortName',
+          component:'by-input',
+          compConfig:{}
+        },{
+          label:'授权状态',
+          prop:'authStatus',
+          component:'by-input',
+          compConfig:{}
+        }],
+        [{
+          label:'授权账号',
+          prop:'authAccount',
+          component:'by-input',
+          compConfig:{}
+        },{
+          label:'所属平台',
+          prop:'channelName',
+          component:'by-input',
+          compConfig:{}
+        },{
+          label:'同步发货',
+          prop:'enableSyncSend',
+          component:'by-input',
+          compConfig:{}
+        },{
+          label:'创建时间',
+          prop:'createTime',
+          component:'by-input',
+          compConfig:{}
+        }]
+      ]
+    },
+    tool:{
+      tools:{
+        add:true,
+        delete:true,
+        search:true,
+        refresh:true
+      }
+    },
+    table:{
+      attr:{
+        size:'mini',
+        seq:true,
+        align:'center',
+        checkbox:true
+      },
+      columns:[{
+        title:'店铺名称',
+        field:'shopName',
+        width:150
+      },{
+        title:'店铺简称',
+        field:'shortName',
+        width:150
+      },{
+        title:'店铺分组',
+        field:'shopGroup',
+        width:150
+      },{
+        title:'店铺网址',
+        field:'shopUrl',
+        width:150
+      },{
+        title:'店铺站点',
+        field:'shopSite',
+        width:150
+      },{
+        title:'公司编号',
+        field:'companyCode',
+        width:150
+      },{
+        title:'所属平台',
+        field:'channelName',
+        width:150
+      },{
+        title:'平台店铺名称',
+        field:'channelShopName',
+        width:150
+      },{
+        title:'授权账户',
+        field:'authAccount',
+        width:150
+      },{
+        title:'授权状态',
+        field:'authStatus',
+        width:150
+      },{
+        title:'授权开始时间',
+        field:'authBegin',
+        width:150
+      },{
+        title:'授权过期时间',
+        field:'authExpired',
+        width:150
+      },{
+        title:'授权修改时间',
+        field:'authModified',
+        width:150
+      },{
+        title:'店铺状态',
+        field:'shopStatus',
+        width:150
+      },{
+        title:'退款状态',
+        field:'refundStatus',
+        width:150
+      },{
+        title:'身份证',
+        field:'sendIdCard',
+        width:150
+      },{
+        title:'联系电话',
+        field:'sendPhone',
+        width:150
+      },{
+        title:'发货店址',
+        field:'sendAddress',
+        width:150
+      },{
+        title:'发货时效',
+        field:'sendTimeEffect',
+        width:150
+      },{
+        title:'退货手机号',
+        field:'returnPhone',
+        width:150
+      },{
+        title:'退货人',
+        field:'returnName',
+        width:150
+      },{
+        title:'退货地址',
+        field:'returnAdress',
+        width:150
+      },{
+        title:'同步发货',
+        field:'enableSyncSend',
+        width:150
+      },{
+        title:'揽收轨迹同步发货',
+        field:'enableTrackSyncSend',
+        width:150
+      },{
+        title:'拆分订单整单发货',
+        field:'enableSplitOrderFullSend',
+        width:150
+      },{
+        title:'同步库存',
+        field:'enableSynvStore',
+        width:150
+      },{
+        title:'订单下载',
+        field:'enableSyncOrder',
+        width:150
+      },{
+        title:'天猫物流升级',
+        field:'enableTmallLogistics',
+        width:150
+      },{
+        title:'下载截止时间',
+        field:'endPullTime',
+        width:150
+      },{
+        title:'最晚截单时间',
+        field:'endInterceptTime',
+        width:150
+      },{
+        title:'最晚出库时间',
+        field:'endDeliveryTime',
+        width:150
+      },{
+        title:'淘宝消息通知',
+        field:'enableTaobaoMessageNotice',
+        width:150
+      },{
+        title:'商品下载',
+        field:'enableSkuDownload',
+        width:150
+      },{
+        title:'开启链接库存同步',
+        field:'enableLinkSync',
+        width:150
+      },{
+        title:'是否虾皮SIP',
+        field:'shopeeSip',
+        width:150
+      },{
+        title:'支付宝授权状态',
+        field:'alipayAuthStatus',
+        width:150
+      },{
+        title:'京东授权状态',
+        field:'jdAuthStatus',
+        width:150
+      },{
+        title:'东账号拒绝申请原因',
+        field:'jdRejectReason',
+        width:150
+      },{
+        title:'启用分销',
+        field:'enableDistribution',
+        width:150
+      },{
+        title:'菜鸟(青龙)电子面单',
+        field:'enableCainiaoElectronicBill',
+        width:150
+      },{
+        title:'售后单下载',
+        field:'enableSyncAfterSale',
+        width:150
+      },{
+        title:'开通AG',
+        field:'enableAg',
+        width:150
+      },{
+        title:'确认收货自动退款',
+        field:'enableAutoRefund',
+        width:150
+      },{
+        title:'开启跨境操作',
+        field:'enableCbec',
+        width:150
+      },{
+        title:'创建来源',
+        field:'createSource',
+        width:150
+      },{
+        title:'标签',
+        field:'labels',
+        width:150
+      },{
+        title:'服务市场订购版本',
+        field:'subscriptionVersion',
+        width:150
+      },{
+        title:'创建时间',
+        field:'createTime',
+        width:150
+      }]
+    },
+    request:{
+      url:'/omsOrder/omsShop/save'
+    }
+  }
+  mounted(){
+    this.$nextTick(()=>{
+      this.getList()
+    })
+  }
+  pagination(){
+    this.getList();
+  }
+  getList(){
+    if(!this.$refs.view){
+      if(this.timeNum > 5){
+        return
+      }
+      setTimeout(()=>{
+        this.getList()
+      },500) 
+      this.timeNum ++;
+      return
+    }
+    let data = (this.$refs.view as any).getQuery();
+    this.load = true;
+    query(data).then((res:any) => {
+      this.load = false;
+      (this.$refs.view as any).setTableValue(res.data.records);
+      let page = {
+        pageNo: res.data.current, //当前页
+        pageSize: res.data.size, //每页条数
+        total: res.data.total //总条数
+      };
+      (this.$refs.view as any).setPage(page)
+
+    }).catch(()=>{
+      this.load = false;
+    })
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.shop{
+  width: 100%;
+  height: 100%;
 }
-</script>
+</style>