projectApplicationApply.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <!-- 项目立项申请立项检查消息表达 -->
  3. <div class="projectApplicationApply">
  4. <!-- 左边导航区开始 -->
  5. <div class="left">
  6. <div class="sx">
  7. <div class="qiu"></div>
  8. </div>
  9. <div class="leftTits">
  10. <div @click="toPage(1)">基本信息填写</div>
  11. <div @click="toPage(2)">项目成员</div>
  12. <div @click="toPage(3)">简介</div>
  13. <div @click="toPage(4)">下一步</div>
  14. </div>
  15. </div>
  16. <!-- 左边导航区结束 -->
  17. <!-- 右边填写信息区域开始 -->
  18. <div id="one" class="right">
  19. <div class="vfpHeader">
  20. <div class="titleOne">项目立项申请</div>
  21. <div class="smallTitle">申请开放时间为2023年××月××日9:00 &nbsp; 截止时间为2023年××月××日18:00</div>
  22. <el-button @click="backBtn1" type="primary" size="mini">返回</el-button>
  23. </div>
  24. <hr>
  25. <!-- 活动申请填写信息区域开始 -->
  26. <div class="select">
  27. <div class="selectTop">
  28. <div class="label">项目名称</div>
  29. <el-input v-model="data.select.projectName" placeholder="请输入内容"></el-input>
  30. </div>
  31. <div class="selectMid">
  32. <div class="selectLeft">
  33. <div class="inpBlock">
  34. <div class="label">项目负责人</div>
  35. <el-input v-model="data.select.person" placeholder="请输入内容"></el-input>
  36. </div>
  37. <div class="inpBlock">
  38. <div class="label">所在部门</div>
  39. <el-select v-model="data.select.value" style="width: 100%;" placeholder="请选择">
  40. <el-option
  41. v-for="item in data.options"
  42. :key="item.id"
  43. :label="item.name"
  44. :value="item.id">
  45. </el-option>
  46. </el-select>
  47. </div>
  48. <div class="inpBlock">
  49. <div class="label">联系电话</div>
  50. <el-input type="number" v-model="data.select.tel" @blur="getText(data.select.tel)" placeholder="请输入联系方式"></el-input>
  51. </div>
  52. <!-- <div v-if="!isPhoneValid" class="error-message">电话号码格式不正确</div> -->
  53. </div>
  54. <div class="selectRight">
  55. <div class="inpBlock">
  56. <div class="label">项目开始时间</div>
  57. <el-date-picker
  58. v-model="data.select.value1"
  59. type="datetime"
  60. style="width: 100%;"
  61. value-format="yyyy-MM-dd HH:mm:ss"
  62. placeholder="选择日期">
  63. </el-date-picker>
  64. </div>
  65. <div class="inpBlock" style="position: relative;">
  66. <div class="label">预算总经费</div>
  67. <el-input type="number" v-model="data.select.fund" placeholder="请输入内容"></el-input>
  68. <div style="position: absolute;right: -30px;top: 10px;">(万)</div>
  69. </div>
  70. <div class="inpBlock">
  71. <div class="label">选择分类</div>
  72. <el-select v-model="data.select.sort" style="width: 100%;" placeholder="请选择">
  73. <el-option
  74. v-for="item in data.sortOptions"
  75. :key="item.id"
  76. :label="item.name"
  77. :value="item.id">
  78. </el-option>
  79. </el-select>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <!-- 活动申请填写信息区域结束 -->
  85. <!-- 项目封面上传开始 -->
  86. <div style="position: relative;">
  87. <div id="two" class="tabTit">
  88. <div id="face"><p>封面上传</p></div>
  89. <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传封面</el-button> -->
  90. </div>
  91. <hr>
  92. <el-upload
  93. class="upload-demo"
  94. action="https://jsonplaceholder.typicode.com/posts/"
  95. :on-preview="handlePreview"
  96. :on-remove="handleRemove"
  97. :file-list="fileList"
  98. style="width: 40%;margin-top: -25px;"
  99. list-type="picture">
  100. <el-button size="small" style="position: absolute;top: -8px;right: 0;width: 100px;box-sizing: border-box;padding: 9px 0;font-size: 16px;background-color: #0e72e6;border-radius:5px" type="primary">上传封面</el-button>
  101. <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
  102. </el-upload>
  103. </div>
  104. <!-- 项目封面上传开始结束 -->
  105. <!-- <div> -->
  106. <!-- 项目成员表格开始 -->
  107. <div id="two" class="tabTit">
  108. <div id="face"><p>项目成员</p></div>
  109. <el-button type="primary" @click="addMember" size="mini">添加成员</el-button>
  110. </div>
  111. <hr>
  112. <el-table
  113. :data="data.tableData"
  114. tooltip-effect="dark"
  115. stripe
  116. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  117. class="fontSize"
  118. >
  119. <el-table-column
  120. prop="name"
  121. label="姓名"
  122. align="center"
  123. >
  124. </el-table-column>
  125. <el-table-column
  126. prop="class"
  127. label="班级"
  128. align="center"
  129. >
  130. </el-table-column>
  131. <el-table-column
  132. prop="phone"
  133. label="电话"
  134. align="center"
  135. >
  136. </el-table-column>
  137. <el-table-column
  138. align="center"
  139. prop="operation"
  140. label="操作"
  141. >
  142. <template #default="scope">
  143. <div class="operations">
  144. <!-- <el-button type="primary" > -->
  145. <el-button type="primary" @click="amendDialogData(scope.row)" size="mini">修改</el-button>
  146. <el-button type="primary" @click="Del(scope.row)" size="mini">删除</el-button>
  147. <!-- </el-button> -->
  148. </div>
  149. </template>
  150. </el-table-column>
  151. </el-table>
  152. <!-- 项目成员表格结束 -->
  153. <!-- 项目简介开始 -->
  154. <div id="three" class="tabTit">
  155. <div><p>项目简介</p></div>
  156. </div>
  157. <hr>
  158. <el-input
  159. type="textarea"
  160. :rows="6"
  161. resize="none"
  162. class="textArea"
  163. placeholder="请输入内容"
  164. v-model="data.textarea">
  165. </el-input>
  166. <!-- 项目简介结束 -->
  167. <!-- 结束按钮开始 -->
  168. <div id="four" class="baseBtn">
  169. <div class="blockWidth">
  170. <el-button type="primary" @click="backBtn1" size:small>上一步</el-button>
  171. <el-button type="primary" @click="backBtn" size:small>下一步</el-button>
  172. </div>
  173. </div>
  174. <!-- 结束按钮结束 -->
  175. </div>
  176. <!-- 右边填写信息区域结束 -->
  177. <!--添加成员dialog对话框开始 -->
  178. <el-dialog
  179. title="添加成员"
  180. :visible.sync="addMemberDialog"
  181. :modal="true"
  182. :close-on-click-modal="true"
  183. class="AddMember"
  184. :before-close="init">
  185. <div class="littleBlock">
  186. <div class="dialogLabel">姓名</div>
  187. <div>
  188. <el-input v-model="data.Member.name"></el-input>
  189. </div>
  190. </div>
  191. <div class="littleBlock">
  192. <div class="dialogLabel">班级</div>
  193. <div>
  194. <el-input v-model="data.Member.class"></el-input>
  195. </div>
  196. </div>
  197. <div class="littleBlock">
  198. <div class="dialogLabel">电话</div>
  199. <div>
  200. <el-input type="number" v-model="data.Member.phone" @blur="getText(data.Member.phone)" ></el-input>
  201. </div>
  202. </div>
  203. <div slot="footer" class="footer">
  204. <el-button type="primary" @click="commit" class="diaBtn" >确认提交</el-button>
  205. <el-button @click="init" class="diaBtn">取消</el-button>
  206. </div>
  207. </el-dialog>
  208. <!--添加成员dialog对话框结束 -->
  209. <!--修改成员dialog对话框开始 -->
  210. <el-dialog
  211. title="修改成员"
  212. :visible.sync="data.amendMemberDialog"
  213. :modal="true"
  214. :close-on-click-modal="true"
  215. class="AddMember"
  216. :before-close="init">
  217. <div class="littleBlock">
  218. <div class="dialogLabel">姓名</div>
  219. <div>
  220. <el-input v-model="data.Member2.name"></el-input>
  221. </div>
  222. </div>
  223. <div class="littleBlock">
  224. <div class="dialogLabel">班级</div>
  225. <div>
  226. <el-input v-model="data.Member2.class"></el-input>
  227. </div>
  228. </div>
  229. <div class="littleBlock">
  230. <div class="dialogLabel">电话</div>
  231. <div>
  232. <el-input type="number" v-model="data.Member2.phone" @blur="getText(data.Member2.phone)" ></el-input>
  233. </div>
  234. </div>
  235. <div slot="footer" class="footer">
  236. <el-button type="primary" @click="commit2" class="diaBtn" >确认提交</el-button>
  237. <el-button @click="init" class="diaBtn">取消</el-button>
  238. </div>
  239. </el-dialog>
  240. <!--修改成员dialog对话框结束 -->
  241. <!-- 删除成员对话框开始 -->
  242. <el-dialog
  243. title="删除成员"
  244. :visible.sync="delMember"
  245. width="600px"
  246. class="delMemberDialog">
  247. <span class="deleteContent">确定删除成员?</span>
  248. <span slot="footer" class="dialog-footer">
  249. <el-button type="primary" @click="commitDelMember" class="btn5">确认删除</el-button>
  250. <el-button @click="init" class="btn5" >取消</el-button>
  251. </span>
  252. </el-dialog>
  253. <!-- 删除成员对话框结束 -->
  254. </div>
  255. </template>
  256. <script>
  257. export default {
  258. props:["data","next",'back','addPerson','amend'],
  259. data() {
  260. return {
  261. fileList: [{name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}],
  262. addMemberDialog:false,
  263. amendMemberDialog:false,
  264. delMember:false,
  265. rowData:''
  266. }
  267. },
  268. methods:{
  269. submitUpload() {
  270. this.$refs.upload.submit();
  271. },
  272. handleRemove(file, fileList) {
  273. console.log(file, fileList);
  274. },
  275. handlePreview(file) {
  276. console.log(file);
  277. },
  278. getText(value) { //电话验证
  279. // console.log(value);
  280. // let text = document.getElementById(inputId).value; //获取输入框的ID 存放到text变量中
  281. let verify = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/; //获取正则表达式 存放到verify变量中
  282. let result = verify.test(value.trim()); //判断输入框内容是否符合 正则表达式
  283. // if(!result && value != "") {
  284. if(!result) {
  285. if (value == this.data.select.tel) {
  286. this.$message.error('请输入正确联系号码格式')
  287. return this.data.telVerify=false;
  288. }
  289. if (value == this.data.Member.phone || value == this.data.Member2.phone) {
  290. console.log(222);
  291. return this.data.telVerify2=false;
  292. }
  293. }else{
  294. if (value == this.data.select.tel) {
  295. this.data.telVerify=true;
  296. }
  297. if (value == this.data.Member.phone || value == this.data.Member2.phone) {
  298. console.log(111);
  299. return this.data.telVerify2=true;
  300. }
  301. }
  302. },
  303. init(){
  304. this.addMemberDialog=false;
  305. this.data.amendMemberDialog=false
  306. this.delMember=false
  307. },
  308. addMember(){ //添加项目成员
  309. this.addMemberDialog=true
  310. this.data.Member={} //点开立即清除上次数据
  311. },
  312. amendDialogData(val){ //修改项目成员信息对话框显示
  313. this.data.amendMemberDialog=true
  314. Object.assign(this.data.Member2,val)
  315. // console.log(this.data.Member2);
  316. },
  317. backBtn1(){ // 上一步
  318. this.$router.push('/projectApplication')
  319. },
  320. backBtn(){ // 下一步
  321. this.next();
  322. },
  323. commit(){ //确定添加成员
  324. if (this.data.Member.name =="" ||this.data.Member.name==undefined) return this.$message.error('请输入姓名')
  325. if (this.data.Member.class=="" ||this.data.Member.class==undefined) return this.$message.error('请输入班级')
  326. // if (!this.data.telVerify2) return this.$message.error('请输入正确联系号码格式')
  327. if (!this.data.telVerify2) return this.$message.error('4156465')
  328. this.addPerson();
  329. this.init()
  330. },
  331. commit2(){ //确定修改成员
  332. this.amend(this.rowData)
  333. },
  334. commitDelMember(){ //对话框确定删除成员
  335. let a=this.rowData
  336. // let _this = this
  337. this.data.tableData.forEach((item, index, arr)=> {
  338. if(item.id === a) {
  339. arr.splice(index, 1);
  340. this.$message.success('删除成功')
  341. this.init()
  342. }
  343. });
  344. },
  345. Del(val){
  346. this.delMember=true;
  347. this.rowData=val.id
  348. },
  349. toPage(val){
  350. if (val==1) {
  351. document.getElementById("one").scrollIntoView({ behavior: "smooth" });
  352. }else if(val==2){
  353. document.getElementById("two").scrollIntoView({ behavior: "smooth" });
  354. }else if(val==3){
  355. document.getElementById("three").scrollIntoView({ behavior: "smooth" });
  356. }else if(val==4){
  357. document.getElementById("four").scrollIntoView({ behavior: "smooth" });
  358. }
  359. }
  360. },
  361. mounted(){
  362. // console.log(this.data)
  363. }
  364. }
  365. </script>
  366. <style lang="less">
  367. .projectApplicationApply{
  368. margin-top: 30px;
  369. width: 100%;
  370. display: flex;
  371. justify-content: center;
  372. // 右边栏标题
  373. .projectApplicationApplypAHeader{
  374. width: 100%;
  375. display: flex;
  376. justify-content:flex-start;
  377. position: relative;
  378. margin-bottom: 15px;
  379. .pAHeader1{
  380. font-weight: 600;
  381. font-size: 22px;
  382. flex-shrink: 0;
  383. }
  384. .pAHeader2{
  385. position: absolute;
  386. top:8px;
  387. left: 160px;
  388. font-size: 16px;
  389. background: repeating-linear-gradient();
  390. }
  391. .pAHeader3{
  392. background: #0e72e6 !important;
  393. color: #fff !important;
  394. display: flex;
  395. position: absolute;
  396. right: 0;
  397. justify-content: center;
  398. font-size: 16px;
  399. width: 100px;
  400. height: 30px;
  401. align-items: center;
  402. }
  403. }
  404. .delMemberDialog{
  405. font-size: 18px;
  406. .el-dialog{
  407. border-radius: 5px;
  408. overflow: hidden;
  409. }
  410. .deleteContent{
  411. margin: 30px 0;
  412. font-size: 22px;
  413. color: #000;
  414. }
  415. .el-dialog__header{
  416. background: #32455b;
  417. display: flex;
  418. justify-content: center;
  419. }
  420. .el-dialog__title{
  421. color:#fff;
  422. font-size: 22px;
  423. }
  424. .el-dialog__body{
  425. display: flex;
  426. justify-content: center;
  427. }
  428. // .addDialogMid{
  429. // box-sizing: border-box;
  430. // padding:0 60px 0 10px;
  431. // .addDialogTit{
  432. // display: flex;
  433. // span{
  434. // width: 80px;
  435. // font-size: 16px;
  436. // line-height: 40px;
  437. // text-align: left;
  438. // }
  439. // }
  440. // }
  441. .dialog-footer{
  442. display: flex;
  443. justify-content: center;
  444. box-sizing: border-box;
  445. .btn5{
  446. font-size: 16px;
  447. }
  448. }
  449. }
  450. }
  451. </style>