You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

252 lines
16 KiB

2 years ago
  1. <template>
  2. <section class="border padding">
  3. <el-row>
  4. <el-input v-model="filters.branchId" style="width: 20%;" placeholder="编号查询 输入 *陈* >10 <9 等" clearable title="支持>、<、 >=、<=、!=、*陈*、$IS NULL、$IN 1,2,3、between 1,5等操作符"></el-input>
  5. <el-input v-model="filters.branchName" style="width: 20%;" placeholder="名称查询 输入 *陈* >10 <9 等" clearable title="支持>、<、 >=、<=、!=、*陈*、$IS NULL、$IN 1,2,3、between 1,5等操作符"></el-input>
  6. <el-input v-model="filters.bcode" style="width: 20%;" placeholder="统一信用识别号查询 输入 *陈* >10 <9 等" clearable title="支持>、<、 >=、<=、!=、*陈*、$IS NULL、$IN 1,2,3、between 1,5等操作符"></el-input>
  7. <el-button v-loading="load.list" :disabled="load.list==true" @click="searchTableDatas()" icon="el-icon-search" type="primary">查询</el-button>
  8. <span style="float:right;" v-if="currOpType=='mng'">
  9. <el-button :disabled="disabledJudge('addBtn') || !checkBtnQx('addBtn',menuDefId) " type="primary" @click="openForm({parentOpType:currOpType,subOpType:'add',formData:addForm})" icon="el-icon-plus"> </el-button>
  10. <el-button :disabled="disabledJudge('delBtn') || !checkBtnQx('delBtn',menuDefId) || this.sels.length===0 || load.del==true" type="danger" v-loading="load.del" @click="batchDel" icon="el-icon-delete"></el-button>
  11. </span>
  12. <span style="float:right;" v-else-if="currOpType=='select' && this.multiple==true">
  13. <el-button :disabled="disabledJudge('selectBtn') || this.sels.length===0" type="primary" @click="selectListConfirm" icon="el-icon-check"></el-button>
  14. </span>
  15. </el-row>
  16. <el-row>
  17. <mdp-hi-query type="text" :column-configs="columnConfigs" v-model="hiQueryParams" @change="onHiQueryParamsChange"/>
  18. <el-button type="text" icon="el-icon-zoom-out" @click="searchReset()">重置查询</el-button>
  19. </el-row>
  20. <el-row>
  21. <!--列表 Branch 管理端机构表机构下面若干部门-->
  22. <el-table :ref="refId+'Table'" :height="100" v-adaptive="{bottomOffset: 50}" :data="tableDatas" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
  23. <el-table-column type="selection" width="55" show-overflow-tooltip fixed="left" v-if="currOpType=='mng' || this.multiple==true"></el-table-column>
  24. <el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column>
  25. <el-table-column prop="id" label="机构编号" min-width="120" show-overflow-tooltip fixed="left" col-type="String" v-if="showCol('id')"></el-table-column>
  26. <el-table-column prop="branchName" label="机构名称" min-width="120" show-overflow-tooltip fixed="left" col-type="String" v-if="showCol('branchName')"></el-table-column>
  27. <el-table-column prop="bcode" label="统一信用识别号" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('bcode')"></el-table-column>
  28. <el-table-column prop="enabled" label="可用" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('enabled')">
  29. <template slot-scope="scope">
  30. <mdp-select show-style="tag" item-code="enabled" v-model="scope.row.enabled" @change="editSomeFields(scope.row,'enabled',$event)"/>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="industryCategory" label="行业分类" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('industryCategory')" >
  34. <template slot-scope="scope">
  35. <mdp-select show-style="tag" :disabled="false" item-code="industryCategory" v-model="scope.row.industryCategory" @change="editSomeFields(scope.row,'industryCategory',$event)"/>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="lphoneNo" label="联系电话" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('lphoneNo')"></el-table-column>
  39. <el-table-column prop="emaill" label="邮件" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('emaill')"></el-table-column>
  40. <el-table-column prop="bizFlowState" label="审批状态" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('bizFlowState')"></el-table-column>
  41. <el-table-column prop="legalPerson" label="法人名称" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('legalPerson')"></el-table-column>
  42. <el-table-column prop="regCapital" label="注册资本" min-width="120" show-overflow-tooltip col-type="BigDecimal" v-if="showCol('regCapital')"></el-table-column>
  43. <el-table-column prop="remark" label="企业简介" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('remark')"></el-table-column>
  44. <el-table-column prop="admUserid" label="管理员编号" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('admUserid')"></el-table-column>
  45. <el-table-column prop="admUsername" label="管理员名称" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('admUsername')"></el-table-column>
  46. <el-table-column prop="lusername" label="联系人姓名" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('lusername')"></el-table-column>
  47. <el-table-column prop="luserid" label="联系人编号" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('luserid')"></el-table-column>
  48. <el-table-column prop="address" label="公司地址" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('address')"></el-table-column>
  49. <el-table-column prop="imgUrl" label="企业头像" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('imgUrl')"></el-table-column>
  50. <el-table-column prop="blicense" label="营业执照图片" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('blicense')"></el-table-column>
  51. <el-table-column prop="validLvls" label="人工验证结果" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('validLvls')"></el-table-column>
  52. <el-table-column prop="cuserid" label="创建人编号" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('cuserid')"></el-table-column>
  53. <el-table-column prop="cdate" :is-common="true" label="创建日期" min-width="120" show-overflow-tooltip col-type="Date" v-if="showCol('cdate')"></el-table-column>
  54. <el-table-column prop="cusername" label="创建人姓名" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('cusername')"></el-table-column>
  55. <el-table-column prop="bizProcInstId" label="当前流程实例编号" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('bizProcInstId')"></el-table-column>
  56. <el-table-column prop="pbranchId" label="上级机构" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('pbranchId')"></el-table-column>
  57. <el-table-column prop="btype" label="机构类别" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('btype')"></el-table-column>
  58. <el-table-column prop="claimStatus" label="认领状态" min-width="120" show-overflow-tooltip col-type="String" v-if="showCol('claimStatus')"></el-table-column>
  59. <el-table-column label="操作" width="280" fixed="right">
  60. <template slot="header" slot-scope="scope">
  61. <el-button icon="el-icon-download" @click="export2Excel()">导出</el-button>
  62. <mdp-table-configs :column-configs="columnConfigs" v-model="checkedColumns"/>
  63. </template>
  64. <template scope="scope" v-if="currOpType=='mng'">
  65. <el-button v-if=" scope.row.claimStatus!='1' " :disabled="disabledJudge('editBtn') || !checkBtnQx('editBtn',menuDefId) " type="success" @click="branchClaim(scope.row)" icon="el-icon-s-check">认领</el-button>
  66. <el-button v-if="userInfo.branchId==scope.row.id || userInfo.isSuperAdmin " :disabled="disabledJudge('editBtn') || !checkBtnQx('editBtn',menuDefId) " type="primary" @click="openForm({parentOpType:currOpType,subOpType:'edit',formData:scope.row})" icon="el-icon-edit"></el-button>
  67. <el-button v-if="userInfo.branchId==scope.row.id || userInfo.isSuperAdmin " :disabled="disabledJudge('delBtn') || !checkBtnQx('delBtn',menuDefId) " type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></el-button>
  68. <el-button v-if="userInfo.branchId!=scope.row.id && !userInfo.isSuperAdmin " :disabled="disabledJudge('editBtn') || !checkBtnQx('editBtn',menuDefId) " type="primary" @click="openForm({parentOpType:currOpType,subOpType:'detail',formData:scope.row})" icon="el-icon-edit"></el-button>
  69. </template>
  70. <template scope="scope" v-else-if="currOpType=='mng' && userInfo.branchId!=scope.row.id" >
  71. <el-button :disabled="disabledJudge('editBtn') || !checkBtnQx('editBtn',menuDefId) " type="primary" @click="openForm({parentOpType:currOpType,subOpType:'detail',formData:scope.row})" icon="el-icon-edit"></el-button>
  72. </template>
  73. <template scope="scope" v-else-if="currOpType=='list'" >
  74. <el-button type="primary" @click="openForm({parentOpType:currOpType,subOpType:'detail',formData:scope.row})" icon="el-icon-view"></el-button>
  75. </template>
  76. <template scope="scope" v-else-if="currOpType=='select' && this.multiple!=true" >
  77. <el-button type="primary" @click="selectConfirm(scope.row)" icon="el-icon-view"></el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. </el-row>
  82. <el-row>
  83. <el-pagination
  84. layout="slot,total, sizes, prev, next,pager,jumper"
  85. @current-change="handleCurrentChange"
  86. @size-change="handleSizeChange"
  87. :page-sizes="[10,20, 50, 100, 500]"
  88. :current-page="pageInfo.pageNum"
  89. :page-size="pageInfo.pageSize"
  90. :total="pageInfo.total"
  91. style="float:right;"
  92. >
  93. </el-pagination>
  94. </el-row>
  95. <el-row>
  96. <!--新增修改明细 Branch 管理端机构表机构下面若干部门界面-->
  97. <mdp-dialog :ref="refId+'FormDialog'">
  98. <template v-slot="{visible,data}">
  99. <branch-form :ref="refId+'Form'" :show-btn="false" :sub-op-type="data.subOpType" :form-data="data.formData" :visible="visible" :parent-op-type="currOpType" @close="onFormClose" @submit="afterFormSubmit" @fields-change="afterEditSomeFields"/>
  100. </template>
  101. <template v-slot:footer="{data}">
  102. <el-button @click="$refs[refId+'FormDialog'].close()">关闭</el-button>
  103. <el-button v-if="data.subOpType=='add'" :disabled=" disabledJudge('addBtn') || !checkBtnQx('addBtn',menuDefId) " type="primary" @click="$refs[refId+'Form'].saveSubmit()">提交</el-button>
  104. </template>
  105. </mdp-dialog>
  106. </el-row>
  107. </section>
  108. </template>
  109. <script>
  110. import util from '@/components/mdp-ui/js/util';//全局公共库
  111. import { MdpTableMixin } from '@/components/mdp-ui/mixin/MdpTableMixin.js';
  112. import config from '@/api/mdp_pub/mdp_config';//全局公共库
  113. import * as BranchApi from '@/api/mdp/sys/branch';
  114. import BranchForm from './Form';//新增修改明细界面
  115. import { mapGetters } from 'vuex'
  116. import * as UserTpaInviteApi from '@/api/mdp/sys/userTpaInvite';
  117. export default {
  118. name:'branchMng',
  119. mixins:[MdpTableMixin],
  120. components: {
  121. BranchForm,
  122. },
  123. computed: {
  124. },
  125. watch:{
  126. },
  127. data() {
  128. return {
  129. menuDefId:'',//menu_def.id 菜单表菜单编号,用于按钮权限判断
  130. menuDefName:'管理端机构表(机构下面若干部门)',//menu_def.name 功能名称,用于导出excel等文件名
  131. refId:'branch',//引用编号,<table :ref="refId+'Table'"> <form :ref="refId+'Form'">
  132. pkNames:["id"],//表格主键的java属性名称,驼峰命名,默认为id,支持多主键
  133. currOpType:'mng',//表格 mng-综合管理具有最大权限,所有按钮可动、detail-只看不能操作
  134. filters:{//查询参数
  135. },
  136. defaultFilters:{//默认查询参数,第一次打开界面的时候用到,恢复默认值的时候用到
  137. },
  138. //增删改查(含批量)接口
  139. apis:{
  140. list: BranchApi.listBranch,
  141. add: BranchApi.addBranch,
  142. del: BranchApi.delBranch,
  143. edit: BranchApi.editBranch,
  144. editSomeFields: BranchApi.editSomeFieldsBranch,
  145. batchAdd: BranchApi.batchAddBranch,
  146. batchDel: BranchApi.batchDelBranch,
  147. batchEdit: BranchApi.batchEditBranch,
  148. }
  149. }
  150. },
  151. methods: {
  152. //页面初始化需要配置的特殊逻辑写这里
  153. initCurrData(){
  154. this.searchTableDatas();
  155. },
  156. /**
  157. * 检查参数是否满足调用后台接口的条件
  158. *
  159. * @param params 提交给后台的参数池,map类型
  160. * @returns true / false
  161. */
  162. preQueryParamCheck(params){
  163. return true;
  164. },
  165. //页面数据加载完后需要对数据进行加工处理的
  166. afterList(res,isOk,apiName){
  167. },
  168. /**
  169. * 对修改的字段进行判断返回false ,将取消更新数据库
  170. * @param {*} row 当前选中的行
  171. * @param {*} fieldName 修改的字段名
  172. * @param {*} $event 修改后的值
  173. * @param {*} params 将要提交服务器的参数
  174. * @returns true/false 返回false ,将取消更新数据库
  175. */
  176. editSomeFieldsCheck(row,fieldName,$event,params){
  177. if(this.currOpType=='add'||this.currOpType=='detail'){
  178. return false;
  179. }
  180. params[fieldName]=$event
  181. return true;
  182. },
  183. /**
  184. * 设置某个关键词按钮输入框禁用 disabledRules['addBtn']=false
  185. * 判断某个对象是否可编辑 this.disabledJudge('addBtn')==false
  186. */
  187. disabledRulesInit(disabledRules){
  188. if(this.currOpType=='list'){
  189. disabledRules.addBtn=true
  190. disabledRules.delBtn=true
  191. }
  192. },
  193. /**
  194. * 打开某个子页面
  195. */
  196. openForm(res){
  197. let {parentOpType,formRefId,subOpType,formData} = res
  198. if(!formRefId){
  199. formRefId=this.getRefId()+"FormDialog"
  200. }
  201. if(!parentOpType){
  202. parentOpType=this.currOpType
  203. }
  204. var form=this.$refs[formRefId]
  205. if(form){
  206. res.parentOpType=parentOpType
  207. res.formRefId=formRefId
  208. form.open(res);
  209. }else{
  210. }
  211. },
  212. branchClaim(branch){
  213. this.$confirm('请确保该企业确实属于您的企业,一旦成功,别人无法再次认领,确认认领企业【'+branch.branchName+'】吗?', '提示', {}).then(() => {
  214. var params={sendBranchId:branch.id,sendBranchName:branch.sendBranchName,joinUserid:this.userInfo.userid,joinUsername:this.userInfo.username,inviteScene:'4',inviteType:'1'}
  215. UserTpaInviteApi.createInviteId(params).then(res=>{
  216. var tips = res.data.tips;
  217. if(tips.isOk){
  218. this.$router.push({path:"/invite/code/"+res.data.data.inviteId})
  219. }else{
  220. this.$notify.error(tips.msg)
  221. }
  222. })
  223. })
  224. }
  225. },
  226. mounted() {
  227. }
  228. }
  229. </script>
  230. <style scoped>
  231. </style>