Browse Source

bug修改及乐团功能添加

lex-xin 5 years ago
parent
commit
c6b3c73ac0

+ 9 - 0
src/api/buildTeam.js

@@ -571,6 +571,15 @@ export function pauseMusicGroup (data) {
   })
 }
 
+// 暂停乐团
+export function cancelMusicGroup (data) {
+  return request({
+    url: api + `/musicGroup/cancelMusicGroup`,
+    method: 'POST',
+    data: qs.stringify(data)
+  })
+}
+
 
 // 修改乐团招生计划
 export function resetPlanNum (data) {

+ 1 - 5
src/main.js

@@ -34,11 +34,7 @@ import '@/permission' // permission control
 // 高德地址
 import VueAMap from 'vue-amap'
 Vue.use(VueAMap)
-VueAMap.initAMapApiLoader({
-  key: 'b1e6ac2eb28902ce91a490edf194e000',
-  plugin: ['AMap.Geolocation', 'AMap.PlaceSearch', 'AMap.Geocoder'],
-  v: '1.4.4'
-})
+
 
 // set ElementUI lang to EN
 Vue.use(ElementUI, { locale })

+ 14 - 1
src/utils/searchArray.js

@@ -59,6 +59,18 @@ const dealStatus = [
     { value: "CLOSE", label: "交易关闭" }
 ]
 
+const musicGroupStatus = [
+    { value: 'APPLY', text: '报名中' },
+    { value: 'PAY', text: '缴费中' }, 
+    { value: 'PREPARE', text: '筹备中' },
+    { value: 'PROGRESS', text: '进行中' }, 
+    { value: 'CANCELED', text: '取消' }, 
+    { value: 'AUDIT', text: '审核中' },
+    { value: 'PAUSE', text: '暂停' }, 
+    { value: 'DRAFT', text: '编辑中' }, 
+    { value: 'AUDIT_FAILED', text: '审核失败' }
+  ]
+
 export {
     courseType,
     attendance,
@@ -66,5 +78,6 @@ export {
     teacherStatus,
     attendanceStatus,
     orderStatus,
-    dealStatus
+    dealStatus,
+    musicGroupStatus
 }

+ 0 - 3
src/utils/vueFilter.js

@@ -226,9 +226,6 @@ Vue.filter('paymentStatus', value => {
 // 乐团状态
 Vue.filter('teamStatus', value => {
   let template = {
-    DRAFT: '草稿',
-    AUDIT: '审核中',
-    AUDIT_FAILED: '审核失败',
     APPLY: "报名中",
     PAY: "缴费中",
     PREPARE: "筹备中",

+ 22 - 7
src/views/businessManager/shopManager/shopOperation.vue

@@ -35,13 +35,13 @@
           <el-input v-model="form.specification" ></el-input>
         </el-form-item>
         <el-form-item label="商品价格" prop="marketPrice">
-          <el-input v-model="form.marketPrice" ></el-input>
+          <el-input type="number" v-model="form.marketPrice" ></el-input>
         </el-form-item>
         <el-form-item label="商品团购价" prop="groupPurchasePrice">
-          <el-input v-model="form.groupPurchasePrice" ></el-input>
+          <el-input type="number" v-model="form.groupPurchasePrice" ></el-input>
         </el-form-item>
         <el-form-item label="商品采购价" prop="discountPrice">
-          <el-input v-model="form.discountPrice" ></el-input>
+          <el-input type="number" v-model="form.discountPrice" ></el-input>
         </el-form-item>
         <el-form-item label="商品图片" prop="image">
           <el-upload
@@ -70,6 +70,17 @@
 import { categoryListTree, goodsAdd, goodsUpdate, goodsSingleQuery } from '@/api/businessManager'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
+let validPrice = (rule, value,callback)=>{
+    if (!value){
+        callback(new Error('请输入金额'))
+    }else  if (value < 0){
+        callback(new Error('输入金额必须大于0'))
+    }else if(value >= 100000) {
+        callback(new Error('输入金额必须小于100000'))
+    }else {
+      callback()
+    }
+}
 export default {
   data () {
     return {
@@ -108,10 +119,14 @@ export default {
           { min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }],
         type: [{ required: true, message: '请选择商品分类', trigger: 'change' }],
         goodsCategoryId: [{ required: true, message: '请选择商品类型', trigger: 'change' }],
-        specification: [{ required: true, message: '请输入商品型号', trigger: 'blur' }],
-        marketPrice: [{ required: true, message: '请输入商品价格', trigger: 'blur' }],
-        groupPurchasePrice: [{ required: true, message: '请输入商品团购价', trigger: 'blur' }],
-        discountPrice: [{ required: true, message: '请输入商品采购价', trigger: 'blur' }],
+        specification: [{ required: true, message: '请输入商品型号', trigger: 'blur' },
+          { min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }],
+        marketPrice: [{ required: true, validator: validPrice, trigger: 'blur' }],
+        groupPurchasePrice: [{ required: true, validator: validPrice, trigger: 'blur' }],
+        discountPrice: [{ required: true, validator: validPrice, trigger: 'blur' }],
+        // marketPrice: [{ required: true, message: '请输入商品价格', trigger: 'blur' }],
+        // groupPurchasePrice: [{ required: true, message: '请输入商品团购价', trigger: 'blur' }],
+        // discountPrice: [{ required: true, message: '请输入商品采购价', trigger: 'blur' }],
         image: [{ required: true, message: '请选择图片', trigger: 'blur' }],
         desc: [{ required: true, message: '请输入商品描述', trigger: 'blur' }]
       }

+ 8 - 0
src/views/categroyManager/insideSetting/addressManager.vue

@@ -194,6 +194,14 @@ import pagination from '@/components/Pagination/index'
 }());
 import { schoolQueryPage, schoolAdd, schoolUpdate, queryByOrganId, schoolDel } from '@/api/systemManage'
 import store from '@/store'
+import VueAMap from 'vue-amap'
+// Vue.use(VueAMap)
+VueAMap.initAMapApiLoader({
+  key: 'b1e6ac2eb28902ce91a490edf194e000',
+  plugin: ['AMap.Geolocation', 'AMap.PlaceSearch', 'AMap.Geocoder'],
+  v: '1.4.4'
+})
+
 export default {
   components: { pagination },
   name: 'adminManager',

+ 1 - 1
src/views/studentManager/components/studentOrder.vue

@@ -21,7 +21,7 @@
              class="searchForm"
              v-model="searchForm">
       <el-form-item>
-        <el-date-picker
+        <el-date-picker style="width: 400px;"
           v-model="orderDate"
           type="daterange"
           value-format="yyyy-MM-dd"

+ 1 - 1
src/views/studentManager/components/studentRecord.vue

@@ -67,7 +67,7 @@
                          label="课程老师">
         </el-table-column>
         <el-table-column align='center' prop="attendanceStatus"
-                         label="考状态">
+                         label="考状态">
           <template slot-scope="scope">
             {{ scope.row.attendanceStatus | clockingIn }}
           </template>

+ 46 - 17
src/views/teamBuild/signupList.vue

@@ -7,7 +7,7 @@
           {{ teamName }}报名详情
         </h2>
         <div class="btnList">
-          <div class='newBand close'>停止乐团</div>
+          <div class='newBand close' @click="onClose">停止乐团</div>
           <div class='newBand'
                @click="paymentStatus = true"
                v-if="status=='APPLY'">开始缴费</div>
@@ -340,7 +340,7 @@
 </template>
 <script>
 import pagination from '@/components/Pagination/index'
-import { getTeamRecruit, getintoClass, getStudentList, findSound, musicGroupOpenPay, openPayment, musicGroupFound, extensionPayment, resetPlanNum } from '@/api/buildTeam'
+import { getTeamRecruit, getintoClass, getStudentList, findSound, musicGroupOpenPay, openPayment, musicGroupFound, extensionPayment, resetPlanNum, cancelMusicGroup } from '@/api/buildTeam'
 import { resetStudentSubject, getStudentFeeDetail } from '@/api/studentManager'
 import QRCode from 'qrcodejs2'
 export default {
@@ -539,23 +539,52 @@ export default {
       }
     },
     onGoHome () { // 确认开团
-      musicGroupFound({
-        musicGroupId: this.$route.query.id
-      }).then(res => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: '开启成功'
-          })
-          this.$router.push({
-            path: '/business/teamSeting',
-            query: {
-              status: 'PREPARE',
-              id: this.$route.query.id,
-              name: this.$route.query.name
+      this.$confirm('您确定开启乐团吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        musicGroupFound({
+          musicGroupId: this.$route.query.id
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              type: 'success',
+              message: '开启成功'
+            })
+            this.$router.push({
+              path: '/business/teamSeting',
+              query: {
+                status: 'PREPARE',
+                id: this.$route.query.id,
+                name: this.$route.query.name
+              }
+            })
+          }
+        })
+      }).catch(() => {        
+      })
+    },
+    onClose() { // 停止乐团
+      this.$confirm('您确定停止乐团吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+          cancelMusicGroup({
+            musicGroupId: this.$route.query.id
+          }).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                type: 'success',
+                message: '停止成功'
+              })
+              this.$router.push({
+                path: '/business/teamDetail'
+              })
             }
           })
