소스 검색

店铺管理

ymy 1 년 전
부모
커밋
e3545cb37e

+ 46 - 1
src/api/shop.ts

@@ -21,7 +21,16 @@ export function save(data:any) {
 //修改数据
 export function update(data:any) {
 	return request({
-		url: '/omsOrder/omsShop/update',
+		url: '/omsOrder/shop/update',
+		method: 'POST',
+		data:data
+	})
+}
+
+//点三店铺列表查询
+export function dian3ShopQuery(data:any) {
+	return request({
+		url: '/omsOrder/shop/query',
 		method: 'POST',
 		data:data
 	})
@@ -34,4 +43,40 @@ export function del(data:any) {
 		method: 'POST',
 		params:data
 	})
+}
+
+//店铺授权
+export function shopAuth(data:any) {
+	return request({
+		url: '/omsOrder/shop/auth',
+		method: 'GET',
+		params:data
+	})
+}
+
+//授权签名
+export function shopSign(data:any) {
+	return request({
+		url: '/omsOrder/shop/buildSign',
+		method: 'POST',
+		params:data
+	})
+}
+
+//修改授权状态
+export function shopState(data:any) {
+	return request({
+		url: '/omsOrder/shop/edit',
+		method: 'POST',
+		data:data
+	})
+}
+
+//通过点3授权成功回调店铺id新增店铺
+export function shopAdd(data:any) {
+	return request({
+		url: '/omsOrder/shop/add',
+		method: 'POST',
+		params:data
+	})
 }

+ 5 - 0
src/router/index.ts

@@ -65,6 +65,11 @@ export const constantRoutes: Array<any> = [
     name:'Order',
     component:() => import('@/views/demo/order/order.vue')
   },
+  {
+    path:'/shopAuto',
+    name:'ShopAuto',
+    component:() => import('@/views/oms/shop/shopAuto.vue')
+  },
   {
     path:'/demo',
     name:'Demo',

+ 1 - 1
src/views/oms/B2BOrder/components/addOrder.vue

@@ -191,7 +191,7 @@
       <div class="btn">
         <el-button type="primary" size="small" v-if="!orderValue.id" @click="btn('continue')">确定并继续</el-button>
         <el-button type="primary" size="small" v-if="!orderValue.id" @click="btn">确定</el-button>
-        <el-button icon="el-icon-edit-outline" circle v-if="orderValue.id" @click="logShow"></el-button>
+        <el-button v-if="orderValue.id" @click="logShow">日志</el-button>
       </div>
     </template>
     

+ 1 - 1
src/views/oms/B2BOrder/components/updateRmkModal.vue

@@ -79,7 +79,7 @@ export default class UpdateRmkModal extends Vue {
       }).catch(()=>{
         this.load = false;
       })
-    })
+    }).catch(()=>{})
   }
 }
 </script>

+ 1 - 1
src/views/oms/B2COrder/components/addOrder.vue

@@ -181,7 +181,7 @@
       <div class="btn">
         <el-button type="primary" size="small" v-if="!orderValue.id" @click="btn('continue')">确定并继续</el-button>
         <el-button type="primary" size="small" v-if="!orderValue.id" @click="btn">确定</el-button>
-        <el-button icon="el-icon-edit-outline" circle v-if="orderValue.id" @click="logShow"></el-button>
+        <el-button v-if="orderValue.id" @click="logShow">日志</el-button>
       </div>
     </template>
     

+ 1 - 1
src/views/oms/B2COrder/components/updateRmkModal.vue

@@ -79,7 +79,7 @@ export default class UpdateRmkModal extends Vue {
       }).catch(()=>{
         this.load = false;
       })
-    })
+    }).catch(()=>{})
   }
 }
 </script>

+ 6 - 1
src/views/oms/distributionAd/components/orderList.vue

