project.vue 12 KB

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