huangmp 2 vuotta sitten
vanhempi
commit
ebbac8b826

+ 47 - 5
src/views/modules/sys/pset/home-page-popup-config.vue

@@ -11,6 +11,15 @@
       :rules="dataRule"
       :model="dataForm"
     >
+      <el-form-item label="关联店铺" style="width:640px" prop="shopId">
+        <el-select v-model="dataForm.shopId" placeholder="关联店铺" controls-position="right" @change="getInfo(dataForm.shopId)">
+          <el-option v-for="item in shopList"
+                     :key="item.shopId"
+                     :label="item.shopName"
+                     :value="item.shopId">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item :label="`${$t('sysManagement.popupName')}:`" style="width:640px" prop="popupName">
         <el-input v-model="dataForm.popupName" :placeholder="`${$t('sysManagement.popupName')}`" controls-position="right"></el-input>
       </el-form-item>
@@ -20,6 +29,9 @@
       <el-form-item :label="`${$t('sysManagement.popupPicToPage')}:`" style="width:640px" prop="popupPicToPage">
         <el-input v-model="dataForm.popupPicToPage" :placeholder="`${$t('sysManagement.popupPicToPage')}`" controls-position="right"></el-input>
       </el-form-item>
+      <el-form-item label="客服详情图片" style="width:640px" prop="popupPic">
+        <el-input v-model="dataForm.popupCustomerServicePic" placeholder="客服详情图片`" controls-position="right"></el-input>
+      </el-form-item>
       <el-form-item :label="$t('sysManagement.isActive')" style="width:640px" prop="isOpen">
         <el-switch v-model="dataForm.isOpen" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
       </el-form-item>
