firm.vue 9.0 KB

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