firm.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <!-- 创业公司登记 -->
  3. <div class="firm">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">创业公司登记</div>
  6. </div>
  7. <hr />
  8. <div class="twoSelectInp">
  9. <div class="selectTwo">
  10. <div class="selectsBlock">
  11. <el-input
  12. v-model="input"
  13. style="width: 200px"
  14. @change="getData"
  15. placeholder="请输入"
  16. ></el-input>
  17. <el-button type="primary" class="btn2" @click="getData">查询</el-button>
  18. </div>
  19. </div>
  20. <div class="upFile">
  21. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept">
  22. </beUpload>
  23. </div>
  24. </div>
  25. <div class="projectBlock">
  26. <el-table
  27. :data="tableData"
  28. tooltip-effect="dark"
  29. stripe
  30. class="fontSize"
  31. :header-cell-style="{ background: '#f2f2f2', color: '#000' }"
  32. >
  33. <el-table-column
  34. prop="startFile.fileName"
  35. label="文件名称"
  36. align="center"
  37. min-width="25%"
  38. >
  39. </el-table-column>
  40. <el-table-column
  41. prop="create_at"
  42. label="上传时间"
  43. align="center"
  44. min-width="25%"
  45. >
  46. </el-table-column>
  47. <el-table-column
  48. prop="startFile.size"
  49. label="文件大小"
  50. align="center"
  51. min-width="20%"
  52. >
  53. </el-table-column>
  54. <el-table-column
  55. prop="operation"
  56. label="操作"
  57. align="center"
  58. min-width="30%"
  59. >
  60. <template #default="scope">
  61. <div class="operations">
  62. <el-button
  63. type="primary"
  64. class="bt1"
  65. size="mini"
  66. @click="checkFile(scope.row.startFile.url)"
  67. >查看信息</el-button
  68. >
  69. <el-button
  70. type="primary"
  71. class="bt1"
  72. size="mini"
  73. @click="del(scope.row.startupId)"
  74. >删除</el-button
  75. >
  76. </div>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <!-- 分页 -->
  81. <el-pagination
  82. background
  83. @current-change="changePage"
  84. layout="prev, pager, next"
  85. :page-size="Page.lim"
  86. :total="Page.total"
  87. class="paginations"
  88. >
  89. </el-pagination>
  90. </div>
  91. <!-- 删除通知开始 -->
  92. <el-dialog
  93. title="删除文件"
  94. :visible.sync="dialogVisible1"
  95. width="600px"
  96. class="addDialog"
  97. >
  98. <div class="addDialogLogo">LOGO</div>
  99. <span class="deleteContent">确定删除文件?</span>
  100. <span slot="footer" class="dialog-footer">
  101. <el-button type="primary" @click="commitDel" class="btn5">确认删除</el-button>
  102. <el-button @click="dialogVisible1 = false" class="btn5">取消</el-button>
  103. </span>
  104. </el-dialog>
  105. <!-- 删除通知结束-->
  106. <!-- 展示文档开始 -->
  107. <el-dialog
  108. title="展示文件"
  109. :visible.sync="showFile"
  110. width="80vw"
  111. class="addDialog showDialog"
  112. >
  113. <div class="addDialogLogo">LOGO</div>
  114. <div class="showFileArea">
  115. <!-- <vpdf v-if="/^\s*$/g.test(showFileUrl)&&showFileUrl.split('.')[showFileUrl.split('.').length-1]=='pdf'" :pdfUrl="showFileUrl"></vpdf> -->
  116. <vword v-if="showFileType == 0" :pdfUrl="showFileUrl"></vword>
  117. <vpdf v-else :pdfUrl="showFileUrl"></vpdf>
  118. </div>
  119. </el-dialog>
  120. <!-- 展示文档结束 -->
  121. </div>
  122. </template>
  123. <script>
  124. import beUpload from "@/components/tool/beUpload.vue";
  125. import vpdf from "@/components/vpdf.vue";
  126. import vword from "@/components/vword.vue";
  127. // import { Header } from 'element-ui';
  128. export default {
  129. components: { beUpload, vpdf, vword },
  130. data() {
  131. return {
  132. accept: "*",
  133. showFile: false,
  134. showFileType: 0,
  135. dialogVisible1: false,
  136. delId:"",
  137. input:"",
  138. tableData: [],
  139. showFileUrl: "",
  140. Page: {
  141. nowPage: 1,
  142. total: 0,
  143. lim: 8,
  144. },
  145. };
  146. },
  147. methods: {
  148. //展示文件
  149. checkFile(url) {
  150. if (
  151. url.split(".")[url.split(".").length - 1].toLocaleUpperCase() == "PDF"
  152. ) {
  153. this.showFileUrl = url;
  154. this.showFileType = 1;
  155. } else {
  156. this.showFileUrl =
  157. "https://view.officeapps.live.com/op/view.aspx?src=" + url;
  158. this.showFileType = 0;
  159. }
  160. this.showFile = true;
  161. },
  162. del(Id) {
  163. this.delId = Id;
  164. this.dialogVisible1 = true;
  165. },
  166. commitDel() {
  167. this.ajax
  168. .post(this.$store.state.api + "/UpdateFirmFileState", {
  169. uid: this.$store.state.userInfo.userid,
  170. sid: this.delId,
  171. st: 1,
  172. })
  173. .then((res) => {
  174. if (res.data == 1) {
  175. this.$message.success("删除成功");
  176. } else {
  177. this.$message.error("删除失败");
  178. }
  179. this.getData();
  180. this.dialogVisible1 = false;
  181. this.delId = "";
  182. })
  183. .catch((err) => {
  184. console.log(err);
  185. });
  186. },
  187. changePage(newPage) {
  188. this.Page.nowPage = newPage;
  189. this.getData();
  190. },
  191. getFile(val) {
  192. this.ajax
  193. .post(this.$store.state.api + "/UploadFirmFile", {
  194. uid: this.$store.state.userInfo.userid,
  195. file: JSON.stringify(val),
  196. })
  197. .then((res) => {
  198. if (res.data == 1) {
  199. this.$message.success("上传成功");
  200. } else {
  201. this.$message.error("上传失败");
  202. }
  203. this.getData();
  204. });
  205. },
  206. getData() {
  207. this.tableData = [];
  208. this.ajax
  209. .get(this.$store.state.api + "/GetFirmFile", {
  210. uid: this.$store.state.userInfo.userid,
  211. tit: this.input,
  212. page: this.Page.nowPage,
  213. lim: this.Page.lim,
  214. })
  215. .then((res) => {
  216. res.data[0].forEach((item) => {
  217. item["startFile"] = JSON.parse(item["startFile"]);
  218. this.tableData.push(item);
  219. });
  220. this.Page.total = res.data[1][0]["total"];
  221. })
  222. .catch((err) => {
  223. console.log(err);
  224. });
  225. },
  226. },
  227. watch:{
  228. input:{
  229. handler(){
  230. immediate:true
  231. deep:true
  232. this.getData()
  233. }
  234. }
  235. },
  236. mounted() {
  237. this.getData();
  238. },
  239. };
  240. </script>
  241. <style lang="less">
  242. .firm {
  243. width: 100%;
  244. height: 100%;
  245. position: relative;
  246. .pAHeader {
  247. width: 100%;
  248. display: flex;
  249. justify-content: space-between;
  250. .pAHeader1 {
  251. width: 150px;
  252. font-weight: 600;
  253. flex-shrink: 0;
  254. font-size: 22px;
  255. }
  256. .pAHeader2 {
  257. height: 35px;
  258. line-height: 5px;
  259. background: #477edd;
  260. }
  261. }
  262. .addDialog {
  263. .el-dialog {
  264. border-radius: 5px;
  265. overflow: hidden;
  266. }
  267. .el-dialog__body{
  268. text-align: center;
  269. }
  270. .deleteContent {
  271. width: 100%;
  272. margin: 30px 0;
  273. font-size: 22px;
  274. color: #000;
  275. }
  276. .addDialogLogo {
  277. width: 60px;
  278. height: 30px;
  279. display: flex;
  280. justify-content: center;
  281. border-radius: 5px;
  282. line-height: 30px;
  283. background: #f2f2f2;
  284. position: absolute;
  285. left: 20px;
  286. top: 15px;
  287. }
  288. .el-dialog__header {
  289. display: flex;
  290. justify-content: center;
  291. background: #32455b;
  292. }
  293. .el-dialog__title {
  294. color: #fff;
  295. font-size: 18px;
  296. }
  297. .addDialogMid {
  298. box-sizing: border-box;
  299. padding: 0 60px 0 10px;
  300. .addDialogTit {
  301. display: flex;
  302. span {
  303. width: 80px;
  304. font-size: 16px;
  305. line-height: 40px;
  306. text-align: left;
  307. }
  308. }
  309. .addDialogTit1 {
  310. display: flex;
  311. justify-content: space-between;
  312. margin-bottom: 15px;
  313. }
  314. .addDialogTit2 {
  315. margin-top: 10px;
  316. font-size: 16px;
  317. color: #000;
  318. text-indent: 2em;
  319. }
  320. .addDialogCon {
  321. margin-top: 20px;
  322. }
  323. }
  324. .dialog-footer {
  325. display: flex;
  326. justify-content: center;
  327. box-sizing: border-box;
  328. .btn5 {
  329. font-size: 16px;
  330. }
  331. }
  332. }
  333. .btn {
  334. //上传文件
  335. width: 100px;
  336. height: 35px;
  337. font-size: 16px;
  338. background: #477edd;
  339. }
  340. }
  341. .upFile {
  342. height: 40px !important;
  343. }
  344. // #footerPage {
  345. // width: 100%;
  346. // position: absolute;
  347. // bottom: 0;
  348. // display: flex;
  349. // justify-content: flex-end;
  350. // }
  351. .showFileArea {
  352. width: 100%;
  353. height: 65vh;
  354. }
  355. </style>