|
@@ -1,8 +1,11 @@
|
|
|
<template>
|
|
|
<div class='m-container'>
|
|
|
- <h2><div class="squrt"></div>合作单位</h2>
|
|
|
+ <h2>
|
|
|
+ <div class="squrt"></div>合作单位
|
|
|
+ </h2>
|
|
|
<div class="m-core">
|
|
|
- <div @click="openTeaching('create')" class='newBand'>新建</div>
|
|
|
+ <div @click="openTeaching('create')"
|
|
|
+ class='newBand'>新建</div>
|
|
|
<!-- 搜索类型 -->
|
|
|
<!-- <el-form :inline="true"
|
|
|
class="searchForm"
|
|
@@ -30,20 +33,26 @@
|
|
|
</div> -->
|
|
|
<!-- 列表 -->
|
|
|
<div class="tableWrap">
|
|
|
- <el-table :data='tableList' :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
- <el-table-column align='center' prop='id'
|
|
|
+ <el-table :data='tableList'
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop='id'
|
|
|
label="单位编号">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center' prop='name'
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop='name'
|
|
|
label="单位名称">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center' prop='linkman'
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop='linkman'
|
|
|
label="联系人">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center' prop='job'
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop='job'
|
|
|
label="职位">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center' prop='mobileNo'
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop='mobileNo'
|
|
|
label="手机号">
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column align='center' prop='ownershipType'
|
|
@@ -53,10 +62,13 @@
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
<el-table-column align='center'
|
|
|
- label="操作" width='100'>
|
|
|
+ label="操作"
|
|
|
+ width='100'>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="openTeaching('update', scope.row)" type="text">修改</el-button>
|
|
|
- <el-button @click="onDelete(scope.row)" type="text">删除</el-button>
|
|
|
+ <el-button @click="openTeaching('update', scope.row)"
|
|
|
+ type="text">修改</el-button>
|
|
|
+ <el-button @click="onDelete(scope.row)"
|
|
|
+ type="text">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -68,19 +80,36 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog :title="formTitle[formActionTitle]" :visible.sync="teachingStatus" @close="onFormClose('ruleForm')" width="500px">
|
|
|
- <el-form :model="form" :rules="rules" ref="ruleForm">
|
|
|
- <el-form-item label="单位名称" prop="name" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.name" autocomplete="off"></el-input>
|
|
|
+ <el-dialog :title="formTitle[formActionTitle]"
|
|
|
+ :visible.sync="teachingStatus"
|
|
|
+ @close="onFormClose('ruleForm')"
|
|
|
+ width="500px">
|
|
|
+ <el-form :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm">
|
|
|
+ <el-form-item label="单位名称"
|
|
|
+ prop="name"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.name"
|
|
|
+ autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系人" prop="linkman" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.linkman" autocomplete="off"></el-input>
|
|
|
+ <el-form-item label="联系人"
|
|
|
+ prop="linkman"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.linkman"
|
|
|
+ autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="职位" prop="job" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.job" autocomplete="off"></el-input>
|
|
|
+ <el-form-item label="职位"
|
|
|
+ prop="job"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.job"
|
|
|
+ autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号" prop="mobileNo" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.mobileNo" autocomplete="off"></el-input>
|
|
|
+ <el-form-item label="手机号"
|
|
|
+ prop="mobileNo"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.mobileNo"
|
|
|
+ autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="权属类型" prop="ownershipType" :label-width="formLabelWidth">
|
|
|
<el-select v-model="form.ownershipType">
|
|
@@ -90,9 +119,11 @@
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
</el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <span slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
<el-button @click="teachingStatus = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="onTeachingSubmit('ruleForm')">确 定</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="onTeachingSubmit('ruleForm')">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -102,14 +133,14 @@ import pagination from '@/components/Pagination/index'
|
|
|
import { cooperationOrganAdd, cooperationOrganUpdate, cooperationOrganDel, queryPage } from '@/api/systemManage'
|
|
|
import store from '@/store'
|
|
|
import { isvalidPhone } from '@/utils/validate'
|
|
|
-let validPhone = (rule, value,callback)=>{
|
|
|
- if (!value){
|
|
|
- callback(new Error('请输入电话号码'))
|
|
|
- }else if (!isvalidPhone(value)){
|
|
|
- callback(new Error('请输入正确的11位手机号码'))
|
|
|
- }else {
|
|
|
- callback()
|
|
|
- }
|
|
|
+let validPhone = (rule, value, callback) => {
|
|
|
+ if (!value) {
|
|
|
+ callback(new Error('请输入电话号码'))
|
|
|
+ } else if (!isvalidPhone(value)) {
|
|
|
+ callback(new Error('请输入正确的11位手机号码'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
}
|
|
|
export default {
|
|
|
components: { pagination },
|
|
@@ -140,32 +171,32 @@ export default {
|
|
|
name: null, // 教学点名称
|
|
|
linkman: null, // 来源
|
|
|
job: null, // 费用
|
|
|
- mobileNo: null,
|
|
|
+ mobileNo: null,
|
|
|
// ownershipType: null,
|
|
|
organId: store.getters.organ
|
|
|
},
|
|
|
rules: {
|
|
|
name: [{ required: true, message: '请输入教学点名称', trigger: 'blur' }],
|
|
|
- linkman: [{required: true, message: '请输入联系人', trigger: 'blur'}],
|
|
|
- job: [{ required: true, message: '请输入职位', trigger: 'blur'}],
|
|
|
- mobileNo: [{required: true, validator: validPhone, trigger: 'blur'}],
|
|
|
+ linkman: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
+ job: [{ required: true, message: '请输入职位', trigger: 'blur' }],
|
|
|
+ mobileNo: [{ required: true, validator: validPhone, trigger: 'blur' }],
|
|
|
// ownershipType: [{ required: true, message: '请选择权属类型', trigger: 'change' }]
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
this.getList() // 获取列表数据
|
|
|
},
|
|
|
methods: {
|
|
|
- onDelete(rows) {
|
|
|
+ onDelete (rows) {
|
|
|
this.$confirm('您确定删除合作单位?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
cooperationOrganDel(rows.id).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.$message.success('删除成功')
|
|
|
this.teachingStatus = false
|
|
|
this.getList()
|
|
@@ -174,14 +205,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}).catch(() => { });
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
- onTeachingSubmit(formName) { // 添加数据
|
|
|
+ onTeachingSubmit (formName) { // 添加数据
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if(this.formActionTitle == 'create') {
|
|
|
+ if (this.formActionTitle == 'create') {
|
|
|
cooperationOrganAdd(this.form).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.$message.success('修改成功')
|
|
|
this.teachingStatus = false
|
|
|
this.getList()
|
|
@@ -189,10 +220,10 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
- } else if(this.formActionTitle == 'update') {
|
|
|
+ } else if (this.formActionTitle == 'update') {
|
|
|
cooperationOrganUpdate(this.form).then(res => {
|
|
|
// console.log(res)
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.$message.success('修改成功')
|
|
|
this.teachingStatus = false
|
|
|
this.getList()
|
|
@@ -206,19 +237,19 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getList() {
|
|
|
+ getList () {
|
|
|
queryPage({
|
|
|
- organId: this.form.organId,
|
|
|
+ search: this.form.organId,
|
|
|
rows: this.pageInfo.limit,
|
|
|
page: this.pageInfo.page
|
|
|
}).then(res => {
|
|
|
- if(res.code == 200 && res.data) {
|
|
|
+ if (res.code == 200 && res.data) {
|
|
|
this.tableList = res.data.rows
|
|
|
this.pageInfo.total = res.data.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- openTeaching(type, rows) {
|
|
|
+ openTeaching (type, rows) {
|
|
|
// 重置数据
|
|
|
this.form = {
|
|
|
id: null,
|
|
@@ -232,19 +263,19 @@ export default {
|
|
|
this.teachingStatus = true
|
|
|
this.formActionTitle = type
|
|
|
// 修改的时候赋值
|
|
|
- if(type == 'update') {
|
|
|
+ if (type == 'update') {
|
|
|
this.form = {
|
|
|
id: rows.id,
|
|
|
name: rows.name, // 教学点名称
|
|
|
linkman: rows.linkman, // 来源
|
|
|
job: rows.job, // 费用
|
|
|
- mobileNo: rows.mobileNo ? rows.mobileNo : null,
|
|
|
+ mobileNo: rows.mobileNo ? rows.mobileNo : null,
|
|
|
ownershipType: rows.ownershipType,
|
|
|
organId: store.getters.organ
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- onFormClose(formName) { // 关闭弹窗重置验证
|
|
|
+ onFormClose (formName) { // 关闭弹窗重置验证
|
|
|
this.$refs[formName].clearValidate()
|
|
|
}
|
|
|
}
|
|
@@ -255,10 +286,12 @@ export default {
|
|
|
background: #14928a;
|
|
|
border-color: #14928a;
|
|
|
color: #fff;
|
|
|
- &:hover, &:active, &:focus {
|
|
|
+ &:hover,
|
|
|
+ &:active,
|
|
|
+ &:focus {
|
|
|
background: #14928a;
|
|
|
border-color: #14928a;
|
|
|
- color: #FFF;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
}
|
|
|
.el-vue-search-box-container {
|