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.

244 lines
8.0 KiB

5 years ago
2 years ago
5 years ago
2 years ago
5 years ago
4 years ago
5 years ago
4 years ago
2 years ago
5 years ago
2 years ago
5 years ago
2 years ago
5 years ago
4 years ago
4 years ago
  1. import axios from '@/utils/request'
  2. import config from '@/api/mdp_pub/mdp_config'
  3. let base = config.getSysContext()
  4. /**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */
  5. /**
  6. * 管理端机构表机构下面若干部门
  7. *1 默认只开放普通查询所有查询只要上传 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录数如果是0后台会自动计算总记录数非0不会自动计算}后台都会自动按分页查询 其它 api用到再打开没用到的api请注释掉
  8. *2 查询新增修改的参数格式 params={id:'机构编号 主键',branchName:'机构名称',enabled:'是否可用',industryCategory:'行业分类',cuserid:'创建人编号-可以转让,创建人与机构管理员有同样的权限',cdate:'创建日期',cusername:'创建人姓名-可以转让',lphoneNo:'联系电话',emaill:'邮件',bizProcInstId:'当前流程实例编号',bizFlowState:'当前流程状态',pbranchId:'上级机构',admUserid:'管理员编号(==机构编号,不允许修改,即机构主账户)',admUsername:'管理员名称(==机构名称+'管理员',不允许修改)',lusername:'联系人姓名',luserid:'联系人编号',address:'公司地址',btype:'机构类别0-个人虚拟机构,1-实体机构,个人虚拟机构的话sys_branch表没有真正的机构数据',imgUrl:'企业头像',bcode:'税号-统一信用识别号',blicense:'营业执照图片',legalPerson:'法人名称',regCapital:'注册资本',remark:'企业简介',validLvls:'人工验证结果,当审核状态为2时,同步到sys_user表同一个字段,或者sys_branch同一个字段'}
  9. **/
  10. //普通查询 条件之间and关系
  11. export const listBranch = params => { return axios.get(`${base}/mdp/sys/branch/list`, { params: params }); };
  12. //普通查询 条件之间and关系
  13. export const queryBranchById = params => { return axios.get(`${base}/mdp/sys/branch/queryById`, { params: params }); };
  14. //删除一条管理端机构表(机构下面若干部门) params={id:'机构编号 主键'}
  15. export const delBranch = params => { return axios.post(`${base}/mdp/sys/branch/del`,params); };
  16. //批量删除管理端机构表(机构下面若干部门) params=[{id:'机构编号 主键'}]
  17. export const batchAddBranch = params => { return axios.post(`${base}/mdp/sys/branch/batchAdd`, params); };
  18. //批量删除管理端机构表(机构下面若干部门) params=[{id:'机构编号 主键'}]
  19. export const batchDelBranch = params => { return axios.post(`${base}/mdp/sys/branch/batchDel`, params); };
  20. //修改一条管理端机构表(机构下面若干部门)记录
  21. export const editBranch = params => { return axios.post(`${base}/mdp/sys/branch/edit`, params); };
  22. //新增一条管理端机构表(机构下面若干部门)
  23. export const addBranch = params => { return axios.post(`${base}/mdp/sys/branch/add`, params); };
  24. //批量修改某些字段
  25. export const editSomeFieldsBranch = params => { return axios.post(`${base}/mdp/sys/branch/editSomeFields`, params); };
  26. export const initUserCountPieChart=(that)=>{
  27. var chartDom = document.getElementById('userCountPieChart');
  28. var myChart = that.$echarts.init(chartDom);
  29. var option;
  30. var branchInterestsDetail = that.branchInterestsDetail;
  31. if(!branchInterestsDetail){
  32. branchInterestsDetail={
  33. currUsers:1,
  34. maxUsers:10
  35. }
  36. }
  37. var currUsers= parseInt(branchInterestsDetail.currUsers)
  38. var maxUsers=parseInt(branchInterestsDetail.maxUsers);
  39. var syUsers=maxUsers-currUsers;
  40. if(syUsers<0){
  41. syUsers=0
  42. }
  43. option = {
  44. title: {
  45. text: currUsers+"/"+ maxUsers,
  46. left: "center",
  47. top: "50%",
  48. textStyle: {
  49. textAlign: "center",
  50. fill: "#333",
  51. fontSize: 14,
  52. fontWeight: 200,
  53. }
  54. },
  55. graphic: {
  56. type: "text",
  57. left: "center",
  58. top: "40%",
  59. style: {
  60. text: "剩余"+syUsers,
  61. textAlign: "center",
  62. fill: "#333",
  63. fontSize: 10,
  64. }
  65. },
  66. tooltip: {
  67. trigger: 'item'
  68. },
  69. legend: {
  70. top: '5%',
  71. left: 'center'
  72. },
  73. series: [
  74. {
  75. name: '账户数量',
  76. type: 'pie',
  77. radius: ['40%', '70%'],
  78. avoidLabelOverlap: false,
  79. label: {
  80. show: false,
  81. position: 'center'
  82. },
  83. emphasis: {
  84. label: {
  85. show: false,
  86. fontSize: '40',
  87. fontWeight: 'bold'
  88. }
  89. },
  90. labelLine: {
  91. show: false
  92. },
  93. data: [
  94. { value: currUsers , name: '已使用' },
  95. { value: syUsers , name: '未使用' },
  96. ]
  97. }
  98. ]
  99. };
  100. option && myChart.setOption(option);
  101. };
  102. export const initProductCountPieChart=(that)=>{
  103. var chartDom = document.getElementById('productCountPieChart');
  104. var myChart = that.$echarts.init(chartDom);
  105. var option;
  106. var calcBranchModule=that.calcBranchModule
  107. var allModules=calcBranchModule.allModules
  108. var freeModules=calcBranchModule.freeModules
  109. var hadModules=calcBranchModule.hadModules
  110. var yktModules=hadModules+freeModules
  111. var syModules=allModules-freeModules-hadModules
  112. option = {
  113. title: {
  114. text: yktModules + " / "+allModules,
  115. left: "center",
  116. top: "50%",
  117. textStyle: {
  118. textAlign: "center",
  119. fill: "#333",
  120. fontSize: 18,
  121. fontWeight: 200,
  122. }
  123. },
  124. graphic: {
  125. type: "text",
  126. left: "center",
  127. top: "40%",
  128. style: {
  129. text: "未开通"+syModules,
  130. textAlign: "center",
  131. fill: "#333",
  132. fontSize: 10,
  133. }
  134. },
  135. tooltip: {
  136. trigger: 'item'
  137. },
  138. legend: {
  139. top: '5%',
  140. left: 'center'
  141. },
  142. series: [
  143. {
  144. name: '产品数量',
  145. type: 'pie',
  146. radius: ['40%', '70%'],
  147. avoidLabelOverlap: false,
  148. label: {
  149. show: false,
  150. position: 'center'
  151. },
  152. emphasis: {
  153. label: {
  154. show: false,
  155. fontSize: '40',
  156. fontWeight: 'bold'
  157. }
  158. },
  159. labelLine: {
  160. show: false
  161. },
  162. data: [
  163. { value: freeModules, name: '已免费开通' },
  164. { value: hadModules, name: '已付费开通' },
  165. { value: syModules, name: '未开通' },
  166. ]
  167. }
  168. ]
  169. };
  170. option && myChart.setOption(option);
  171. };
  172. export const initEndTimePieChart=(that)=>{
  173. var chartDom = document.getElementById('endTimePieChart');
  174. var myChart = that.$echarts.init(chartDom);
  175. var option;
  176. var branchInterestsDetail=that.branchInterestsDetail;
  177. option = {
  178. title: {
  179. text: branchInterestsDetail.maxRtime||"永久有效",
  180. left: "center",
  181. top: "45%",
  182. textStyle: {
  183. textAlign: "center",
  184. fill: "#ee6666",
  185. fontSize: 14,
  186. fontWeight: 200,
  187. }
  188. },
  189. tooltip: {
  190. trigger: 'item'
  191. },
  192. legend: {
  193. top: '5%',
  194. left: 'center'
  195. },
  196. series: [
  197. {
  198. name: '有效期',
  199. type: 'pie',
  200. radius: ['40%', '70%'],
  201. avoidLabelOverlap: false,
  202. label: {
  203. show: false,
  204. position: 'center'
  205. },
  206. emphasis: {
  207. label: {
  208. show: false,
  209. fontSize: '40',
  210. fontWeight: 'bold'
  211. }
  212. },
  213. labelLine: {
  214. show: false
  215. },
  216. data: [
  217. { value: 0, name: '有效期' },
  218. ]
  219. }
  220. ]
  221. };
  222. option && myChart.setOption(option);
  223. };