project.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. <template>
  2. <view class="m_right">
  3. <image src="../../../assets/home/homeBG.png" class="s_logo" mode=""></image>
  4. <view class="m_right_container">
  5. <view class="m_row_class">
  6. <view class="m_row">
  7. <view class="m_row_link">
  8. </view>
  9. <view class="m_row_title" v-text="'项目管理'">
  10. </view>
  11. <view style="position: relative;margin-left: 40rpx;">
  12. <div class="triangle_border_down">
  13. <span></span>
  14. </div>
  15. </view>
  16. </view>
  17. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  18. <thead class="m-table-hander">
  19. <tr>
  20. <th>名称</th>
  21. <th>类型</th>
  22. <th>介绍</th>
  23. <th>创始人</th>
  24. <th>修改</th>
  25. <th>删除</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <tr v-for="(item,index) in projectData" :key="index">
  30. <!-- <t-table @change="change">
  31. <t-tr> </t-tr>
  32. <t-tr>{{item.ProjectName}}</t-tr>
  33. <t-tr>{{item.Type}}</t-tr>
  34. <t-tr>{{item.Describe}}</t-tr>
  35. <t-tr>{{item.CreateUserName}}</t-tr>
  36. <t-tr style="position: relative;"><button type="default" size="mini" @click="edit(index)" class="m_edit">修改</button></t-tr>
  37. <t-tr style="position: relative;"><button type="default" size="mini" @click="delete1(index)" class="m_delete">删除</button></t-tr>
  38. </t-table> -->
  39. <th>{{item.ProjectName}}</th>
  40. <th>{{item.Type}}</th>
  41. <!-- <th>{{item.Describe}}</th> -->
  42. <th>{{item.Type}}</th>
  43. <th>{{item.CreateUserName}}</th>
  44. <th style="position: relative;"><button type="default" size="mini" @click="edit(index)" class="m_edit">修改</button></th>
  45. <th style="position: relative;"><button type="default" size="mini" @click="delete1(index)" class="m_delete">删除</button></th>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </view>
  50. <view class="m_row_class">
  51. <view class="" style="display: flex;justify-content: space-between;">
  52. <view class="m_row">
  53. <view class="m_row_link">
  54. </view>
  55. <view class="m_row_title" v-text="'文件管理'">
  56. </view>
  57. <view style="position: relative;margin-left: 40rpx;">
  58. <div class="triangle_border_down">
  59. <span></span>
  60. </div>
  61. </view>
  62. </view>
  63. <view class="">
  64. <button type="default" class="m_btn_download" size="mini" @click="onClick_addFile">添加文件</button>
  65. </view>
  66. </view>
  67. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  68. <thead class="m-table-hander">
  69. <tr>
  70. <th>文件</th>
  71. <th>文件名</th>
  72. <th>文件类型</th>
  73. <th>上传人</th>
  74. <th>上传日期</th>
  75. <th>下载</th>
  76. <th>删除</th>
  77. <th>审核</th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <tr v-for="(item,index) in fileData" :key="index">
  82. <th>{{index+1}}</th>
  83. <th>{{item.Name}}</th>
  84. <th>{{item.Type}}</th>
  85. <th>{{item.UploadUserName}}</th>
  86. <th>{{item.UPloadTime.substring(0,9)}}</th>
  87. <th style="position: relative;"><button type="default" size="mini" @click="download(index)" class="m_edit">下载</button></th>
  88. <th style="position: relative;"><button type="default" size="mini" @click="delete1(index)" class="m_delete">删除</button></th>
  89. <th style="position: relative;"><button type="default" size="mini" @click="audit(item)" class="m_audit">审核</button></th>
  90. </tr>
  91. </tbody>
  92. </table>
  93. </view>
  94. <view class="m_row_class">
  95. <view class="" style="display: flex;justify-content: space-between;">
  96. <view class="m_row">
  97. <view class="m_row_link">
  98. </view>
  99. <view class="m_row_title" v-text="'成员管理'">
  100. </view>
  101. <view style="position: relative;margin-left: 40rpx;">
  102. <div class="triangle_border_down">
  103. <span></span>
  104. </div>
  105. </view>
  106. </view>
  107. <view class="">
  108. <button type="default" class="m_btn_download" size="mini" @click="addMember">添加学生</button>
  109. </view>
  110. </view>
  111. <view class="df fdr aic addMember_box showboder" v-show="isShowAddMember">
  112. <view class="addMember_input_box">
  113. <input class="addMember_input" type="string" v-model="addedMemberModel.IlabAccount" />
  114. </view>
  115. <view class="addMember_btn df aic jcc">添加</view>
  116. </view>
  117. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  118. <thead class="m-table-hander">
  119. <tr>
  120. <th>用户名</th>
  121. <th>姓名</th>
  122. <th>专业</th>
  123. <th>班级</th>
  124. <th>职务</th>
  125. <th>电话</th>
  126. <th>删除</th>
  127. </tr>
  128. </thead>
  129. <tbody>
  130. <tr v-for="(item,index) in projectMembers" :key="index">
  131. <th>{{item.User.IlabAccount}}</th>
  132. <th>{{item.User.Name}}</th>
  133. <th>{{item.User.Profession}}</th>
  134. <th>{{item.User.Class}}</th>
  135. <th>
  136. <div>
  137. <!-- <input type="number" value="" /> -->
  138. {{item.User.Type}}
  139. </div>
  140. </th>
  141. <th>{{item.User.PhoneNum}}</th>
  142. <th style="position: relative;"><button type="default" size="mini" class="m_delete" @click="delete1(item)">删除</button></th>
  143. </tr>
  144. </tbody>
  145. </table>
  146. </view>
  147. </view>
  148. <msg ref="msg" :title="title" @determine="determine" :btnArr="arr" v-show="show"></msg>
  149. <audit ref="audit" v-show="auditshow" @determine="determine"></audit>
  150. <!-- <locationtemp ref="location_temp"></locationtemp> -->
  151. </view>
  152. </template>
  153. <script>
  154. import msg from "./msg.vue"
  155. import audit from "./audit.vue"
  156. // import locationtemp from "./location_temp.vue"
  157. // import api from "../../../api/project.js"
  158. export default {
  159. name: "home_project",
  160. data() {
  161. return {
  162. index: 1,
  163. title: "",
  164. show: false,
  165. auditshow: false,
  166. callback: "",
  167. arr: [],
  168. data: [],
  169. projectData: [],
  170. ProjectItem: [],
  171. fileData: [],
  172. projectMembers: [],
  173. isShowAddMember: false,
  174. addedMemberModel: {
  175. "IlabAccount": '',
  176. "AddUserID": ''
  177. },
  178. }
  179. },
  180. components: {
  181. msg,
  182. audit,
  183. // locationtemp
  184. },
  185. created() {
  186. // this.getlist();
  187. // this.getFileList();
  188. },
  189. methods: {
  190. paging(obj) {
  191. this.index = obj;
  192. },
  193. delete1(index) {
  194. this.title = "是否删除信息?";
  195. this.arr = ["删除", "取消"]
  196. this.show = true;
  197. },
  198. download(index) {
  199. this.title = "下载成功?";
  200. this.arr = ["确认"];
  201. this.show = true;
  202. },
  203. edit(index) {
  204. this.title = "是否删除信息?";
  205. this.arr = ["删除", "取消"]
  206. this.show = true;
  207. },
  208. audit(index) {
  209. this.title = "是否确认审核?";
  210. this.arr = ["通过", "未通过"]
  211. this.show = true;
  212. this.callback = "audit"
  213. // this.auditshow = true;
  214. },
  215. determine(obj) {
  216. this.show = false;
  217. this.auditshow = false;
  218. switch (this.callback) {
  219. case "audit": //审核
  220. const data = {
  221. ProjectItemID: "xxxx",
  222. Pass: obj == 0
  223. }
  224. this.auditPost(data);
  225. break;
  226. default:
  227. break;
  228. }
  229. // if (this.audit == "audit") {
  230. // }
  231. console.log(obj)
  232. },
  233. auditPost(obj) {
  234. uni.request({
  235. url: this.$Api + "/project/setfilepass",
  236. data: obj,
  237. method: "POST",
  238. dataType: "json",
  239. success: res => {
  240. var {
  241. data
  242. } = res;
  243. alert(data.msg);
  244. }
  245. })
  246. },
  247. getlist() {
  248. uni.request({
  249. url: this.$Api + "/project/getprojectcontent",
  250. data: {
  251. "UserID": this.$UserId
  252. },
  253. method: "POST",
  254. dataType: "json",
  255. success: res => {
  256. var {
  257. data
  258. } = res;
  259. this.projectData = data.Projects;
  260. }
  261. })
  262. },
  263. getFileList() {
  264. console.log("用户id");
  265. console.log(this.$UserId);
  266. console.log(this.projectData[0].Id);
  267. uni.request({
  268. url: this.$Api + "/project/getprojectcontent",
  269. data: {
  270. "UserID": this.$UserId,
  271. "ProjectID": this.projectData[0].Id
  272. },
  273. method: "POST",
  274. dataType: "json",
  275. success: res => {
  276. this.fileData = res.data.ProjectItem;
  277. // console.log('this.fileData=',this.fileData)
  278. }
  279. })
  280. // var temp = {
  281. // "UserID": this.$UserId,
  282. // "ProjectID": this.projectData[0].Id
  283. // }
  284. // uni.request({
  285. // url: this.$Api + "/project/getprojectcontent",
  286. // data: temp,
  287. // method: "POST",
  288. // dataType: "json",
  289. // success: res => {
  290. // var {
  291. // data
  292. // } = res;
  293. // if (data.code == 100) {
  294. // this.fileData = data.ProjectItem;
  295. // console.log('this.fileData=',this.fileData)
  296. // }
  297. // }
  298. // })
  299. },
  300. viewProject(obj) {
  301. this.projectData = [obj];
  302. this.getFileList();
  303. this.getMemberList();
  304. },
  305. getMemberList() {
  306. var temp = {
  307. "ProjectID": this.projectData[0].Id
  308. }
  309. uni.request({
  310. url: this.$Api + "/project/getmember",
  311. data: temp,
  312. method: "POST",
  313. dataType: "json",
  314. success: res => {
  315. console.log("请求学生", res);
  316. if (res.data.Code == 100) {
  317. this.projectMembers = res.data.Users;
  318. console.log();
  319. }
  320. }
  321. })
  322. },
  323. addMember() {
  324. this.isShowAddMember = true;
  325. },
  326. onClick_addMember_ok() {
  327. console.log("添加学生", this.addedMemberModel);
  328. var temp = {
  329. "UserID": this.projectData[0].CreateUserID, //项目创建人ID
  330. "ProjectID": this.projectData[0].Id, //项目ID
  331. "AddUserID": mydata_userInfo.UserID, //添加人员ID 支持ilabID UserID
  332. "Type": "美术师" //编剧 摄影师 录音师 灯光师 创建人
  333. }
  334. uni.request({
  335. url: this.$Api + "/project/getmember",
  336. data: temp,
  337. method: "POST",
  338. dataType: "json",
  339. success: res => {
  340. console.log("请求学生", res);
  341. if (res.data.Code == 100) {
  342. this.projectMembers = res.data.Users;
  343. console.log();
  344. }
  345. }
  346. })
  347. },
  348. onClick_addFile(){
  349. }
  350. }
  351. }
  352. </script>
  353. <style lang="scss">
  354. .m_right {
  355. width: 100%;
  356. margin-top: 5rpx;
  357. // padding: 0 150rpx;
  358. background-color: #fff;
  359. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  360. .m_right_container {
  361. padding: 150rpx;
  362. }
  363. .s_logo {
  364. width: 100%;
  365. height: 800rpx;
  366. }
  367. .m_right_hander {
  368. text-align: right;
  369. height: 250rpx;
  370. position: relative;
  371. .m_btn_red {
  372. position: absolute;
  373. height: 80rpx;
  374. line-height: 80rpx;
  375. padding: 0 40rpx;
  376. right: 0;
  377. top: 50%;
  378. transform: translateY(-50%);
  379. background: #EA252C;
  380. color: #fff;
  381. }
  382. }
  383. }
  384. .m_btn_download {
  385. height: 80rpx;
  386. line-height: 80rpx;
  387. padding: 0 70rpx;
  388. background: #EA252C;
  389. color: #fff;
  390. font-family: MicrosoftYaHei;
  391. }
  392. tbody tr {
  393. border-top: 2rpx solid #DDDDDD !important;
  394. }
  395. tbody tr th:first-child {
  396. position: relative;
  397. }
  398. tbody tr th {
  399. font-weight: 400 !important;
  400. height: 140rpx;
  401. line-height: 140rpx;
  402. }
  403. tbody tr:hover {
  404. // color: #fff;
  405. background: #FDEBEC;
  406. // opacity: 0.08;
  407. }
  408. .m-table-hander {
  409. background-color: #FFF8F7;
  410. height: 140rpx;
  411. line-height: 140rpx;
  412. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  413. font-weight: bold;
  414. }
  415. .m_edit {
  416. position: absolute;
  417. top: 50%;
  418. left: 50%;
  419. transform: translate(-50%, -50%);
  420. background: rgb(67, 127, 250);
  421. color: rgb(255, 255, 255);
  422. min-width: 130rpx;
  423. }
  424. .m_delete {
  425. position: absolute;
  426. top: 50%;
  427. left: 50%;
  428. min-width: 130rpx;
  429. transform: translate(-50%, -50%);
  430. background: rgb(234, 37, 44);
  431. color: rgb(255, 255, 255);
  432. }
  433. .m_right_footer {
  434. margin-top: 80rpx;
  435. }
  436. .m_logoimg {
  437. width: 80rpx;
  438. height: 80rpx;
  439. position: absolute;
  440. top: 50%;
  441. left: 50%;
  442. transform: translate(-50%, -50%);
  443. }
  444. .m_paging {
  445. text-align: right;
  446. .m_paging_item {
  447. padding: 10rpx 18rpx;
  448. border: 1rpx solid #DDDDDD;
  449. border-radius: 8rpx;
  450. margin-right: 10rpx;
  451. }
  452. .p_act {
  453. background: #EA252C;
  454. color: #fff;
  455. border: inherit;
  456. }
  457. }
  458. .m_paging_item:hover {
  459. background: #EA252C;
  460. color: #fff;
  461. border: inherit;
  462. }
  463. .m_act1 {
  464. color: #FF0019;
  465. }
  466. .m_row {
  467. display: flex;
  468. height: 60rpx;
  469. line-height: 60rpx;
  470. font-size: 30rpx;
  471. color: #ea252c;
  472. padding: 0 0 80rpx 0;
  473. }
  474. .m_audit {
  475. position: absolute;
  476. top: 50%;
  477. left: 50%;
  478. min-width: 65px;
  479. -webkit-transform: translate(-50%, -50%);
  480. transform: translate(-50%, -50%);
  481. color: white;
  482. background-color: #FF791B;
  483. }
  484. .m_row_link {
  485. width: 10rpx;
  486. height: 60rpx;
  487. background-color: #ea252c;
  488. margin-right: 40rpx;
  489. }
  490. .m_row_title {
  491. color: #ea252c;
  492. font-weight: bold;
  493. font-size: 40rpx;
  494. }
  495. /*向下*/
  496. .triangle_border_down {
  497. width: 0;
  498. height: 0;
  499. border-width: 25rpx 25rpx 0;
  500. border-style: solid;
  501. border-color: #ea252c transparent transparent;
  502. /*灰 透明 透明 */
  503. margin: 20rpx auto;
  504. position: relative;
  505. }
  506. .m_row_class {
  507. margin-bottom: 60rpx;
  508. }
  509. .addMember_box{
  510. margin-bottom: 50rpx;
  511. height: 80rpx;
  512. }
  513. .addMember_input_box{
  514. width: 500rpx;
  515. height: 80rpx;
  516. }
  517. .addMember_input {
  518. width: 100%;
  519. height: 100%;
  520. border: 1px solid #ece8e8;
  521. line-height: 50rpx;
  522. font-size: 30rpx;
  523. border-radius: 6rpx;
  524. padding: 10rpx 40rpx;
  525. }
  526. .addMember_btn {
  527. width: 130rpx;
  528. height: 80rpx;
  529. transform: translate(-50%, -50%);
  530. background: rgb(234, 37, 44);
  531. color: rgb(255, 255, 255);
  532. }
  533. </style>