소스 검색

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

AlanWong 1 년 전
부모
커밋
922e8f126f

+ 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(){

+ 3 - 3
src/benyun/components/byForm/byForm.vue

@@ -19,7 +19,7 @@
     :inline-message="true" 
     v-bind="$attrs" 
     :disabled="attrs.disabled"
-    :label-width="attrs.labelWidth"
+    :label-width="attrs.labelWidth?attrs.labelWidth:'100px'"
     :rules="attrs.readonly?{}:attrs.rules"
     :label-position="attrs.labelPosition ? attrs.labelPosition : ''">
       <el-row class="form-row" v-for="(itemChild,index) of columns" :key="index">
@@ -31,7 +31,7 @@
             :required="item.required"
             :error="item.error"
             :size="item.size"
-            :label-width="item.labelWidth?item.labelWidth:'100px'">
+            :label-width="item.labelWidth">
             <component v-bind:is="item.component" 
               class="form-comp"
               :propConfig="item.compConfig" 
@@ -82,7 +82,7 @@
         component:''   //组件
         compConfig:{}  //组件配置
         slot:true/false  //插槽
-        colspan:‘’  //在itemCount的基础上 列的数量(desc的时候用)
+        colspan:''  //在itemCount的基础上 列的数量(desc的时候用)
         descSlot:true/false  //插槽(desc的时候用)
     }]]
     request:{

+ 47 - 0
src/benyun/components/bySwitch/bySwitch.vue

@@ -0,0 +1,47 @@
+<template>
+  <el-switch
+    v-model="value"
+    :active-color="attrs.activeColor"
+    :inactive-color="attrs.inactiveColor"
+    :disabled="attrs.disabled"
+    :width="attrs.width"
+    :active-text="attrs.activeText"
+    :inactive-text="attts.inactiveText"
+    :active-value="attrs.activeValue"
+    :inactive-value="attrs.inactiveValue"
+    @change="change"
+    >
+  </el-switch>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import VueViews from '@/benyun/compVue/VueViews';
+
+@Component
+export default class BySwitch extends VueViews {
+  value:any=null
+  created(){
+    if(this.propConfig){
+      this.setConfig(this.propConfig)
+    }
+  }
+  setValue(v:any){
+    this.value = v;
+  }
+  getValue(){
+    return this.value;
+  }
+  // 清空数据
+  clearValue(){
+    this.value = null
+  }
+  change(v:any){
+    this.$emit('onChange',v);
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 1 - 1
src/benyun/components/byTool/byTool.vue

@@ -51,7 +51,7 @@ export default class GmTools extends Vue {
     { name: '新增', icon: 'el-icon-plus', clickName: 'onAdd', _class: 'add' },
 		{ name: '保存', icon: 'el-icon-plus', clickName: 'onSave', _class: 'save' },
     { name: '提交', icon: 'el-icon-finished', clickName: 'onSmt', _class: 'smt' },
-    { name: '反提交', icon: 'el-icon-finished', clickName: 'onReturnSmt', _class: 'returnSmt' },
+    { name: '反提交', icon: 'el-icon-refresh-left', clickName: 'onReturnSmt', _class: 'returnSmt' },
     { name: '接单', icon: 'el-icon-sold-out', clickName: 'onOrder', _class: 'order' },
     { name: '派单', icon: 'el-icon-sell', clickName: 'onDispatch', _class: 'dispatch' },
     { name: '修改', icon: 'el-icon-edit', clickName: 'onUpdate', _class: 'edit' },

+ 90 - 3
src/benyun/components/moduleView/moduleView.vue

@@ -1,13 +1,14 @@
 <template>
   <div class="module-view" 
+    :style="{height:attrs.calculateH?'100%':'auto'}"
     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>
@@ -22,6 +23,16 @@
         <by-table :propConfig="tableConfig" :ref="tableID" @pagination="paginationChange" @detail="detail" @onChangeRow="onChangeRow" />
       </div>
     </div>
+    <transition name="el-zoom-in-center" v-if="modalConfig">
+      <div class="view-modal" v-show="modalShow">
+        <div class="tool-box" v-if="modalConfig.tool">
+          <by-tool :propConfig="modalConfig.tool" @clickHandle="modalHandle" />
+        </div>
+        <div class="view-form">
+          <by-form :propConfig="modalConfig.form"></by-form>
+        </div>
+      </div>
+    </transition>
   </div>
 </template>
 
@@ -35,7 +46,10 @@ interface Page{
 }
 @Component
 export default class ModuleView extends ModuleViewHandle {
-  
+  modalShow=false;
+  get attrs(){
+    return this.config.attr ? this.config.attr : {};
+  }
   //搜索配置
   get searchConfig(){
     return this.config?.search ? this.config.search : null;
@@ -51,6 +65,13 @@ export default class ModuleView extends ModuleViewHandle {
     return this.config?.table ? this.config.table : null
   }
 
+  //弹窗
+  get modalConfig(){
+    return this.config.modal ? this.config.modal : null
+  }
+
+  calculateCount=0;
+
   created(){
     if(this.propConfig){
       this.setConfig(this.propConfig)
@@ -58,6 +79,39 @@ export default class ModuleView extends ModuleViewHandle {
   }
   mounted(){
     // this.getList() 
+    this.$nextTick(()=>{
+      if(this.attrs.calculateH){
+        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 + 8;
+    }
+    if(this.$refs[this.toolID]){
+      tHeight = (this.$refs[this.toolID] as any).$el.offsetHeight + 16;
+    }
+    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,12 +128,28 @@ export default class ModuleView extends ModuleViewHandle {
     this.resertHandle()
   }
   clickHandle(e:string){
+    if(e == 'toggleSearch'){
+      this.calculateCount=0;
+      this.initTable()
+    }
+    if(e == 'onAdd'){
+      this.modalShow = true;
+    }
     if((this as any)[e]){
       (this as any)[e]()
     }else{
       this.$emit('clickHandle',e)
     }
   }
+  //弹窗工具栏
+  modalHandle(e:string){
+    if(e == 'onReturn'){
+      this.modalShow = false;
+    }else{
+      this.$emit('modalHandle',e)
+    }
+    
+  }
   getSelectData(){
     let data:Array<any>=[];
     if(this.$refs[this.tableID]){
@@ -128,6 +198,23 @@ export default class ModuleView extends ModuleViewHandle {
   width: 100%;
   box-sizing: border-box;
   padding:  16px;
+  position: relative;
+  .view-modal{
+    height: 100%;
+    width: 100%;
+    position: absolute;
+    left: 0;
+    top: 0;
+    box-sizing: border-box;
+    padding: 16px;
+    background-color: #FFF;
+    z-index: 999;
+    .view-form{
+      width: 100%;
+      height: calc(100% - 48px);
+      overflow-y: auto;
+    }
+  }
   .search{
     width: 100%;
     padding-bottom: 8px;

+ 4 - 0
src/benyun/plugins/componentRegister.ts

@@ -47,6 +47,10 @@ const comps: Array<ComBase> = [
     name: "sideTree",
     component: () => import("@/benyun/components/sideTree/sideTree.vue"),
   },
+  {
+    name: "bySwitch",
+    component: () => import("@/benyun/components/bySwitch/bySwitch.vue"),
+  },
 ];
 
 const install = function (Vue: any) {

+ 31 - 0
src/views/oms/shop/components/tag.vue

@@ -0,0 +1,31 @@
+<template>
+  <el-tag type="success" v-if="value == 'Authorized'">已授权</el-tag>
+  <el-tag type="danger" v-else-if="value == 'Unauthorized'">未授权</el-tag>
+  <el-tag type="info" v-else-if="value == 'Expired'">已过期</el-tag>
+  <span v-else></span>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class ShopTag extends Vue {
+  value:any=null;
+
+  @Prop()
+  propConfig: any
+
+  @Prop()
+  propValue?:any
+
+  @Prop()
+  parentValue:any
+
+  setValue(v:any){
+    this.value = v;
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

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

@@ -1,9 +1,575 @@
 <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'
+import shopTag from './components/tag.vue'
+@Component({components:{}})
+export default class Shop extends Vue {
+  load=false;
+  time:any;
+  timeNum = 0;
+  config:any={
+    attr:{
+      calculateH:true
+    },
+    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
+      }]
+    },
+    modal:{
+      tool:{
+        tools:{
+          return:true,
+          save:true
+        }
+      },
+      form:{
+        attr:{
+          size:'small',
+          labelWidth:'130px'
+        },
+        columns:[
+          [{
+            label:'店铺编号',
+            prop:'shopId',
+            component:'by-input',
+          },{
+            label:'店铺名称',
+            prop:'shopName',
+            component:'by-input',
+          },{
+            label:'店铺简称',
+            prop:'shortName',
+            component:'by-input',
+          },{
+            label:'店铺分组',
+            prop:'shopGroup',
+            component:'by-input',
+          }],
+          [{
+            label:'店铺网址',
+            prop:'shopUrl',
+            component:'by-input',
+          },{
+            label:'店铺站点',
+            prop:'shopSite',
+            component:'by-input',
+          },{
+            label:'公司编号',
+            prop:'companyCode',
+            component:'by-input',
+          },{
+            label:'所属平台',
+            prop:'channelName',
+            component:'by-input',
+          }],
+          [{
+            label:'平台类型',
+            prop:'channel',
+            component:'by-input'
+          },{
+            label:'平台店铺名称',
+            prop:'channelShopName',
+            component:'by-input'
+          },{
+            label:'授权账号',
+            prop:'authAccount',
+            component:'by-input'
+          },{
+            label:'授权状态',
+            prop:'authStatus',
+            component:shopTag
+          }],
+          [{
+            label:'APP KEY',
+            prop:'appKey',
+            component:'by-input'
+          },{
+            label:'APP SECRET',
+            prop:'appSecret',
+            component:'by-input'
+          },{
+            label:'ACCESSTOKEN',
+            prop:'accessToken',
+            component:'by-input'
+          },{
+            label:'REFRESHTOKEN',
+            prop:'refreshToken',
+            component:'by-input'
+          }],
+          [{
+            label:'会话用户编号',
+            prop:'sessionUid',
+            component:'by-input'
+          },{
+            label:'授权开始时间',
+            prop:'authBegin',
+            component:'by-date-picker'
+          },{
+            label:'授权过期时间',
+            prop:'authExpired',
+            component:'by-date-picker'
+          },{
+            label:'授权修改时间',
+            prop:'authModified',
+            component:'by-date-picker'
+          }],
+          [{
+            label:'店铺状态',
+            prop:'shopStatus',
+            component:'by-input'
+          },{
+            label:'退款状态',
+            prop:'refundStatus',
+            component:'by-input'
+          },{
+            label:'身份证号',
+            prop:'sendIdCard',
+            component:'by-input'
+          },{
+            label:'联系电话',
+            prop:'sendPhone',
+            component:'by-input'
+          }],
+          [{
+            label:'发货地址',
+            prop:'sendTimeEffect',
+            component:'by-input'
+          },{
+            label:'标签',
+            prop:'labels',
+            component:'by-input'
+          },{
+            span:12,
+            label:'发货地址',
+            prop:'sendAddress',
+            component:'by-input'
+          }],
+          [{
+            label:'服务市场订购版本',
+            prop:'subscriptionVersion',
+            component:'by-input'
+          },{
+            label:'退货手机',
+            prop:'returnPhone',
+            component:'by-input'
+          },{
+            label:'退货人',
+            prop:'returnName',
+            component:'by-input'
+          },{
+            label:'退货邮编',
+            prop:'returnZip',
+            component:'by-input'
+          }],
+          [{
+            label:'同步发货',
+            prop:'enableSyncSend',
+            component:'by-input'
+          },{
+            label:'揽收轨迹同步发货',
+            prop:'enableTrackSyncSend',
+            component:'by-input'
+          },{
+            span:12,
+            label:'退货地址',
+            prop:'returnAdress',
+            component:'by-input'
+          }],
+          [{
+            label:'拆分订单整单发货',
+            prop:'enableSplitOrderFullSend',
+            component:'by-input'
+          },{
+            label:'同步库存',
+            prop:'enableSynvStore',
+            component:'by-input'
+          },{
+            label:'订单下载',
+            prop:'enableSyncOrder',
+            component:'by-input'
+          },{
+            label:'天猫物流升级',
+            prop:'enableTmallLogistics',
+            component:'by-input'
+          }],
+          [{
+            label:'下载截止时间',
+            prop:'endPullTime',
+            component:'by-date-picker'
+          },{
+            label:'最晚截单时间',
+            prop:'endInterceptTime',
+            component:'by-date-picker'
+          },{
+            label:'最晚出库时间',
+            prop:'endDeliveryTime',
+            component:'by-date-picker'
+          },{
+            label:'淘宝消息通知',
+            prop:'enableTaobaoMessageNotice',
+            component:'by-input'
+          }],
+          [{
+            label:'商品下载',
+            prop:'enableSkuDownload',
+            component:'by-input'
+          },{
+            label:'开启链接库存同步',
+            prop:'enableLinkSync',
+            component:'by-input'
+          },{
+            label:'是否虾皮SIP',
+            prop:'shopeeSip',
+            component:'by-input'
+          },{
+            label:'支付宝授权状态',
+            prop:'alipayAuthStatus',
+            component:'by-input'
+          }],
+          [{
+            label:'京东授权状态',
+            prop:'jdAuthStatus',
+            component:'by-input'
+          },{
+            label:'京东拒绝申请原因',
+            prop:'jdRejectReason',
+            component:'by-input'
+          },{
+            label:'启用分销',
+            prop:'enableDistribution',
+            component:'by-input'
+          },{
+            label:'菜鸟电子面单',
+            prop:'enableCainiaoElectronicBill',
+            component:'by-input'
+          }],
+          [{
+            label:'售后单下载',
+            prop:'enableSyncAfterSale',
+            component:'by-input'
+          },{
+            label:'开通AG',
+            prop:'enableAg',
+            component:'by-input'
+          },{
+            label:'确认收货自动退款',
+            prop:'enableAutoRefund',
+            component:'by-input'
+          },{
+            label:'开启跨境操作',
+            prop:'enableCbec',
+            component:'by-input'
+          }]
+        ]
+      }
+    },
+    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>