@@ -54,13 +66,15 @@ export default {
   },
   data () {
     return {
+      shopList: [],
       dataForm: {
         // id: null,
         // paramKey: 'HOME_PAGE_POPUP',
         popupName: null,
         popupPic: null,
         popupPicToPage: null,
-        isOpen: true
+        isOpen: true,
+        popupCustomerServicePic:null,
         // paramValue: null
       },
       activationEventOriginate: false,
@@ -75,19 +89,21 @@ export default {
         ],
         popupPicToPage: [
           { required: true, message: `${this.$i18n.t('sysManagement.popupPicToPage')} ${this.$i18n.t('sysManagement.nullTips')}`, trigger: 'blur' }
+        ],
+        shopId: [
+          { required: true, message: `关联店铺 shopId ${this.$i18n.t('sysManagement.nullTips')}`, trigger: 'blur' }
         ]
       }
     }
   },
   mounted () {
-    this.init()
+    this.getShopList()
   },
   methods: {
     init () {
-      // this.$refs['dataForm'].resetFields()
       this.$nextTick(() => {
         this.$http({
-          url: this.$http.adornUrl('/sys/pconfig/info/' + 'HOME_PAGE_POPUP'),
+          url: this.$http.adornUrl('/sys/pconfig/info/' + 'HOME_PAGE_POPUP_' + this.shopList[0].shopId),
           method: 'get',
           params: this.$http.adornParams()
         }).then(({ data }) => {
@@ -98,6 +114,32 @@ export default {
         this.$refs['dataForm'].resetFields()
       })
     },
+    getShopList () {
+      this.$http({
+        url: this.$http.adornUrl('/shop/shopAuditing/list'),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.shopList = data
+        }
+      })
+    },
+    getInfo (shopId) {
+      this.$http({
+        url: this.$http.adornUrl('/sys/pconfig/info/' + 'HOME_PAGE_POPUP_' + shopId),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.dataForm = data
+        } else {
+            this.dataForm.popupName = null;
+            this.dataForm.popupPic = null;
+            this.dataForm.popupPicToPage = null;
+            this.dataForm.popupCustomerServicePic = null;
+            this.isOpen = true;
+        }
+      })
+    },
     // 表单提交
     dataFormSubmit () {
       this.$refs['dataForm'].validate((valid) => {
@@ -107,7 +149,7 @@ export default {
             url: this.$http.adornUrl(this.saveUrl),
             method: 'post',
             data: this.$http.adornData({
-              'paramKey': 'HOME_PAGE_POPUP',
+              'paramKey': 'HOME_PAGE_POPUP_' + this.dataForm.shopId,
               'paramValue': JSON.stringify(this.dataForm),
               'remark': this.$i18n.t('sysManagement.homePagePopupConfig')
             })

+ 52 - 5
src/views/modules/sys/pset/wx-ma-config.vue

@@ -11,6 +11,15 @@
       :rules="dataRule"
       :model="dataForm"
     >
+      <el-form-item label="关联店铺" style="width:640px" prop="shopId">
+        <el-select v-model="dataForm.shopId" placeholder="关联店铺" controls-position="right" @change="getInfo(dataForm.shopId)">
+          <el-option v-for="item in shopList"
+                     :key="item.shopId"
+                     :label="item.shopName"
+                     :value="item.shopId">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item :label="`${$t('sysManagement.miniPrograms')} AppId:`" style="width:640px" prop="appId">
         <el-input v-model="dataForm.appId" :placeholder="`${$t('sysManagement.miniPrograms')} AppId`" controls-position="right"></el-input>
       </el-form-item>
@@ -33,28 +42,38 @@ export default {
         // id: null,
         // paramKey: 'MA_CONFIG',
         appId: null,
-        secret: null
+        secret: null,
+        shopId: null
         // paramValue: null
       },
+      shopList: [],
       dataRule: {
         appId: [
           { required: true, message: `${this.$i18n.t('sysManagement.miniPrograms')} appId ${this.$i18n.t('sysManagement.nullTips')}`, trigger: 'blur' }
         ],
         secret: [
           { required: true, message: `${this.$i18n.t('sysManagement.miniPrograms')} secret ${this.$i18n.t('sysManagement.nullTips')}`, trigger: 'blur' }
+        ],
+        shopId: [
+          { required: true, message: `关联店铺 shopId ${this.$i18n.t('sysManagement.nullTips')}`, trigger: 'blur' }
         ]
       }
     }
   },
   mounted () {
-    this.init()
+    this.getShopList()
+    // this.init()
   },
   methods: {
     init () {
       // this.$refs['dataForm'].resetFields()
+      let key = 'MA_CONFIG'
+      if (this.shopList[0].shopId !== 0) {
+        key = 'MA_CONFIG_' + this.shopList[0].shopId
+      }
       this.$nextTick(() => {
         this.$http({
-          url: this.$http.adornUrl('/sys/pconfig/info/' + 'MA_CONFIG'),
+          url: this.$http.adornUrl('/sys/pconfig/info/' + key),
           method: 'get',
           params: this.$http.adornParams()
         }).then(({ data }) => {
@@ -65,11 +84,39 @@ export default {
         this.$refs['dataForm'].resetFields()
       })
     },
+    getInfo (shopId) {
+      let key = 'MA_CONFIG'
+      if (shopId !== 0) {
+        key = 'MA_CONFIG_' + shopId
+      }
+      this.$http({
+        url: this.$http.adornUrl('/sys/pconfig/info/' + key),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.dataForm = data
+        } else {
+          this.dataForm.appId = null;
+          this.dataForm.secret = null;
+        }
+      })
+    },
+    getShopList () {
+      this.$http({
+        url: this.$http.adornUrl('/shop/shopAuditing/list'),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.shopList = data
+        }
+      })
+    },
     // 表单提交
     dataFormSubmit () {
       let obj = {}
       obj.appId = this.dataForm.appId
       obj.secret = this.dataForm.secret
+      obj.shopId = this.dataForm.shopId
 
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
@@ -77,7 +124,7 @@ export default {
             url: this.$http.adornUrl('/sys/pconfig/save'),
             method: 'post',
             data: this.$http.adornData({
-              'paramKey': 'MA_CONFIG',
+              'paramKey': 'MA_CONFIG' + '_' + this.dataForm.shopId,
               'paramValue': JSON.stringify(this.dataForm),
               'remark': this.$i18n.t('sysManagement.miniProgramsConfig')
             })
@@ -88,7 +135,7 @@ export default {
             this.$message({
               message: this.$i18n.t('publics.operation'),
               type: 'success',
-              duration: 1500,
+              duration: 300,
               onClose: () => {
                 this.visible = false
                 this.$emit('refreshDataList')

+ 42 - 4
src/views/modules/sys/pset/wx-pay-config.vue

@@ -11,6 +11,15 @@
       :rules="dataRule"
       :model="dataForm"
     >
+      <el-form-item label="关联店铺" style="width:640px" prop="shopId">
+        <el-select v-model="dataForm.shopId" placeholder="关联店铺" controls-position="right" @change="getInfo(dataForm.shopId)">
+          <el-option v-for="item in shopList"
+                     :key="item.shopId"
+                     :label="item.shopName"
+                     :value="item.shopId">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item :label="`${$t('sysManagement.wechatPay')} mchId:`" style="width:640px" prop="mchId">
         <el-input v-model="dataForm.mchId" :placeholder="`${$t('sysManagement.wechatPay')} mchId`" controls-position="right"></el-input>
       </el-form-item>
@@ -41,6 +50,7 @@ export default {
         signType: null
         // paramValue: null
       },
+      shopList: [],
       value: [],
       dataRule: {
         mchId: [
@@ -56,14 +66,39 @@ export default {
     }
   },
   mounted () {
-    this.init()
+    this.getShopList()
+    // this.init()
   },
   methods: {
+    getShopList () {
+      this.$http({
+        url: this.$http.adornUrl('/shop/shopAuditing/list'),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.shopList = data
+        }
+      })
+    },
+    getInfo (shopId) {
+      this.$http({
+        url: this.$http.adornUrl('/sys/pconfig/info/' + 'WXPAY_CONFIG_' + shopId),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.dataForm = data
+        } else {
+          this.dataForm.mchId = null;
+          this.dataForm.mchKey = null;
+          this.dataForm.keyPath = null;
+        }
+      })
+    },
     init () {
       // this.$refs['dataForm'].resetFields()
       this.$nextTick(() => {
         this.$http({
-          url: this.$http.adornUrl('/sys/pconfig/info/' + 'WXPAY_CONFIG'),
+          url: this.$http.adornUrl('/sys/pconfig/info/' + 'WXPAY_CONFIG_' + this.shopList[0].shopId),
           method: 'get',
           params: this.$http.adornParams()
         }).then(({ data }) => {
@@ -83,15 +118,18 @@ export default {
             url: this.$http.adornUrl('/sys/pconfig/save'),
             method: 'post',
             data: this.$http.adornData({
-              'paramKey': 'WXPAY_CONFIG',
+              'paramKey': 'WXPAY_CONFIG' + '_' + this.dataForm.shopId,
               'paramValue': JSON.stringify(this.dataForm),
               'remark': this.$i18n.t('sysManagement.paymentCertificatePath')
             })
           }).then(({ data }) => {
+            if (data) {
+              this.init()
+            }
             this.$message({
               message: this.$i18n.t('publics.operation'),
               type: 'success',
-              duration: 1500,
+              duration: 200,
               onClose: () => {
                 this.visible = false
                 this.$emit('refreshDataList')

+ 30 - 2
src/views/modules/sys/webConfig-add-or-update.vue

@@ -58,6 +58,14 @@
         <el-form-item :label="this.$i18n.t('webInfoConfig.bsMenuTitleClose')+'-'+this.$i18n.t('webInfoConfig.english')" prop="bsMenuTitleCloseEn">
           <el-input v-model="dataForm.bsMenuTitleCloseEn" maxlength="6" size="small" show-word-limit></el-input>
         </el-form-item>
+
+        <el-form-item label="关联店铺" prop="shopId">
+          <el-select v-model="dataForm.shopId" placeholder="请选择" controls-position="right">
+            <el-option v-for="item in shopList" :key="item.shopId" :label="item.shopName" :value="item.shopId">
+            </el-option>
+          </el-select>
+          <!-- <el-input v-model="dataForm.shopId" size="small"></el-input> -->
+        </el-form-item>
       </span>
 
       <!--PC端相关配置-->
@@ -127,6 +135,8 @@
         <el-form-item :label="this.$i18n.t('webInfoConfig.pcWelcome')+'-'+this.$i18n.t('webInfoConfig.english')" prop="pcWelcomeEn">
           <el-input v-model="dataForm.pcWelcomeEn" size="small"></el-input>
         </el-form-item>
+
+
       </span>
 
       <!--H5端相关配置-->
@@ -167,6 +177,7 @@
       return {
         visible: false,
         dataForm: {
+          shopId: null,
           id: null,
           configType: null, // 配置类型(1:后台 2:PC端 3:h5端)
           isActivity: 0,
@@ -208,7 +219,20 @@
     components: {
       ImgsUpload
     },
+    mounted() {
+      this.getShopList()
+    },
     methods: {
+      getShopList() {
+        this.$http({
+          url: this.$http.adornUrl('/shop/shopAuditing/list'),
+          method: 'get',
+        }).then(({ data }) => {
+          if (data) {
+            this.shopList = data
+          }
+        })
+      },
       init (configType, id) {
         this.dataForm.id = id || 0
         this.dataForm.configType = configType
@@ -235,6 +259,10 @@
 
           // 后台配置判断
           if (this.dataForm.configType === 1 || this.dataForm.configType === 4) {
+            if (!this.dataForm.shopId && this.dataForm.shopId !== 0) {
+              this.errorMsg('请选择关联店铺')
+              return
+            }
             if (!this.dataForm.bsLoginLogoImg) {
               this.errorMsg(this.$i18n.t('webInfoConfig.loginLogo') + this.$i18n.t('webInfoConfig.canNotBeEmpty'))
               return
@@ -372,7 +400,7 @@
             this.$message({
               message: this.$i18n.t('remindPop.success'),
               type: 'success',
-              duration: 1500,
+              duration: 1000,
               customClass: 'zZindex',
               onClose: () => {
                 this.visible = false
@@ -388,7 +416,7 @@
         this.$message({
           message: message,
           type: 'error',
-          duration: 1500,
+          duration: 1000,
           customClass: 'zZindex'
         })
       },