|
@@ -8,12 +8,18 @@
|
|
|
<!-- v-permission="'sporadicChargeInfo/add'" -->
|
|
|
<div class="newBand"
|
|
|
v-permission="'sporadicChargeInfo/add'"
|
|
|
- @click="
|
|
|
- newVisible">新增</div>
|
|
|
+ @click="newVisible">新增公用收费</div>
|
|
|
+ <div class="newBand"
|
|
|
+ v-permission="'sporadicChargeInfo/add'"
|
|
|
+ @click="newVisible1">新增个人收费</div>
|
|
|
<el-form :inline="true"
|
|
|
:model="searchForm">
|
|
|
- <el-form-item label="分部">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input placeholder="标题或学生姓名" v-model="searchForm.search"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
<el-select v-model="searchForm.organId"
|
|
|
+ placeholder='请选择分部'
|
|
|
clearable
|
|
|
filterable>
|
|
|
<el-option v-for='(item,index) in organList'
|
|
@@ -22,8 +28,9 @@
|
|
|
:label="item.name"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="收费类型">
|
|
|
- <el-select v-model="searchForm.type"
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model="searchForm.chargeType"
|
|
|
+ placeholder='请选择收费类型'
|
|
|
clearable>
|
|
|
<el-option label="考级"
|
|
|
:value="1"></el-option>
|
|
@@ -35,8 +42,21 @@
|
|
|
:value="4"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-button type="danger"
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model="searchForm.type"
|
|
|
+ placeholder='请选择订单类型'
|
|
|
+ clearable>
|
|
|
+ <el-option label="个人"
|
|
|
+ value="personal"></el-option>
|
|
|
+ <el-option label="公用"
|
|
|
+ value="common"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="danger"
|
|
|
@click="search">搜索</el-button>
|
|
|
+ <el-button @click="onReSet"
|
|
|
+ type="primary">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="tableWrap">
|
|
@@ -71,6 +91,19 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align='center'
|
|
|
+ label="学生姓名"
|
|
|
+ prop="userName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.userName || '-' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
+ label="订单类型">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.userId ? '人个' : '公用' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
label="创建人"
|
|
|
prop="operatorName">
|
|
|
</el-table-column>
|
|
@@ -96,6 +129,7 @@
|
|
|
</div>
|
|
|
<el-dialog :title="title"
|
|
|
:visible.sync="zeroVisible"
|
|
|
+ @close="onFormClose('maskForm')"
|
|
|
width="650px">
|
|
|
<el-form :model='maskForm'
|
|
|
:rules="maskRules"
|
|
@@ -171,6 +205,86 @@
|
|
|
@click="zeroVisible = false">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="title1"
|
|
|
+ :visible.sync="zeroVisible1"
|
|
|
+ @close="onFormClose('maskForm1')"
|
|
|
+ width="650px">
|
|
|
+ <el-form :model='maskForm1'
|
|
|
+ :rules="maskRules1"
|
|
|
+ label-width="100px"
|
|
|
+ label-position="right"
|
|
|
+ :inline="true"
|
|
|
+ ref="maskForm1">
|
|
|
+ <el-form-item label="标题"
|
|
|
+ prop="title">
|
|
|
+ <el-input v-model="maskForm1.title"
|
|
|
+ :disabled='!isNew1'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="收费类型"
|
|
|
+ prop="type">
|
|
|
+ <el-select v-model="maskForm1.type"
|
|
|
+ :disabled='!isNew1'
|
|
|
+ clearable
|
|
|
+ filterable>
|
|
|
+ <el-option label="考级"
|
|
|
+ :value="1"></el-option>
|
|
|
+ <el-option label="缴费"
|
|
|
+ :value="2"></el-option>
|
|
|
+ <el-option label="声部更改"
|
|
|
+ :value="3"></el-option>
|
|
|
+ <el-option label="乐器更换"
|
|
|
+ :value="4"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学员编号"
|
|
|
+ prop='studentId'>
|
|
|
+ <el-input v-model="maskForm1.studentId"
|
|
|
+ @blur="onStudentChange"
|
|
|
+ type="number"
|
|
|
+ @mousewheel.native.prevent
|
|
|
+ :disabled='!isNew1'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="金额"
|
|
|
+ prop='money'>
|
|
|
+ <el-input v-model="maskForm1.money"
|
|
|
+ type="number"
|
|
|
+ @mousewheel.native.prevent
|
|
|
+ :disabled='!isNew1'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学员姓名"
|
|
|
+ prop='studentName'>
|
|
|
+ <el-input v-model="maskForm1.studentName"
|
|
|
+ :disabled='true'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="查看链接"
|
|
|
+ v-if="!isNew1">
|
|
|
+ <el-input style='width:400px'
|
|
|
+ :disabled='!isNew1'
|
|
|
+ v-model="maskForm1.code"></el-input>
|
|
|
+ <el-button type='danger'
|
|
|
+ @click="onCreateQRCode">二维码</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="收费详情"
|
|
|
+ prop="desc">
|
|
|
+ <el-input type='textarea'
|
|
|
+ :disabled='!isNew1'
|
|
|
+ v-model="maskForm1.desc"
|
|
|
+ style="width:490px"
|
|
|
+ :autosize="{minRows: 5}"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
+ <el-button @click="zeroVisible1 = false">取 消</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ v-if="isNew1"
|
|
|
+ @click="addZero1">确 定</el-button>
|
|
|
+ <el-button v-if="!isNew1"
|
|
|
+ type="primary"
|
|
|
+ @click="zeroVisible1 = false">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog :visible.sync="qrcodeStatus"
|
|
|
center
|
|
|
width="300px">
|
|
@@ -189,7 +303,7 @@
|
|
|
import { getEmployeeOrgan } from '@/api/buildTeam'
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
import { vaildStudentUrl } from '@/utils/validate'
|
|
|
-import { addZero, getZero, removeZero } from '@/api/zeroManager'
|
|
|
+import { addZero, getZero, removeZero, getBasic } from '@/api/zeroManager'
|
|
|
import QRCode from 'qrcodejs2'
|
|
|
export default {
|
|
|
components: { pagination },
|
|
@@ -198,7 +312,9 @@ export default {
|
|
|
zeroVisible: false,
|
|
|
searchForm: {
|
|
|
organId: null,
|
|
|
+ chargeType: null,
|
|
|
type: null,
|
|
|
+ search: null
|
|
|
},
|
|
|
tableList: [{}],
|
|
|
organList: [],
|
|
@@ -227,7 +343,29 @@ export default {
|
|
|
title: '新增收费',
|
|
|
qrcodeStatus: false,
|
|
|
qrcodes: true,
|
|
|
- activeRow: null
|
|
|
+ activeRow: null,
|
|
|
+
|
|
|
+
|
|
|
+ title1: '新增收费',
|
|
|
+ activeRow1: null,
|
|
|
+ zeroVisible1: false,
|
|
|
+ maskForm1: {
|
|
|
+ type: null,
|
|
|
+ money: null,
|
|
|
+ desc: null,
|
|
|
+ title: null,
|
|
|
+ code: null,
|
|
|
+ studentId: null,
|
|
|
+ studentName: null,
|
|
|
+ },
|
|
|
+ isNew1: false,
|
|
|
+ maskRules1: {
|
|
|
+ organId: [{ required: true, message: '请选择分部', trigger: 'change' }],
|
|
|
+ type: [{ required: true, message: '请选择收费类型', trigger: 'change' }],
|
|
|
+ money: [{ required: true, message: '请输入收费金额', trigger: 'change' }],
|
|
|
+ title: [{ required: true, message: '请输入标题名称', trigger: 'change' }],
|
|
|
+ studentId: [{ required: true, message: '请输入学员编号', trigger: 'blur' }],
|
|
|
+ },
|
|
|
}
|
|
|
}, mounted () {
|
|
|
getEmployeeOrgan().then(res => {
|
|
@@ -242,48 +380,73 @@ export default {
|
|
|
this.pageInfo.page = 1;
|
|
|
this.getList()
|
|
|
},
|
|
|
+ onReSet () {
|
|
|
+ this.searchForm = {
|
|
|
+ organId: null,
|
|
|
+ chargeType: null,
|
|
|
+ type: null,
|
|
|
+ search: null
|
|
|
+ }
|
|
|
+ },
|
|
|
getList () {
|
|
|
- let chargeType, organId;
|
|
|
- this.searchForm.type ? chargeType = this.searchForm.type : chargeType = null
|
|
|
- this.searchForm.organId ? organId = this.searchForm.organId : organId = null
|
|
|
- getZero({ page: this.pageInfo.page, rows: this.pageInfo.limit, chargeType, organId }).then(res => {
|
|
|
+ let searchForm = this.searchForm
|
|
|
+ let params = {
|
|
|
+ organId: searchForm.organId ? searchForm.organId : null,
|
|
|
+ chargeType: searchForm.chargeType ? searchForm.chargeType : null,
|
|
|
+ type: searchForm.type ? searchForm.type : null,
|
|
|
+ search: searchForm.search ? searchForm.search : null,
|
|
|
+ page: this.pageInfo.page,
|
|
|
+ rows: this.pageInfo.limit
|
|
|
+ }
|
|
|
+
|
|
|
+ getZero(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.tableList = res.data.rows
|
|
|
this.pageInfo.total = res.data.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ onFormClose (formName) { // 关闭弹窗重置验证
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
+ },
|
|
|
newVisible () {
|
|
|
this.isNew = true;
|
|
|
this.zeroVisible = true;
|
|
|
- this.title = '新增收费'
|
|
|
+ this.title = '新增公用收费'
|
|
|
+ },
|
|
|
+ newVisible1 () {
|
|
|
+ this.isNew1 = true;
|
|
|
+ this.zeroVisible1 = true;
|
|
|
+ this.title1 = '新增个人收费'
|
|
|
},
|
|
|
lookVisible (row) {
|
|
|
- this.isNew = false;
|
|
|
- this.zeroVisible = true;
|
|
|
- this.title = '查看收费'
|
|
|
- this.activeRow = row
|
|
|
- this.maskForm.code = vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`
|
|
|
- this.maskForm.type = parseInt(row.chargeType)
|
|
|
- this.maskForm.desc = row.detail
|
|
|
- this.maskForm.title = row.title
|
|
|
- this.maskForm.organId = row.organId
|
|
|
- this.maskForm.money = row.amount
|
|
|
- // this.maskForm = {
|
|
|
- // code: vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`,
|
|
|
- // type: parseInt(row.chargeType),
|
|
|
- // desc: row.detail,
|
|
|
- // title: row.title,
|
|
|
- // organId: row.organId,
|
|
|
- // money: row.amount
|
|
|
- // }
|
|
|
+ if(row.userId) {
|
|
|
+ this.isNew1 = false;
|
|
|
+ this.zeroVisible1 = true;
|
|
|
+ this.title1 = '查看个人收费'
|
|
|
+ this.activeRow = row
|
|
|
+ this.maskForm1.code = vaildStudentUrl() + `/#/sporadicPay?id=${this.activeRow.id}&userId=${this.activeRow.userId}`
|
|
|
+ this.maskForm1.type = parseInt(row.chargeType)
|
|
|
+ this.maskForm1.desc = row.detail
|
|
|
+ this.maskForm1.title = row.title
|
|
|
+ this.maskForm1.money = row.amount
|
|
|
+ this.maskForm1.studentId = row.userId
|
|
|
+ this.maskForm1.studentName = row.userName
|
|
|
+ } else {
|
|
|
+ this.isNew = false;
|
|
|
+ this.zeroVisible = true;
|
|
|
+ this.title = '查看公用收费'
|
|
|
+ this.activeRow = row
|
|
|
+ this.maskForm.code = vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`
|
|
|
+ this.maskForm.type = parseInt(row.chargeType)
|
|
|
+ this.maskForm.desc = row.detail
|
|
|
+ this.maskForm.title = row.title
|
|
|
+ this.maskForm.organId = row.organId
|
|
|
+ this.maskForm.money = row.amount
|
|
|
+ }
|
|
|
},
|
|
|
- // look2Code () { },
|
|
|
onCreateQRCode () { // 生成报名二维码
|
|
|
this.qrcodeStatus = true
|
|
|
- // let id = this.$route.query.id
|
|
|
- // let teamName = this.$route.query.name
|
|
|
-
|
|
|
setTimeout(() => {
|
|
|
if (this.qrcodes) {
|
|
|
this.qrcodes = false
|
|
@@ -295,10 +458,12 @@ export default {
|
|
|
correctLevel: QRCode.CorrectLevel.H
|
|
|
})
|
|
|
}
|
|
|
- // vaildStudentUrl() + `/#/sporadicLogin?id=${刷刷刷}`
|
|
|
this.qrcode.clear();
|
|
|
- this.qrcode.makeCode(vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`)
|
|
|
- // this.codeUrl = vaildStudentUrl() + '/#/login?musicGroupId=' + id
|
|
|
+ if(this.activeRow.userId) {
|
|
|
+ this.qrcode.makeCode(vaildStudentUrl() + `/#/sporadicPay?id=${this.activeRow.id}&userId=${this.activeRow.userId}`)
|
|
|
+ } else {
|
|
|
+ this.qrcode.makeCode(vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`)
|
|
|
+ }
|
|
|
}, 500)
|
|
|
},
|
|
|
addZero () {
|
|
@@ -321,6 +486,48 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ addZero1 () {
|
|
|
+ this.$refs['maskForm1'].validate(item => {
|
|
|
+ if (item) {
|
|
|
+ let maskForm1 = this.maskForm1
|
|
|
+ if(!maskForm1.studentName) {
|
|
|
+ this.$message.error('学员信息不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ chargeType: maskForm1.type,
|
|
|
+ detail: maskForm1.desc,
|
|
|
+ title: maskForm1.title,
|
|
|
+ userId: maskForm1.studentId,
|
|
|
+ amount: maskForm1.money
|
|
|
+ }
|
|
|
+ addZero(obj).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('新增成功')
|
|
|
+ this.zeroVisible1 = false;
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onStudentChange() {
|
|
|
+ let studentId = this.maskForm1.studentId
|
|
|
+ // 判断学生编号是否存在
|
|
|
+ if(!studentId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ getBasic({ userId: studentId }).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ if(res.data) {
|
|
|
+ this.maskForm1.studentName = res.data.name
|
|
|
+ } else {
|
|
|
+ this.maskForm1.studentName = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
removeItem (row) {
|
|
|
this.$confirm('是否删除该收费', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
@@ -367,7 +574,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style lang="scss">
|
|
|
+<style lang="scss" scoped>
|
|
|
.right-code {
|
|
|
// width: 50%;
|
|
|
// float: left;
|
|
@@ -377,4 +584,7 @@ export default {
|
|
|
padding-bottom: 8px;
|
|
|
}
|
|
|
}
|
|
|
+.newBand {
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
</style>
|