baseInfo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <div class='basea-container'>
  3. <div class="baseTop">
  4. <div class="left">
  5. <!-- <el-form :inline="true"
  6. class="form-list"
  7. label-width="110px"
  8. :model="topForm">
  9. <el-form-item label="乐团编号">
  10. <el-input v-model.trim="topForm.num"
  11. disabled></el-input>
  12. </el-form-item>
  13. <el-form-item label="乐团主管">
  14. <el-input v-model.trim="topForm.teacher"
  15. disabled></el-input>
  16. </el-form-item>
  17. <el-form-item label="所属分部">
  18. <el-input v-model.trim="topForm.section"
  19. disabled></el-input>
  20. </el-form-item>
  21. <el-form-item label="乐队指导">
  22. <el-input v-model.trim="topForm.boss"
  23. disabled></el-input>
  24. </el-form-item>
  25. <el-form-item label="运营主管">
  26. <el-input v-model.trim="topForm.teamTeacherName"
  27. disabled></el-input>
  28. </el-form-item>
  29. <el-form-item label="维修技师">
  30. <el-input v-model.trim="topForm.repairUserName"
  31. disabled></el-input>
  32. </el-form-item>
  33. <el-form-item label="合作单位">
  34. <el-input v-model.trim="topForm.cooperate"
  35. disabled></el-input>
  36. </el-form-item>
  37. <el-form-item label="机构类型">
  38. <el-input v-model.trim="topForm.ownershipType"
  39. disabled></el-input>
  40. </el-form-item>
  41. <el-form-item label="收费类型">
  42. <el-input v-model.trim="topForm.type"
  43. disabled></el-input>
  44. </el-form-item>
  45. <el-form-item label="缴费方式"
  46. prop="paymentPattern">
  47. <el-select placeholder="缴费方式"
  48. style="width: 220px"
  49. clearable
  50. filterable
  51. disabled
  52. v-model.trim="topForm.paymentPattern">
  53. <el-option :value="0"
  54. label="按月"></el-option>
  55. <el-option :value="1"
  56. label="按季"></el-option>
  57. <el-option :value="2"
  58. label="一次性"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="上课地点">
  62. <el-input v-model.trim="topForm.add"
  63. type="textarea"
  64. disabled></el-input>
  65. </el-form-item>
  66. </el-form> -->
  67. <teambaseinfo />
  68. <div class="wrap">
  69. <el-button type="text"
  70. v-if="lookType!=='look'"
  71. v-permission="'order/musicalListExport'"
  72. @click="musicalListExport">订货清单导出</el-button>
  73. <el-button type="text"
  74. v-if="lookType!=='look'"
  75. v-permission="'order/musicalListDetailExport'"
  76. @click="musicalListDetailExport">分发清单导出</el-button>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import { getMusicGroup, getMusicGroupProcess } from '@/api/buildTeam'
  84. import teambaseinfo from '@/views/teamBuild/components/teamBaseInfo'
  85. import axios from 'axios'
  86. import qs from 'qs'
  87. import {
  88. getToken
  89. } from '@/utils/auth'
  90. import load from '@/utils/loading'
  91. export default {
  92. components:{teambaseinfo},
  93. name: "tbaseInfo",
  94. data () {
  95. return {
  96. id: '',
  97. topForm: {
  98. num: '',
  99. teacher: '',
  100. section: '',
  101. paymentPattern: '',
  102. paymentValidStartDate: '',
  103. paymentValidEndDate: '',
  104. boss: '',
  105. cooperate: '',
  106. add: '',
  107. type: '',
  108. salary: '',
  109. teamTeacherName:'',
  110. ownershipType:'',
  111. repairUserName:''
  112. },
  113. name: '',
  114. processList: [],
  115. lookType: ''
  116. }
  117. },
  118. created () {
  119. // this.init()
  120. },
  121. activated () {
  122. // this.init()
  123. },
  124. methods: {
  125. // init () {
  126. // this.teamid = this.$route.query.id;
  127. // this.lookType = this.$route.query.type
  128. // getMusicGroup({
  129. // musicGroupId: this.teamid
  130. // }).then(res => {
  131. // if (res.code == 200) {
  132. // this.topForm.num = res.data.id;
  133. // this.topForm.teacher = res.data.educationalTeacherName;
  134. // this.topForm.boss = res.data.directorUserName;
  135. // this.topForm.paymentPattern = res.data.paymentPattern;
  136. // this.topForm.paymentValidStartDate = res.data.paymentValidStartDate;
  137. // this.topForm.paymentValidEndDate = res.data.paymentValidEndDate;
  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. // this.topForm.teamTeacherName = res.data.teamTeacherName
  143. // this.topForm.ownershipType = res.data.ownershipType
  144. // this.topForm.repairUserName = res.data.repairUserName
  145. // // 差上课地点
  146. // this.$emit('getname', res.data.name)
  147. // }
  148. // })
  149. // },
  150. musicalListExport () { // 报表导出
  151. let url = '/api-web/order/musicalListExport'
  152. let data = {
  153. musicGroupId: this.$route.query.id,
  154. }
  155. const options = {
  156. method: 'POST',
  157. headers: {
  158. 'Authorization': getToken()
  159. },
  160. data: qs.stringify(data),
  161. url,
  162. responseType: 'blob'
  163. }
  164. this.$confirm('您确定导出订货清单', '提示', {
  165. confirmButtonText: '确定',
  166. cancelButtonText: '取消',
  167. type: 'warning'
  168. }).then(() => {
  169. load.startLoading()
  170. axios(options).then(res => {
  171. let blob = new Blob([res.data], {
  172. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  173. type: 'application/vnd.ms-excel;charset=utf-8'
  174. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  175. })
  176. let text = (new Response(blob)).text()
  177. text.then(res => {
  178. // 判断是否报错
  179. if (res.indexOf('code') != -1) {
  180. let json = JSON.parse(res)
  181. this.$message.error(json.msg)
  182. } else {
  183. let objectUrl = URL.createObjectURL(blob)
  184. let link = document.createElement("a")
  185. let nowTime = new Date()
  186. let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' +
  187. nowTime.getHours() +
  188. '' + nowTime.getMinutes()
  189. let fname = this.$route.query.id + '-' + ymd + '订货清单' //下载文件的名字
  190. link.href = objectUrl
  191. link.setAttribute("download", fname)
  192. document.body.appendChild(link)
  193. link.click()
  194. }
  195. })
  196. load.endLoading();
  197. }).catch(error => {
  198. this.$message.error('导出数据失败,请联系管理员');
  199. load.endLoading();
  200. })
  201. }).catch(() => { })
  202. },
  203. musicalListDetailExport () { // 报表导出
  204. let url = '/api-web/order/musicalListDetailExport'
  205. let data = {
  206. musicGroupId: this.$route.query.id
  207. }
  208. const options = {
  209. method: 'POST',
  210. headers: {
  211. 'Authorization': getToken()
  212. },
  213. data: qs.stringify(data),
  214. url,
  215. responseType: 'blob'
  216. }
  217. this.$confirm('您确定导出分发清单', '提示', {
  218. confirmButtonText: '确定',
  219. cancelButtonText: '取消',
  220. type: 'warning'
  221. }).then(() => {
  222. load.startLoading()
  223. axios(options).then(res => {
  224. let blob = new Blob([res.data], {
  225. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  226. type: 'application/vnd.ms-excel;charset=utf-8'
  227. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  228. })
  229. let text = (new Response(blob)).text()
  230. text.then(res => {
  231. // 判断是否报错
  232. if (res.indexOf('code') != -1) {
  233. let json = JSON.parse(res)
  234. this.$message.error(json.msg)
  235. } else {
  236. let objectUrl = URL.createObjectURL(blob)
  237. let link = document.createElement("a")
  238. let nowTime = new Date()
  239. let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' +
  240. nowTime.getHours() +
  241. '' + nowTime.getMinutes()
  242. let fname = this.$route.query.id + '-' + ymd + '分发清单' //下载文件的名字
  243. link.href = objectUrl
  244. link.setAttribute("download", fname)
  245. document.body.appendChild(link)
  246. link.click()
  247. }
  248. })
  249. load.endLoading();
  250. }).catch(error => {
  251. this.$message.error('导出数据失败,请联系管理员');
  252. load.endLoading();
  253. })
  254. }).catch(() => { })
  255. }
  256. },
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .basea-container {
  261. margin-top: 35px;
  262. .baseTop {
  263. display: flex;
  264. flex-direction: row;
  265. justify-content: space-between;
  266. }
  267. .baseBottom {
  268. margin-top: 40px;
  269. display: flex;
  270. flex-direction: column;
  271. justify-content: center;
  272. align-items: center;
  273. .code {
  274. width: 300px;
  275. height: 300px;
  276. background-color: red;
  277. margin-bottom: 20px;
  278. }
  279. .btnList {
  280. width: 300px;
  281. display: flex;
  282. flex-direction: row;
  283. justify-content: space-between;
  284. margin-top: 60px;
  285. div {
  286. cursor: pointer;
  287. width: 120px;
  288. height: 40px;
  289. line-height: 40px;
  290. border-radius: 4px;
  291. color: #fff;
  292. text-align: center;
  293. }
  294. .closeBtn {
  295. background-color: #777;
  296. }
  297. .okBtn {
  298. background-color: #f97215;
  299. }
  300. }
  301. }
  302. .form-list{
  303. /deep/ .el-form-item__content{
  304. width: 220px;
  305. .el-select{
  306. width: 100%!important;
  307. }
  308. .el-textarea.is-disabled .el-textarea__inner{
  309. color: #606266;
  310. }
  311. }
  312. }
  313. .wrap {
  314. padding-left: 60px;
  315. }
  316. }
  317. </style>