-        }
+      }).catch(() => {        
       })
     },
     handleSelectionChange (val) {

+ 3 - 24
src/views/teamDetail/teamList.vue

@@ -134,7 +134,7 @@
                            v-if="scope.row.status == 'PROGRESS'"
                            @click="lookTeamDetail(scope.row)">查看</el-button>
                 <el-button type="text"
-                           v-if="scope.row.status != 'PROGRESS'"
+                           v-if="scope.row.status != 'PROGRESS' && scope.row.status != 'CANCELED'"
                            @click="lookTeamDetail(scope.row)">编辑</el-button>
                 <el-button v-if="scope.row.status == 'PAUSE'"
                            @click="onTeamOpeation('start', scope.row)"
@@ -162,6 +162,7 @@ import pagination from '@/components/Pagination/index'
 // import { truncate } from 'fs';
 import { getTeamList, getPayType } from '@/api/teamServer'
 import { getCooperation } from '@/api/buildTeam'
+import { musicGroupStatus } from '@/utils/searchArray'
 export default {
   name: "Main",
   data () {
@@ -173,29 +174,7 @@ export default {
         word: ''
       },
       typeList: [], // 收费类型
-      nowStatus: [{ // 状态数组
-        value: 'APPLY', text: '报名中'
-      },
-      {
-        value: 'PAY', text: '缴费中'
-      }, {
-        value: 'PREPARE', text: '筹备中'
-      },
-      {
-        value: 'PROGRESS', text: '进行中'
-      }, {
-        value: 'CANCELED', text: '取消'
-      }, {
-        value: 'AUDIT', text: '审核中'
-      },
-      {
-        value: 'PAUSE', text: '暂停'
-      }, {
-        value: 'DRAFT', text: '编辑中'
-      }, {
-        value: 'AUDIT_FAILED', text: '审核失败'
-      }
-      ],
+      nowStatus: musicGroupStatus,
       searchLsit: [], // 存储选择后的数组
       tableData: [], // table数据
       rules: {