baseInfo.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <div class='basea-container'>
  3. <div class="baseTop">
  4. <div class="left">
  5. <el-form :inline="true"
  6. :model="topForm">
  7. <el-form-item label="乐团编号">
  8. <el-input v-model="topForm.num"
  9. disabled></el-input>
  10. </el-form-item>
  11. <el-form-item label="教务老师">
  12. <el-input v-model="topForm.teacher"
  13. disabled></el-input>
  14. <!-- <el-select>
  15. <el-option label="啦啦啦"
  16. value="1"></el-option>
  17. </el-select> -->
  18. </el-form-item>
  19. <el-form-item label="所属分部">
  20. <el-input v-model="topForm.section"
  21. disabled></el-input>
  22. <!-- <el-select v-model="topForm.section">
  23. <el-option label="啦啦啦"
  24. value="1"></el-option>
  25. </el-select> -->
  26. </el-form-item>
  27. <el-form-item label="乐队指导">
  28. <el-input v-model="topForm.boss"
  29. disabled></el-input>
  30. <!-- <el-select v-model="topForm.boss">
  31. <el-option label="啦啦啦"
  32. value="1"></el-option>
  33. </el-select> -->
  34. </el-form-item>
  35. <el-form-item label="合作单位">
  36. <el-input v-model="topForm.cooperate"
  37. disabled></el-input>
  38. <!-- <el-select v-model="topForm.cooperate">
  39. <el-option label="啦啦啦"
  40. value="1"></el-option>
  41. </el-select> -->
  42. </el-form-item>
  43. <el-form-item label="上课地点">
  44. <el-input v-model="topForm.add"
  45. disabled
  46. style="width:370px;"></el-input>
  47. </el-form-item>
  48. <el-form-item label="收费类型">
  49. <el-input v-model="topForm.type"
  50. disabled></el-input>
  51. <!-- <el-select v-model="topForm.type">
  52. <el-option label="啦啦啦"
  53. value="1"></el-option>
  54. </el-select> -->
  55. </el-form-item>
  56. <!-- <el-form-item label="课酬结算标准">
  57. <el-select v-model="topForm.salary">
  58. <el-option label="课时默认结算"
  59. value="TEACHER_DEFAULT"></el-option>
  60. <el-option label="课时梯度结算"
  61. value="GRADIENT_SALARY"></el-option>
  62. </el-select>
  63. </el-form-item> -->
  64. </el-form>
  65. <el-button type="text"
  66. v-permission="'order/musicalListExport'"
  67. @click="musicalListExport">发放清单导出</el-button>
  68. <el-button type="text"
  69. v-permission="'order/musicalListDetailExport'"
  70. @click="musicalListDetailExport">分发清单导出</el-button>
  71. </div>
  72. <div class="right">
  73. <ul>
  74. <li v-for="(item,index) in processList"
  75. :key='index'>{{ item.createTime}} {{ item.realName }} {{item.event}}</li>
  76. </ul>
  77. </div>
  78. </div>
  79. <!-- <div class="baseBottom">
  80. <div class="qrcode code"
  81. ref="qrCodeUrl"></div>
  82. <a href="#">www.baidu.com</a>
  83. </div> -->
  84. </div>
  85. </template>
  86. <script>
  87. import {
  88. getMusicGroup,
  89. getMusicGroupProcess
  90. } from '@/api/buildTeam'
  91. import QRCode from 'qrcodejs2'
  92. import axios from 'axios'
  93. import qs from 'qs'
  94. import {
  95. getToken
  96. } from '@/utils/auth'
  97. export default {
  98. name: "tbaseInfo",
  99. props: ['teamid'],
  100. data () {
  101. return {
  102. id: '',
  103. topForm: {
  104. num: '',
  105. teacher: '',
  106. section: '',
  107. boss: '',
  108. cooperate: '',
  109. add: '',
  110. type: '',
  111. salary: ''
  112. },
  113. name: '',
  114. processList: []
  115. }
  116. },
  117. created () {
  118. // 获取乐团基本信息
  119. // let teamid = '191014135135001';
  120. // this.creatQrCode();
  121. console.log(this.teamid + 'mounted')
  122. this.init()
  123. },
  124. activated () {
  125. console.log(this.teamid + 'activated')
  126. this.init()
  127. },
  128. methods: {
  129. init () {
  130. getMusicGroup({
  131. musicGroupId: this.teamid
  132. }).then(res => {
  133. if (res.code == 200) {
  134. this.topForm.num = res.data.id;
  135. // this.topForm.teacher = res.data.teamTeacherName;
  136. this.topForm.teacher = res.data.educationalTeacherName;
  137. this.topForm.boss = res.data.directorUserName;
  138. this.topForm.cooperate = res.data.schoolName;
  139. this.topForm.type = res.data.chargeTypeName;
  140. this.topForm.section = res.data.organName;
  141. this.topForm.add = res.data.address
  142. // 差上课地点
  143. this.$emit('getname', res.data.name)
  144. }
  145. })
  146. // 根据乐团id获取乐团流程
  147. getMusicGroupProcess({
  148. musicGroupId: this.teamid
  149. }).then(res => {
  150. if (res.code == 200) {
  151. this.processList = res.data;
  152. }
  153. })
  154. },
  155. creatQrCode () {
  156. var qrcode = new QRCode(this.$refs.qrCodeUrl, {
  157. text: 'http://www.baidu.com',
  158. width: 300,
  159. height: 300,
  160. colorDark: '#000000',
  161. colorLight: '#ffffff',
  162. correctLevel: QRCode.CorrectLevel.H
  163. })
  164. },
  165. musicalListExport () { // 报表导出
  166. let url = '/api-web/order/musicalListExport'
  167. let data = {}
  168. const options = {
  169. method: 'POST',
  170. headers: {
  171. 'Authorization': getToken()
  172. },
  173. data: qs.stringify(data),
  174. url,
  175. responseType: 'blob'
  176. }
  177. this.$confirm('您确定导出发放清单', '提示', {
  178. confirmButtonText: '确定',
  179. cancelButtonText: '取消',
  180. type: 'warning'
  181. }).then(() => {
  182. axios(options).then(res => {
  183. let blob = new Blob([res.data], {
  184. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  185. type: 'application/vnd.ms-excel;charset=utf-8'
  186. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  187. })
  188. let objectUrl = URL.createObjectURL(blob)
  189. let link = document.createElement("a")
  190. let nowTime = new Date()
  191. let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' +
  192. nowTime.getHours() +
  193. '' + nowTime.getMinutes()
  194. let fname = this.$route.query.id + '-' + ymd + '发放清单' //下载文件的名字
  195. link.href = objectUrl
  196. link.setAttribute("download", fname)
  197. document.body.appendChild(link)
  198. link.click()
  199. })
  200. }).catch(() => { })
  201. },
  202. musicalListDetailExport () { // 报表导出
  203. let url = '/api-web/order/musicalListDetailExport'
  204. let data = {
  205. musicGroupId: this.$route.query.id
  206. }
  207. const options = {
  208. method: 'POST',
  209. headers: {
  210. 'Authorization': getToken()
  211. },
  212. data: qs.stringify(data),
  213. url,
  214. responseType: 'blob'
  215. }
  216. this.$confirm('您确定导出分发清单', '提示', {
  217. confirmButtonText: '确定',
  218. cancelButtonText: '取消',
  219. type: 'warning'
  220. }).then(() => {
  221. axios(options).then(res => {
  222. let blob = new Blob([res.data], {
  223. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  224. type: 'application/vnd.ms-excel;charset=utf-8'
  225. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  226. })
  227. let objectUrl = URL.createObjectURL(blob)
  228. let link = document.createElement("a")
  229. let nowTime = new Date()
  230. let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' +
  231. nowTime.getHours() +
  232. '' + nowTime.getMinutes()
  233. let fname = this.$route.query.id + '-' + ymd + '分发清单' //下载文件的名字
  234. link.href = objectUrl
  235. link.setAttribute("download", fname)
  236. document.body.appendChild(link)
  237. link.click()
  238. })
  239. }).catch(() => { })
  240. }
  241. },
  242. }
  243. </script>
  244. <style lang="scss" scope>
  245. .basea-container {
  246. margin-top: 35px;
  247. .baseTop {
  248. display: flex;
  249. flex-direction: row;
  250. justify-content: space-between;
  251. .left {
  252. max-width: 750px;
  253. .el-select {
  254. width: 180px !important;
  255. }
  256. }
  257. .right {
  258. height: 40vh;
  259. overflow: scroll;
  260. ul {
  261. li {
  262. list-style: none;
  263. line-height: 22px;
  264. font-size: 14px;
  265. color: #aaa;
  266. }
  267. }
  268. &::-webkit-scrollbar {
  269. display: none;
  270. }
  271. }
  272. }
  273. .baseBottom {
  274. margin-top: 40px;
  275. display: flex;
  276. flex-direction: column;
  277. justify-content: center;
  278. align-items: center;
  279. .code {
  280. width: 300px;
  281. height: 300px;
  282. background-color: red;
  283. margin-bottom: 20px;
  284. }
  285. .btnList {
  286. width: 300px;
  287. display: flex;
  288. flex-direction: row;
  289. justify-content: space-between;
  290. margin-top: 60px;
  291. div {
  292. cursor: pointer;
  293. width: 120px;
  294. height: 40px;
  295. line-height: 40px;
  296. border-radius: 4px;
  297. color: #fff;
  298. text-align: center;
  299. }
  300. .closeBtn {
  301. background-color: #777;
  302. }
  303. .okBtn {
  304. background-color: #f97215;
  305. }
  306. }
  307. }
  308. }
  309. </style>