@@ -32,7 +32,12 @@ export default class ProductList extends Vue {
           field: 'rawSourceId',
         },
         {
-          width: 140,
+          title: '订单类型',
+          field: 'businessType',
+          width:100,
+        },
+        {
+          width: 100,
           title: '审核状态',
           field: 'isSubmitted',
           component:'textChange',

+ 3 - 3
src/views/oms/distributionAd/index.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="distributionAd">
     <el-tabs v-model="activeName">
-      <el-tab-pane label="分销用户" name="1">
+      <!-- <el-tab-pane label="分销用户" name="1">
         <userRank v-if="activeName == '1'"  />
-      </el-tab-pane>
+      </el-tab-pane> -->
       <el-tab-pane label="分销员余额" name="2">
         <userBalanceList v-if="activeName == '2'"  />
       </el-tab-pane>
@@ -33,7 +33,7 @@ import orderList from './components/orderList.vue'
 import ProductList from "./components/productList.vue";
 @Component({components:{DistributionDevel,userRank,userBalanceList,InfluenceList,orderList,ProductList}})
 export default class DistributionAd extends Vue {
-  activeName:string='1'
+  activeName:string='2'
 }
 </script>
 

+ 138 - 0
src/views/oms/shop/components/autoShopModal.vue

@@ -0,0 +1,138 @@
+<template>
+  <vxe-modal v-model="value" id="autoShopModal" width="450" v-loading="load" @show="show" @hide="hide" height="260" show-footer title="店铺授权">
+    <by-form :propConfig="config" ref="form"></by-form>
+    <template #footer>
+      <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+        <el-button type="primary" size="small" @click="btn">确定</el-button>
+      </div>
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { updateRemark } from '@/api/omsOrder'
+import { query,save,update,del,dian3ShopQuery,shopAuth,shopSign } from '@/api/shop'
+@Component({components:{}})
+export default class UpdateRmkModal extends Vue {
+  value=false;
+  load=false;
+  billValue:Array<any>=[];
+  config:any={
+    attr:{
+      labelWidth:'120px',
+      rules:{
+        posPlatform: [
+          { required: true, message: '店铺平台类型不能为空!', trigger: 'blur' }
+        ]
+      }
+    },
+    columns:[
+      [{
+        label:'店铺平台类型',
+        prop:'posPlatform',
+        component:'by-select',
+        compConfig:{
+          attr:{
+            clearable:true,
+            data:[{
+              value:'TB',
+              label:'淘宝'
+            },{
+              value:'JD',
+              label:'京东'
+            },{
+              value:'PDD',
+              label:'拼多多'
+            },{
+              value:'WPH',
+              label:'唯品会'
+            },{
+              value:'YZ',
+              label:'有赞'
+            },{
+              value:'DY',
+              label:'抖音'
+            },{
+              value:'KS',
+              label:'快手'
+            },{
+              value:'SN',
+              label:'苏宁'
+            },{
+              value:'ALI',
+              label:'阿里巴巴'
+            },{
+              value:'GM',
+              label:'国美'
+            },{
+              value:'MEITUAN',
+              label:'美团'
+            },{
+              value:'XIAOMI',
+              label:'小米'
+            },{
+              value:'ELE',
+              label:'饿了么'
+            },{
+              value:'WM',
+              label:'微盟'
+            },{
+              value:'HW',
+              label:'华为'
+            },{
+              value:'XHS',
+              label:'小红书'
+            },{
+              value:'WD',
+              label:'微店'
+            },{
+              value:'WX',
+              label:'微信'
+            },{
+              value:'SELF',
+              label:'自有'
+            }]
+          }
+        }
+      }]
+    ]
+  }
+  setShow(v:boolean){
+    this.value = v;
+  }
+  setBillValue(data:Array<any>){
+    this.billValue = data;
+  }
+  show(){}
+  hide(){
+    (this.$refs.form as any).clearValidate();
+    (this.$refs.form as any).clearValue();
+  }
+  btn(){
+    (this.$refs.form as any).validate().then(()=>{
+      let data = (this.$refs.form as any).getValue();
+      let url = encodeURIComponent(window.location.origin + '/shopAuto');
+      this.load = true
+      shopAuth({
+        platformType:data.posPlatform,
+        url:url
+      }).then((res:any)=>{
+        this.load = false;
+        this.value=false;
+        if(res.msg){
+          (window as any).location.href=res.msg
+          // (window as any).open(res.msg)
+          
+        }
+      }).catch(()=>{})
+
+    }).catch(()=>{})
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 412 - 328
src/views/oms/shop/index.vue

@@ -2,14 +2,17 @@
   <div class="shop">
     <module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @modalHandle="modalHandle" @onRefresh="getList" 
     @resert="queryList" @search="queryList" @clickHandle="clickHandle" @detail="detail" />
+    <autoShopModal ref="autoShopModal" />
   </div>
 </template>
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-import { query,save,update,del } from '@/api/shop'
+import { query,save,update,del,dian3ShopQuery,shopAuth,shopSign } from '@/api/shop'
+import autoShopModal from './components/autoShopModal.vue'
+import axios from 'axios'
 import shopTag from './components/tag.vue'
-@Component({components:{}})
+@Component({components:{autoShopModal}})
 export default class Shop extends Vue {
   load=false;
   time:any;
@@ -114,11 +117,18 @@ export default class Shop extends Vue {
     // },
     tool:{
       tools:{
-        add:true,
+        // add:true,
         // delete:true,
-        search:true,
+        // search:true,
         refresh:true
-      }
+      },
+      customTools:[
+        { name: '店铺授权', event:{
+          click:() =>{
+            (this.$refs.autoShopModal as any).setShow(true);
+          }
+        }},
+      ]
     },
     table:{
       attr:{
@@ -128,339 +138,396 @@ export default class Shop extends Vue {
         // checkbox:true
       },
       columns:[{
-        title:'店铺名称',
-        field:'posName',
-        isDetail:true,
-        width:150
+        title:'店铺ID',
+        field:'shopId',
       },{
-        title:'店铺code',
-        field:'posCode',
-        width:150
+        title:'平台',
+        field:'platformType',
       },{
-        title:'店铺类型',
-        field:'posType',
-        width:150
-      },{
-        title:'店铺平台类型',
-        field:'posPlatform',
-        width:150
-      },
-      {
-        title:'店铺子平台类型',
-        field:'posPlatformType',
-        width:150
+        title:'平台用户昵称',
+        field:'userNick',
       },{
-        title:'店铺状态',
-        field:'posStatus',
-        width:150
-      },{
-        title:'子平台名称',
-        field:'channelShopName',
-        width:150
-      },
-      // {
-      //   title:'授权账户',
-      //   field:'authAccount',
-      //   width:150
-      // },
-      {
-        title:'授权状态',
-        field:'authStatus',
-        width:150,
-        component:shopTag
-      },
-      {
-        title:'联系人',
-        field:'authBegin',
-        width:150
+        title:'授权过期时间',
+        field:'expireDate',
       },{
-        title:'联系电话',
-        field:'authExpired',
-        width:150
-      },
-      {
-        title:'操作',
-        action:true,
-        width:100,
-        plugins:[{
-          name:'删除',
-          event:{
-            click:(item:any) => {
-              this.del(item);
-            }
-          }
-        }]
+        title:'刷新授权过期',
+        field:'refreshExpiresTime',
       }
+      // {
+      //   title:'操作',
+      //   action:true,
+      //   width:100,
+      //   plugins:[{
+      //     name:'店铺授权',
+      //     show:(item:any) =>{
+      //       return item.authStatus !== '2'
+      //     },
+      //     event:{
+      //       click:(item:any) => {
+      //         this.shopAuto(item);
+      //       }
+      //     }
+      //   }]
+      // }
     ]
     },
-    modal:{
-      tool:{
-        tools:{
-          return:true,
-          add:true
-        }
-      },
-      form:{
-        attr:{
-          size:'small',
-          width:'1200px',
-          labelWidth:'130px',
-          rules:{
-            posName:[
-              { required: true, message: '请输入店铺名称', trigger: 'blur' }
-            ],
-            posCode:[
-              { required: true, message: '请输入店铺编号', trigger: 'blur' }
-            ],
-            posPlatform:[
-              {required: true, message: '请选择店铺平台类型', trigger: 'change'}
-            ],
-            posPlatformType:[
-              { required: true, message: '请选择店铺子平台类型', trigger: 'change' }
-            ],
-            posType:[
-              { required: true, message: '请选择店铺类型', trigger: 'change' }
-            ],
-            posStatus:[
-              { required: true, message: '请选择店铺状态', trigger: 'change' }
-            ],
-            name:[
-              { required: true, message: '请输入联系人姓名', trigger: 'blur' }
-            ],
-            mobile:[
-              { required: true, message: '请输入联系人手机', trigger: 'blur' }
-            ],
-            province:[
-              { required: true, message: '请选择地址', trigger: 'change' }
-            ],
-            address:[
-              { required: true, message: '请输入详细地址', trigger: 'blur' }
-            ],
-          }
-        },
-        columns:[
-          [{
-            label:'店铺编号',
-            prop:'posCode',
-            component:'by-input',
-          },{
-            label:'店铺名称',
-            prop:'posName',
-            component:'by-input',
-          }],
-          [{
-            label:'店铺平台类型',
-            prop:'posPlatform',
-            component:'by-select',
-            compConfig:{
-              attr:{
-                clearable:true,
-                data:[{
-                  value:'TB',
-                  label:'淘宝'
-                },{
-                  value:'JD',
-                  label:'京东'
-                },{
-                  value:'PDD',
-                  label:'拼多多'
-                },{
-                  value:'WPH',
-                  label:'唯品会'
-                },{
-                  value:'YZ',
-                  label:'有赞'
-                },{
-                  value:'DY',
-                  label:'抖音'
-                },{
-                  value:'KS',
-                  label:'快手'
-                },{
-                  value:'SN',
-                  label:'苏宁'
-                },{
-                  value:'ALI',
-                  label:'阿里巴巴'
-                },{
-                  value:'GM',
-                  label:'国美'
-                },{
-                  value:'MEITUAN',
-                  label:'美团'
-                },{
-                  value:'XIAOMI',
-                  label:'小米'
-                },{
-                  value:'ELE',
-                  label:'饿了么'
-                },{
-                  value:'WM',
-                  label:'微盟'
-                },{
-                  value:'HW',
-                  label:'华为'
-                },{
-                  value:'XHS',
-                  label:'小红书'
-                },{
-                  value:'WD',
-                  label:'微店'
-                },{
-                  value:'WX',
-                  label:'微信'
-                },{
-                  value:'SELF',
-                  label:'自有'
-                }]
-              }
-            }
-          },{
-            label:'店铺子平台类型',
-            prop:'posPlatformType',
-            component:'by-select',
-            compConfig:{
-              attr:{
-                clearable:true,
-                data:[{
-                  value:'TB',
-                  label:'淘宝'
-                },{
-                  value:'TMALL',
-                  label:'天猫'
-                },{
-                  value:'JD',
-                  label:'京东pop店'
-                },{
-                  value:'PDD',
-                  label:'拼多多三方店'
-                },{
-                  value:'MP',
-                  label:'唯品会MP'
-                },{
-                  value:'YZ',
-                  label:'有赞'
-                },{
-                  value:'DY',
-                  label:'抖音小店'
-                },{
-                  value:'KS',
-                  label:'快手小店'
-                },{
-                  value:'DPS',
-                  label:'京东厂送'
-                },{
-                  value:'KTT',
-                  label:'拼多多快团团'
-                },{
-                  value:'SN',
-                  label:'苏宁厂送'
-                },{
-                  value:'YOUPIN',
-                  label:'小米有品'
-                },{
-                  value:'WM',
-                  label:'微盟微商城'
-                },{
-                  value:'WM_ZHLS',
-                  label:'微盟-智慧零售'
-                },{
-                  value:'HW_MALL',
-                  label:'华为商城'
-                },{
-                  value:'XHS',
-                  label:'小红书'
-                },{
-                  value:'WD',
-                  label:'微店'
-                },{
-                  value:'SELF',
-                  label:'自有'
-                }]
-              }
-            }
-          }],
-          [{
-            label:'店铺类型',
-            prop:'posType',
-            component:'by-select',
-            compConfig:{
-              attr:{
-                clearable:true,
-                data:[{
-                  value:'ONLINE_SALE',
-                  label:'线上网销零售'
-                },{
-                  value:'ONLINE_DISTRIBUTION',
-                  label:'线上分销'
-                },{
-                  value:'OFFLINE_WHOLESALE',
-                  label:'线下批发'
-                },{
-                  value:'OFFLINE_SALE',
-                  label:'线下门店零售'
-                },{
-                  value:'ONLINE_WHOLESALE',
-                  label:'线上批发'
-                }]
-              }
-            }
-          },{
-            label:'店铺状态',
-            prop:'posStatus',
-            component:'by-select',
-            compConfig:{
-              attr:{
-                clearable:true,
-                data:[{
-                  value:'VALID',
-                  label:'有效'
-                },{
-                  value:'INVALID',
-                  label:'禁用'
-                },{
-                  value:'DELETED',
-                  label:'删除'
-                }]
-              }
-            }
-          }],
-          [{
-            label:'联系人姓名',
-            prop:'name',
-            component:'by-input',
-          },{
-            label:'联系人手机',
-            prop:'mobile',
-            component:'by-input',
-          }],
-          [{
-            label:'地址',
-            prop:'province',
-            component:'by-area',
-            compConfig:{
-              attr:{
-                province:'province', //省
-                city:'city',   //市
-                county:'district',  //县/区
-                show:'county'
-              }
-            }
-          }],
-          [{
-            label:'详细地址',
-            prop:'address',
-            component:'by-input'
-          }]
-        ]
-      }
-    }
+    // modal:{
+    //   tool:{
+    //     tools:{
+    //       return:true,
+    //       // add:true
+    //     }
+    //   },
+    //   form:{
+    //     attr:{
+    //       showType:'desc',
+    //       itemCount:2,
+    //       size:'small',
+    //       width:'900px',
+    //       labelWidth:'130px',
+    //       rules:{
+    //         posName:[
+    //           { required: true, message: '请输入店铺名称', trigger: 'blur' }
+    //         ],
+    //         posCode:[
+    //           { required: true, message: '请输入店铺编码', trigger: 'blur' }
+    //         ],
+    //         posPlatform:[
+    //           {required: true, message: '请选择店铺平台类型', trigger: 'change'}
+    //         ],
+    //         posPlatformType:[
+    //           { required: true, message: '请选择店铺子平台类型', trigger: 'change' }
+    //         ],
+    //         posType:[
+    //           { required: true, message: '请选择店铺类型', trigger: 'change' }
+    //         ],
+    //         posStatus:[
+    //           { required: true, message: '请选择店铺状态', trigger: 'change' }
+    //         ],
+    //         name:[
+    //           { required: true, message: '请输入联系人姓名', trigger: 'blur' }
+    //         ],
+    //         mobile:[
+    //           { required: true, message: '请输入联系人手机', trigger: 'blur' },
+    //           {validator: this.validatePhone, trigger: 'blur' }
+    //         ],
+    //         province:[
+    //           { required: true, message: '请选择地址', trigger: 'change' }
+    //         ],
+    //         address:[
+    //           { required: true, message: '请输入详细地址', trigger: 'blur' }
+    //         ],
+    //       }
+    //     },
+    //     columns:[
+    //       [{
+    //         label:'店铺名称',
+    //         prop:'posName',
+    //         component:'by-input',
+    //       }],
+    //       [{
+    //         label:'店铺编码',
+    //         prop:'posCode',
+    //         component:'by-input',
+    //       },{
+    //         label:'店铺状态',
+    //         prop:'posStatus',
+    //         component:'by-select',
+    //         compConfig:{
+    //           attr:{
+    //             clearable:true,
+    //             defaultIndex:0,
+    //             data:[{
+    //               value:'VALID',
+    //               label:'有效'
+    //             },{
+    //               value:'INVALID',
+    //               label:'禁用'
+    //             },{
+    //               value:'DELETED',
+    //               label:'删除'
+    //             }]
+    //           }
+    //         }
+    //       }],
+    //       [{
+    //         label:'店铺平台类型',
+    //         prop:'posPlatform',
+    //         component:'by-select',
+    //         compConfig:{
+    //           attr:{
+    //             clearable:true,
+    //             data:[{
+    //               value:'TB',
+    //               label:'淘宝'
+    //             },{
+    //               value:'JD',
+    //               label:'京东'
+    //             },{
+    //               value:'PDD',
+    //               label:'拼多多'
+    //             },{
+    //               value:'WPH',
+    //               label:'唯品会'
+    //             },{
+    //               value:'YZ',
+    //               label:'有赞'
+    //             },{
+    //               value:'DY',
+    //               label:'抖音'
+    //             },{
+    //               value:'KS',
+    //               label:'快手'
+    //             },{
+    //               value:'SN',
+    //               label:'苏宁'
+    //             },{
+    //               value:'ALI',
+    //               label:'阿里巴巴'
+    //             },{
+    //               value:'GM',
+    //               label:'国美'
+    //             },{
+    //               value:'MEITUAN',
+    //               label:'美团'
+    //             },{
+    //               value:'XIAOMI',
+    //               label:'小米'
+    //             },{
+    //               value:'ELE',
+    //               label:'饿了么'
+    //             },{
+    //               value:'WM',
+    //               label:'微盟'
+    //             },{
+    //               value:'HW',
+    //               label:'华为'
+    //             },{
+    //               value:'XHS',
+    //               label:'小红书'
+    //             },{
+    //               value:'WD',
+    //               label:'微店'
+    //             },{
+    //               value:'WX',
+    //               label:'微信'
+    //             },{
+    //               value:'SELF',
+    //               label:'自有'
+    //             }]
+    //           }
+    //         }
+    //       },{
+    //         label:'店铺子平台类型',
+    //         prop:'posPlatformType',
+    //         component:'by-select',
+    //         compConfig:{
+    //           attr:{
+    //             clearable:true,
+    //             data:[{
+    //               value:'TB',
+    //               label:'淘宝'
+    //             },{
+    //               value:'TMALL',
+    //               label:'天猫'
+    //             },{
+    //               value:'JD',
+    //               label:'京东pop店'
+    //             },{
+    //               value:'PDD',
+    //               label:'拼多多三方店'
+    //             },{
+    //               value:'MP',
+    //               label:'唯品会MP'
+    //             },{
+    //               value:'YZ',
+    //               label:'有赞'
+    //             },{
+    //               value:'DY',
+    //               label:'抖音小店'
+    //             },{
+    //               value:'KS',
+    //               label:'快手小店'
+    //             },{
+    //               value:'DPS',
+    //               label:'京东厂送'
+    //             },{
+    //               value:'KTT',
+    //               label:'拼多多快团团'
+    //             },{
+    //               value:'SN',
+    //               label:'苏宁厂送'
+    //             },{
+    //               value:'YOUPIN',
+    //               label:'小米有品'
+    //             },{
+    //               value:'WM',
+    //               label:'微盟微商城'
+    //             },{
+    //               value:'WM_ZHLS',
+    //               label:'微盟-智慧零售'
+    //             },{
+    //               value:'HW_MALL',
+    //               label:'华为商城'
+    //             },{
+    //               value:'XHS',
+    //               label:'小红书'
+    //             },{
+    //               value:'WD',
+    //               label:'微店'
+    //             },{
+    //               value:'SELF',
+    //               label:'自有'
+    //             }]
+    //           }
+    //         }
+    //       }],
+    //       [{
+    //         label:'店铺类型',
+    //         prop:'posType',
+    //         component:'by-select',
+    //         compConfig:{
+    //           attr:{
+    //             clearable:true,
+    //             data:[{
+    //               value:'ONLINE_SALE',
+    //               label:'线上网销零售'
+    //             },{
+    //               value:'ONLINE_DISTRIBUTION',
+    //               label:'线上分销'
+    //             },{
+    //               value:'OFFLINE_WHOLESALE',
+    //               label:'线下批发'
+    //             },{
+    //               value:'OFFLINE_SALE',
+    //               label:'线下门店零售'
+    //             },{
+    //               value:'ONLINE_WHOLESALE',
+    //               label:'线上批发'
+    //             }]
+    //           }
+    //         }
+    //       },{
+    //         label:'联系人姓名',
+    //         prop:'name',
+    //         component:'by-input',
+    //       }],
+    //       [{
+    //         label:'固话',
+    //         prop:'phone',
+    //         component:'by-input',
+    //       },{
+    //         label:'联系人电话',
+    //         prop:'mobile',
+    //         component:'by-input',
+    //       }],
+    //       [{
+    //         label:'地址',
+    //         prop:'province',
+    //         component:'by-area',
+    //         compConfig:{
+    //           attr:{
+    //             province:'province', //省
+    //             provinceCode:'provinceCode',
+    //             city:'city',   //市
+    //             cityCode:'cityCode',
+    //             county:'district',  //县/区
+    //             countyCode:'districtCode',
+    //             show:'county'
+    //           }
+    //         }
+    //       }],
+    //       [{
+    //         label:'详细地址',
+    //         prop:'address',
+    //         component:'by-input'
+    //       }]
+    //     ]
+    //   }
+    // }
   }
   mounted(){
     this.$nextTick(()=>{
       this.getList()
     })
   }
+  validatePhone(rule:any, value:any, callback:any){
+    if (value) {
+      if(!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(value)) {
+        callback(new Error('手机号格式不正确!'));
+      }else{
+        callback();
+      }
+      
+    } else {
+      callback();
+    }
+  }
+  shopAuto(item:any){
+    let url = window.location.origin + '/shopAuto';
+    // let time = String(new Date().getTime());
+    // shopSign({
+    //   redirectUrl:url,
+    //   timestamp:time
+    // }).then((res:any) =>{
+    //   let jumpURL = 'https://d3.diansan.com/app-web/open/auth/third/add/store/' + item.posPlatform + '?appKey=221280&redirectUrl=' + url + '&timestamp=' + time + '&sign=' + res.msg;
+    //   (window as any).open(jumpURL);
+    // }).catch(()=>{})
+
+
+    let that:any = this;
+    shopAuth({
+      platformType:item.posPlatform,
+      url:url
+    }).then((res:any)=>{
+      if(res.msg){
+        (window as any).open(res.msg)
+        // let url = res.msg.replace('https://d3.diansan.com',process.env.VUE_APP_DIAN3)
+        // axios({
+        //   url:url,
+        //   method:'get',
+        //   headers:{
+        //     'Content-Type':'application/json;charset=utf-8'
+        //   }
+        // })
+        // .then(function (response:any) {
+        //   let res = response.data
+        //   if(res && res.code == '200' && res.success){
+        //     that.$message({
+        //       message:'操作成功!',
+        //       type:'success'
+        //     })
+        //     item.authStatus = '2';
+        //     that.onSave(item)
+        //   }else{
+        //     that.$message({
+        //       dangerouslyUseHTMLString: true,
+        //       message: res,
+        //       type:'error'
+        //     });
+        //   }
+        // })
+        // .catch(function (error) {
+        //   console.log(error);
+        // });
+      }
+      
+    }).catch(()=>{})
+  }
+  shopState(item:any,callBack:Function){
+    let codes:Array<any>=[];
+    let names:Array<any>=[];
+    codes.push(item.posCode);
+    names.push(item.posName);
+    dian3ShopQuery({
+      codes:codes,
+      names:names,
+      pageNo:1,
+      pageSize:10
+    }).then(res=>{
+      callBack(res);
+    }).catch(()=>{})
+  }
   //删除
   del(item:any){
     this.$confirm('此操作将永久删除店铺名称为 “'+item.shopName+'” 的数据, 是否继续?', '提示', {
@@ -528,9 +595,25 @@ export default class Shop extends Vue {
     })
   }
   //修改店铺数据
-  onSave(){
-    let data:any = (this.$refs.view as any).getFormValue();
-    
+  onSave(item?:any){
+    let data:any = item ? item : (this.$refs.view as any).getFormValue();
+    data.contact={
+      name:data.name,
+      mobile:data.mobile,
+      phone:data.phone,
+      province:data.province,
+      city:data.city,
+      district:data.district,
+      address:data.address
+    }
+    delete data.name;
+    delete data.mobile;
+    delete data.phone;
+    delete data.province;
+    delete data.city;
+    delete data.district;
+    delete data.address;
+
     this.load = true;
     update(data).then((res:any) => {
       this.$message({
@@ -543,6 +626,7 @@ export default class Shop extends Vue {
     }).catch(()=>{
       this.load = false;
     })
+    
   }
   //表单工具栏按钮事件
   modalHandle(n:string){

+ 103 - 0
src/views/oms/shop/shopAuto.vue

@@ -0,0 +1,103 @@
+<template>
+  <el-col>
+    <div class="loading" v-if="load">
+      <i class="el-icon-loading"></i>
+      <span>授权中...</span>
+    </div>
+    <template v-else>
+      <el-result icon="success" title="授权成功" :subTitle="value.platformType + ' - ' + value.refUserNick" v-if="autoState">
+        <template slot="extra">
+          <!-- <div class="time">刷新授权过期:{{ value.expiresTime }}</div>
+          <div class="time">授权过期时间:{{ value.reExpiresTime }}</div> -->
+          <el-button type="primary" size="medium" @click="back">返回</el-button>
+        </template>
+      </el-result>
+      <el-result v-else icon="warning" :title="title" :subTitle="errMsg">
+        <template slot="extra">
+          <el-button type="primary" size="medium" @click="back">返回</el-button>
+        </template>
+      </el-result>
+    </template>
+  </el-col>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { shopAdd } from '@/api/shop'
+import {getQueryObject} from '@/benyun/utils'
+@Component({components:{}})
+export default class ShopAuto extends Vue {
+  value:any={}
+  load=true
+  autoState=false
+  title='提示'
+  errMsg=''
+  mounted(){
+    this.$nextTick(()=>{
+      let parames=getQueryObject();
+      this.value = parames;
+      if(parames.id){
+        shopAdd({
+          shopId:parames.id,
+          platformType:parames.platformType,
+          nickname:parames.refUserNick,
+          userId:parames.refUserId,
+          expiresTime:parames.expiresTime,
+          refreshExpiresTime:parames.reExpiresTime
+        }).then(()=>{
+          this.autoState = true
+          this.load = false
+          this.$message({
+            message:'店铺授权成功!',
+            type:'success'
+          })
+        }).catch((res:any)=>{
+          this.title = '提示'
+          if(res.message){
+            this.errMsg = res.message
+          }else{
+            this.errMsg = '操作失败!'
+          }
+          
+          this.load = false
+        })
+      }else{
+        this.load = false
+        this.title = decodeURIComponent(parames.msg);
+        this.errMsg = decodeURIComponent(parames.subMsg);
+        this.errMsg = this.errMsg ? this.errMsg.replaceAll('+',''): this.errMsg;
+      }
+    })
+  }
+
+  back(){
+    this.$router.push({path:`/oms/shop`})
+    // let url = window.location.protocol + window.location.host + '/oms/shop'
+    // window.location.href = url
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.time{
+  font-size: 14px;
+  padding-bottom: 4px;
+}
+.loading{
+  text-align: center;
+  padding-top: 32px;
+  display: flex;
+  justify-content: center;
+  flex-direction: column;
+  align-items: center;
+  i{
+    font-size: 36px;
+  }
+  span{
+    // color: dodgerblue;
+    padding-left: 8px;
+    font-size: 14px;
+    padding-top: 8px;
+  }
+}
+</style>