Sfoglia il codice sorgente

增加小程序底部配置

pengyh 1 anno fa
parent
commit
c92d9cdf4c

+ 72 - 29
src/views/setting/organizationManagement/tenantDetails/index.vue

@@ -128,12 +128,12 @@
               </el-form-item>
             </el-col>
 			<el-col :span="6">
-			  <el-form-item label="商户属性" prop="companyType">
-			    <el-radio-group v-model="step1Form.companyType">
-			      <el-radio :label="1">销售</el-radio>
-			      <el-radio :label="2">售后</el-radio>
-			    </el-radio-group>
-			  </el-form-item>
+				<el-form-item label="商户属性" prop="companyType">
+					<el-radio-group v-model="step1Form.companyType">
+						<el-radio :label="1">销售</el-radio>
+						<el-radio :label="2">售后</el-radio>
+					</el-radio-group>
+				</el-form-item>
 			</el-col>
             <el-col :span="12">
               <el-form-item label="以旧换新抵扣方式" prop="yjhxDkFlag">
@@ -143,6 +143,31 @@
                 </el-radio-group>
               </el-form-item>
             </el-col>
+						
+			<el-col :span="24">
+				<div style="margin-bottom: 20px">小程序底部菜单排序 <span style="color: #fb8c45;margin-left: 20px;"> 数字越小越靠前</span></div>
+				<el-table :data="step1Form.appModuleJson" style="width: 50%" element-loading-text="Loading" border fit highlight-current-row stripe>
+					<el-table-column prop="" align="center" label="类型">
+						<template slot-scope="scope">
+							{{typeFilter(scope.row.type)}}
+						</template>
+					</el-table-column>
+					<el-table-column prop="" align="center" label="名称">
+						<template slot-scope="scope">
+							<el-form-item :prop="'appModuleJson.' + scope.$index + '.name'" :rules="[{ required: true, message: `请输入名称`, trigger: 'blur' }]" label-width="0">
+								<el-input type="text" v-model="scope.row.name" placeholder="请输入"></el-input>
+							</el-form-item>
+						</template>
+					</el-table-column>
+					<el-table-column prop="" align="center" label="排序">
+						<template slot-scope="scope">
+							<el-form-item :prop="'appModuleJson.' + scope.$index + '.sort'" :rules="[{ required: true, message: `请输入排序`, trigger: 'blur' }]" label-width="0">
+								<el-input type="number" v-model="scope.row.sort" placeholder="请输入"></el-input>
+							</el-form-item>
+						</template>
+					</el-table-column>
+				</el-table>
+			</el-col>
           </el-row>
         </el-form>
       </el-card>
@@ -530,6 +555,7 @@ export default {
         storePay: '',
 		companyType: 2,
         yjhxDkFlag: '',
+		appModuleJson: []
       },
 
       passwordType1: 'password',
@@ -621,6 +647,17 @@ export default {
     userType() {
       return JSON.parse(localStorage.getItem('greemall_user')).type
     },
+		typeFilter(){
+				return function(type){
+					let obj = {
+						home: '首页',
+						order: '工单',
+						shop: '商城',
+						my: '我的'
+					}
+					return obj[type]
+				}
+		}
   },
   created() {
     const { id, type } = this.$route.query;
@@ -662,6 +699,7 @@ export default {
         this.step1Form.storePay = res.data.storePay
 		this.step1Form.companyType = res.data.companyType
         this.step1Form.yjhxDkFlag = res.data.yjhxDkFlag
+		this.step1Form.appModuleJson = JSON.parse(res.data.appModuleJson)
 
         this.img1_url = res.data.minLogo1;
         this.img2_url = res.data.minLogo2;
@@ -798,29 +836,34 @@ export default {
     },
 
     submitStep1Form() {
-      this.formLoading = true;
-      let params = {
-        // adminUserId: this.id,
-        companyWechatId: this.companyWechatId,
-        moduleMaterialPart: this.step1Form.moduleMaterialPart,
-		billTitle: this.step1Form.billTitle,
-        moduleYb: this.step1Form.moduleYb,
-        moduleWb: this.step1Form.moduleWb,
-        joinCode: this.step1Form.joinCode,
-        moduleZl: this.step1Form.moduleZl,
-        moduleEs: this.step1Form.moduleEs,
-        storePay: this.step1Form.storePay,
-		companyType: this.step1Form.companyType,
-        yjhxDkFlag: this.step1Form.yjhxDkFlag,
-      }
-      editAccount(params).then(res => {
-        this.$successMsg('保存成功');
-        setTimeout(() => {
-          this.goBack();
-        }, 1500)
-      }).finally(res => {
-        this.formLoading = false;
-      })
+		this.$refs.step1Form.validate(valid => {
+		  if (valid) {
+			  this.formLoading = true;
+			  let params = {
+			    // adminUserId: this.id,
+			    companyWechatId: this.companyWechatId,
+			    moduleMaterialPart: this.step1Form.moduleMaterialPart,
+			  		billTitle: this.step1Form.billTitle,
+			    moduleYb: this.step1Form.moduleYb,
+			    moduleWb: this.step1Form.moduleWb,
+			    joinCode: this.step1Form.joinCode,
+			    moduleZl: this.step1Form.moduleZl,
+			    moduleEs: this.step1Form.moduleEs,
+			    storePay: this.step1Form.storePay,
+			  		companyType: this.step1Form.companyType,
+			    yjhxDkFlag: this.step1Form.yjhxDkFlag,
+			  				appModuleJson: JSON.stringify(this.step1Form.appModuleJson)
+			  }
+			  editAccount(params).then(res => {
+			    this.$successMsg('保存成功');
+			    setTimeout(() => {
+			      this.goBack();
+			    }, 1500)
+			  }).finally(res => {
+			    this.formLoading = false;
+			  })
+		  }
+		})
     },
 
     submitStep2Form() {