|  | @@ -4,34 +4,35 @@
 | 
	
		
			
				|  |  |        <div class="squrt"></div>合作单位
 | 
	
		
			
				|  |  |      </h2>
 | 
	
		
			
				|  |  |      <div class="m-core">
 | 
	
		
			
				|  |  | -      <div @click="openTeaching('create')"
 | 
	
		
			
				|  |  | -           v-permission="'cooperationOrgan/add'"
 | 
	
		
			
				|  |  | -           class='newBand'>新建</div>
 | 
	
		
			
				|  |  |        <!-- 搜索类型 -->
 | 
	
		
			
				|  |  | -      <!-- <el-form :inline="true"
 | 
	
		
			
				|  |  | +      <el-form :inline="true"
 | 
	
		
			
				|  |  |                 class="searchForm"
 | 
	
		
			
				|  |  |                 v-model.trim="searchForm">
 | 
	
		
			
				|  |  |          <el-form-item>
 | 
	
		
			
				|  |  | -          <el-select v-model.trim="searchForm.status"
 | 
	
		
			
				|  |  | -                     placeholder="工作类型">
 | 
	
		
			
				|  |  | -            <el-option label="哈哈哈"
 | 
	
		
			
				|  |  | -                       value="1"></el-option>
 | 
	
		
			
				|  |  | +          <el-select v-model.trim="searchForm.organId"
 | 
	
		
			
				|  |  | +                     placeholder="请选择分部"
 | 
	
		
			
				|  |  | +                     filterable
 | 
	
		
			
				|  |  | +                     clearable>
 | 
	
		
			
				|  |  | +            <el-option v-for="item in userBranchList"
 | 
	
		
			
				|  |  | +                       :key="item.value"
 | 
	
		
			
				|  |  | +                       :label="item.label"
 | 
	
		
			
				|  |  | +                       :value="item.value"></el-option>
 | 
	
		
			
				|  |  |            </el-select>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |          <el-form-item>
 | 
	
		
			
				|  |  | -          <el-input suffix-icon="el-icon-search"
 | 
	
		
			
				|  |  | -                    placeholder="请输入搜索内容"></el-input>
 | 
	
		
			
				|  |  | +          <el-button @click="search"
 | 
	
		
			
				|  |  | +                     type="danger">搜索</el-button>
 | 
	
		
			
				|  |  | +          <el-button @click="onReSet"
 | 
	
		
			
				|  |  | +                     type="primary">重置</el-button>
 | 
	
		
			
				|  |  | +          <!-- export/isSettlementCourseSalarys  v-permission="'export/exercisesSituations'"-->
 | 
	
		
			
				|  |  | +          <el-button @click="onExport"
 | 
	
		
			
				|  |  | +                     type="primary">导出</el-button>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |        </el-form>
 | 
	
		
			
				|  |  | -      <div class="searchWrap">
 | 
	
		
			
				|  |  | -        <p>查询条件:</p>
 | 
	
		
			
				|  |  | -        <div class="searchItem"
 | 
	
		
			
				|  |  | -             @click="closeSearch(item)"
 | 
	
		
			
				|  |  | -             v-for="(item,index) in searchLsit">
 | 
	
		
			
				|  |  | -          {{ item.key }}
 | 
	
		
			
				|  |  | -          <i class="el-icon-close"></i>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -      </div> -->
 | 
	
		
			
				|  |  | +      <div @click="openTeaching('create')"
 | 
	
		
			
				|  |  | +           v-permission="'cooperationOrgan/add'"
 | 
	
		
			
				|  |  | +           class='newBand'>新建</div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        <!-- 列表 -->
 | 
	
		
			
				|  |  |        <div class="tableWrap">
 | 
	
		
			
				|  |  |          <el-table :data='tableList'
 | 
	
	
		
			
				|  | @@ -45,6 +46,15 @@
 | 
	
		
			
				|  |  |                             label="单位名称">
 | 
	
		
			
				|  |  |            </el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column align='center'
 | 
	
		
			
				|  |  | +                           prop='name'
 | 
	
		
			
				|  |  | +                           label="所属分部">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <div>
 | 
	
		
			
				|  |  | +                {{ scope.row.organization.name }}
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align='center'
 | 
	
		
			
				|  |  |                             prop='linkman'
 | 
	
		
			
				|  |  |                             label="联系人">
 | 
	
		
			
				|  |  |            </el-table-column>
 | 
	
	
		
			
				|  | @@ -56,6 +66,14 @@
 | 
	
		
			
				|  |  |                             prop='mobileNo'
 | 
	
		
			
				|  |  |                             label="手机号">
 | 
	
		
			
				|  |  |            </el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align='center'
 | 
	
		
			
				|  |  | +                           label="状态">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <div>
 | 
	
		
			
				|  |  | +                {{scope.row.isEnable?'开启':'关闭'}}
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  |            <!-- <el-table-column align='center' prop='ownershipType'
 | 
	
		
			
				|  |  |                             label="权属类型">
 | 
	
		
			
				|  |  |              <template slot-scope="scope">
 | 
	
	
		
			
				|  | @@ -108,6 +126,18 @@
 | 
	
		
			
				|  |  |                         :value="item.value"></el-option>
 | 
	
		
			
				|  |  |            </el-select>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item label="状态"
 | 
	
		
			
				|  |  | +                      prop="isEnable"
 | 
	
		
			
				|  |  | +                      :label-width="formLabelWidth">
 | 
	
		
			
				|  |  | +          <el-select v-model.trim="form.isEnable"
 | 
	
		
			
				|  |  | +                     filterable
 | 
	
		
			
				|  |  | +                     clearable>
 | 
	
		
			
				|  |  | +            <el-option label="开启"
 | 
	
		
			
				|  |  | +                       :value="true"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="关闭"
 | 
	
		
			
				|  |  | +                       :value="false"></el-option>
 | 
	
		
			
				|  |  | +          </el-select>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  |          <el-form-item label="联系人"
 | 
	
		
			
				|  |  |                        prop="linkman"
 | 
	
		
			
				|  |  |                        :label-width="formLabelWidth">
 | 
	
	
		
			
				|  | @@ -147,8 +177,12 @@
 | 
	
		
			
				|  |  |  import pagination from '@/components/Pagination/index'
 | 
	
		
			
				|  |  |  import { cooperationOrganAdd, cooperationOrganUpdate, cooperationOrganDel, queryPage } from '@/api/systemManage'
 | 
	
		
			
				|  |  |  import { getEmployeeOrgan } from '@/api/buildTeam'
 | 
	
		
			
				|  |  | +import cleanDeep from 'clean-deep'
 | 
	
		
			
				|  |  |  import store from '@/store'
 | 
	
		
			
				|  |  |  import { isvalidPhone } from '@/utils/validate'
 | 
	
		
			
				|  |  | +import { getToken } from "@/utils/auth";
 | 
	
		
			
				|  |  | +import qs from "qs";
 | 
	
		
			
				|  |  | +import axios from "axios";
 | 
	
		
			
				|  |  |  let validPhone = (rule, value, callback) => {
 | 
	
		
			
				|  |  |    if (!value) {
 | 
	
		
			
				|  |  |      callback(new Error('请输入电话号码'))
 | 
	
	
		
			
				|  | @@ -156,7 +190,7 @@ let validPhone = (rule, value, callback) => {
 | 
	
		
			
				|  |  |      callback(new Error('请输入正确的11位手机号码'))
 | 
	
		
			
				|  |  |    } else {
 | 
	
		
			
				|  |  |      callback()
 | 
	
		
			
				|  |  | -  } 
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: 'branchManager',
 | 
	
	
		
			
				|  | @@ -164,7 +198,7 @@ export default {
 | 
	
		
			
				|  |  |    data () {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        searchForm: {
 | 
	
		
			
				|  |  | -        status: ''
 | 
	
		
			
				|  |  | +        organId: null
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        searchLsit: [],
 | 
	
		
			
				|  |  |        tableList: [],
 | 
	
	
		
			
				|  | @@ -196,9 +230,10 @@ export default {
 | 
	
		
			
				|  |  |          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' },,{pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号',trigger: 'blur' }],
 | 
	
		
			
				|  |  | -        organId: [{ required: true, message: '请选择所属分部', trigger: 'change' }]
 | 
	
		
			
				|  |  | +        mobileNo: [{ required: true, validator: validPhone, trigger: 'blur' }, , { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }],
 | 
	
		
			
				|  |  | +        organId: [{ required: true, message: '请选择所属分部', trigger: 'change' }],
 | 
	
		
			
				|  |  |          // ownershipType: [{ required: true, message: '请选择权属类型', trigger: 'change' }]
 | 
	
		
			
				|  |  | +        isEnable: [{ required: true, message: '请选择状态', trigger: 'change' }]
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -237,6 +272,57 @@ export default {
 | 
	
		
			
				|  |  |        }).catch(() => { });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    search () {
 | 
	
		
			
				|  |  | +      this.pageInfo.page = 1;
 | 
	
		
			
				|  |  | +      this.getList()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onReSet () { },
 | 
	
		
			
				|  |  | +    onExport () {
 | 
	
		
			
				|  |  | +      let url = "/api-web/export/cooperationOrgan";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      const options = {
 | 
	
		
			
				|  |  | +        method: "POST",
 | 
	
		
			
				|  |  | +        headers: {
 | 
	
		
			
				|  |  | +          Authorization: getToken()
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        data: qs.stringify(cleanDeep(this.searchForm)),
 | 
	
		
			
				|  |  | +        url,
 | 
	
		
			
				|  |  | +        responseType: "blob"
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +      this.$confirm("您确定导出合作单位", "提示", {
 | 
	
		
			
				|  |  | +        confirmButtonText: "确定",
 | 
	
		
			
				|  |  | +        cancelButtonText: "取消",
 | 
	
		
			
				|  |  | +        type: "warning"
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +        .then(() => {
 | 
	
		
			
				|  |  | +          axios(options).then(res => {
 | 
	
		
			
				|  |  | +            let blob = new Blob([res.data], {
 | 
	
		
			
				|  |  | +              // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
 | 
	
		
			
				|  |  | +              type: "application/vnd.ms-excel;charset=utf-8"
 | 
	
		
			
				|  |  | +              //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +            let objectUrl = URL.createObjectURL(blob);
 | 
	
		
			
				|  |  | +            let link = document.createElement("a");
 | 
	
		
			
				|  |  | +            let nowTime = new Date();
 | 
	
		
			
				|  |  | +            let ymd =
 | 
	
		
			
				|  |  | +              nowTime.getFullYear() +
 | 
	
		
			
				|  |  | +              "" +
 | 
	
		
			
				|  |  | +              (nowTime.getMonth() + 1) +
 | 
	
		
			
				|  |  | +              "" +
 | 
	
		
			
				|  |  | +              nowTime.getDate() +
 | 
	
		
			
				|  |  | +              "" +
 | 
	
		
			
				|  |  | +              nowTime.getHours() +
 | 
	
		
			
				|  |  | +              "" +
 | 
	
		
			
				|  |  | +              nowTime.getMinutes();
 | 
	
		
			
				|  |  | +            let fname = +ymd + "合作单位"; //下载文件的名字
 | 
	
		
			
				|  |  | +            link.href = objectUrl;
 | 
	
		
			
				|  |  | +            link.setAttribute("download", fname);
 | 
	
		
			
				|  |  | +            document.body.appendChild(link);
 | 
	
		
			
				|  |  | +            link.click();
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        .catch(() => { });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      onTeachingSubmit (formName) { // 添加数据
 | 
	
		
			
				|  |  |        this.$refs[formName].validate((valid) => {
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
	
		
			
				|  | @@ -246,7 +332,7 @@ export default {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              cooperationOrganAdd(this.form).then(res => {
 | 
	
		
			
				|  |  |                if (res.code == 200) {
 | 
	
		
			
				|  |  | -                this.$message.success('修改成功')
 | 
	
		
			
				|  |  | +                this.$message.success('创建成功')
 | 
	
		
			
				|  |  |                  this.teachingStatus = false
 | 
	
		
			
				|  |  |                  this.getList()
 | 
	
		
			
				|  |  |                } else {
 | 
	
	
		
			
				|  | @@ -272,7 +358,8 @@ export default {
 | 
	
		
			
				|  |  |      getList () {
 | 
	
		
			
				|  |  |        queryPage({
 | 
	
		
			
				|  |  |          rows: this.pageInfo.limit,
 | 
	
		
			
				|  |  | -        page: this.pageInfo.page
 | 
	
		
			
				|  |  | +        page: this.pageInfo.page,
 | 
	
		
			
				|  |  | +        ...this.searchForm
 | 
	
		
			
				|  |  |        }).then(res => {
 | 
	
		
			
				|  |  |          if (res.code == 200 && res.data) {
 | 
	
		
			
				|  |  |            this.tableList = res.data.rows
 | 
	
	
		
			
				|  | @@ -293,7 +380,8 @@ export default {
 | 
	
		
			
				|  |  |            job: rows.job,  // 费用
 | 
	
		
			
				|  |  |            mobileNo: rows.mobileNo ? rows.mobileNo : null,
 | 
	
		
			
				|  |  |            ownershipType: rows.ownershipType,
 | 
	
		
			
				|  |  | -          organId: rows.organId
 | 
	
		
			
				|  |  | +          organId: rows.organId,
 | 
	
		
			
				|  |  | +          isEnable: rows.isEnable
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -306,7 +394,8 @@ export default {
 | 
	
		
			
				|  |  |          job: null,  // 费用
 | 
	
		
			
				|  |  |          mobileNo: null,
 | 
	
		
			
				|  |  |          // ownershipType: null,
 | 
	
		
			
				|  |  | -        organId: null
 | 
	
		
			
				|  |  | +        organId: null,
 | 
	
		
			
				|  |  | +        isEnable: null
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        this.$refs[formName].resetFields()
 | 
	
		
			
				|  |  |      }
 |