addProject.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="content">
  3. <view class="param">
  4. <view class="all-text">创建项目需求</view>
  5. <view class="proName">项目标题</view>
  6. <input class="proINname" placeholder="请输入项目标题"/>
  7. <view class="proMiao">项目描述</view>
  8. <uni-data-select class="proINname"
  9. v-model="value" placeholder="请选择项目描述"
  10. :localdata="range"
  11. @change="change"
  12. ></uni-data-select>
  13. <view class="proMiao">附件</view>
  14. <view class="upload-img">
  15. <uni-file-picker limit="3"
  16. @select='selectUpload'
  17. :auto-upload='false'
  18. file-extname='pdf,docx,xlsx,'
  19. file-mediatype="all"
  20. @success='uploadSuccess'
  21. @fail='uploadFail'
  22. :list-styles='listStyles'
  23. v-model='fileList'
  24. ></uni-file-picker>
  25. </view>
  26. <span style="margin: 20rpx 0 0 20rpx;">支持pdf/word/xlsx格式,单个文件大小不超过5MB</span>
  27. <view class="proMiao">主办单位</view>
  28. <uni-data-select class="proINname"
  29. v-model="value" placeholder="请选择主办单位"
  30. :localdata="range"
  31. @change="change"
  32. ></uni-data-select>
  33. <view class="proMiao">协办单位</view>
  34. <uni-data-select class="proINname"
  35. v-model="value" placeholder="请选择协办单位"
  36. :localdata="range"
  37. @change="change"
  38. ></uni-data-select>
  39. <view class="proMiao">项目级别</view>
  40. <uni-data-select class="proINname"
  41. v-model="value" placeholder="请选择项目级别"
  42. :localdata="range"
  43. @change="change"
  44. ></uni-data-select>
  45. <view class="proMiao">关联流程</view>
  46. <uni-data-select class="proINname"
  47. v-model="value" placeholder="请选择关联流程"
  48. :localdata="range"
  49. @change="change"
  50. ></uni-data-select>
  51. <view class="proMiao">项目来源</view>
  52. <uni-data-select class="proINname"
  53. v-model="value" placeholder="请选择项目来源"
  54. :localdata="range"
  55. @change="change"
  56. ></uni-data-select>
  57. <view class="proMiao jindu">完成进度</view>
  58. <view class="weidu">维度权重40%</view>
  59. <view class="addRen" @click="addRen">新增任务</view>
  60. <!-- 任务列表 -->
  61. <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
  62. <view class="renwu" v-for="(item,index) in renwu" :key="index" @click="clickRenwu">
  63. <view>{{item.name}}</view>
  64. <view>{{item.time}}</view>
  65. <view style="display: flex;">
  66. <view class="renwu-bu bianji">编辑</view>
  67. <view class="renwu-bu delete">删除</view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="project">
  72. <view class="butt quxiao">取消</view>
  73. <view class="butt queren">确认创建</view>
  74. </view>
  75. <view style="width: 100%;height: 60rpx;"></view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. value: 1,
  84. range: [
  85. { value: 0, text: "篮球" },
  86. { value: 1, text: "足球" },
  87. { value: 2, text: "游泳" },
  88. ],
  89. fileList: [],
  90. listStyles: {
  91. "borderStyle": {
  92. "width": "0", // 边框宽度
  93. },
  94. "border": false, // 是否显示边框
  95. "dividline": false
  96. },
  97. renwu:[
  98. {name:'xxx任务',time:'2024-04-11'},
  99. {name:'xxx任务',time:'2024-04-11'},
  100. {name:'xxx任务',time:'2024-04-11'},
  101. ],
  102. }
  103. },
  104. onLoad() {
  105. },
  106. methods: {
  107. change(e) {
  108. console.log("e:", e);
  109. },
  110. //新增任务
  111. addRen(){
  112. uni.navigateTo({
  113. url:'/pages/project/addRenwu'
  114. })
  115. },
  116. //任务详情
  117. clickRenwu(){
  118. uni.navigateTo({
  119. url:'/pages/project/renwuX'
  120. })
  121. },
  122. // 上传附件
  123. uploadSuccess(e) {
  124. console.log('上传成功', e)
  125. },
  126. uploadFail(e) {
  127. console.log('上传失败:', e)
  128. },
  129. selectUpload(e) {
  130. console.log('上传:', e)
  131. uni.uploadFile({
  132. url: 'url', //仅为示例,非真实的接口地址
  133. filePath: e.tempFilePaths[0],
  134. name: 'file',
  135. // formData: {
  136. // 'file': ''
  137. // },
  138. success: (uploadFileRes) => {
  139. console.log(uploadFileRes.data);
  140. },
  141. fail: (err) => {
  142. console.log(err);
  143. }
  144. })
  145. },
  146. }
  147. }
  148. </script>
  149. <style>
  150. .content {
  151. display: flex;
  152. flex-direction: column;
  153. align-items: center;
  154. justify-content: center;
  155. }
  156. .param{
  157. margin: 20rpx 0 0 0;
  158. width: 100%;
  159. background-color: rgba(255, 255, 255, 1);
  160. font-size: 28rpx;
  161. font-weight: 400;
  162. line-height: 41rpx;
  163. color: rgba(0, 0, 0, 1);
  164. }
  165. .all-text{
  166. margin: 22rpx 0 0 20rpx;
  167. font-size: 32rpx;
  168. font-weight: 500;
  169. color: rgba(0, 0, 0, 1);
  170. }
  171. .proName{
  172. margin: 23rpx 0 0 20rpx;
  173. }
  174. .proINname{
  175. margin: 25rpx 0 0 21rpx;
  176. width: 709rpx;
  177. height: 90rpx;
  178. border-radius: 13rpx;
  179. background: rgba(245, 248, 252, 1);
  180. border: 1rpx solid rgba(229, 229, 229, 1);
  181. font-size: 28rpx;
  182. line-height: 90rpx;
  183. color: rgba(179, 179, 179, 1);
  184. }
  185. .proMiao{
  186. margin: 31rpx 0 0 20rpx;
  187. }
  188. /* 上传附件 */
  189. .upload-img{
  190. margin: 25rpx 0 0 21rpx;
  191. width: 200rpx;
  192. height: 80rpx;
  193. opacity: 1;
  194. border-radius: 13rpx;
  195. background: rgba(0, 97, 255, 0.1);
  196. border: 1rpx solid rgba(0, 97, 255, 1);
  197. }
  198. .jindu{
  199. font-size: 32rpx;
  200. font-weight: 500;
  201. line-height: 46rpx;
  202. }
  203. .weidu{
  204. margin: 7rpx 0 0 20rpx;
  205. font-size: 24rpx;
  206. line-height: 35rpx;
  207. color: rgba(128, 128, 128, 1);
  208. }
  209. .addRen{
  210. margin: -80rpx 0 0 581rpx;
  211. width: 149rpx;
  212. height: 59rpx;
  213. border-radius: 92rpx;
  214. background: rgba(0, 97, 255, 1);
  215. font-size: 28rpx;
  216. line-height: 59rpx;
  217. color: rgba(255, 255, 255, 1);
  218. text-align: center;
  219. }
  220. /* 任务列表 */
  221. .renwu{
  222. display: flex;
  223. margin-top: 6rpx;
  224. width: 709rpx;
  225. height: 90rpx;
  226. border-radius: 13rpx;
  227. background: rgba(245, 248, 252, 1);
  228. border: 1rpx solid rgba(229, 229, 229, 1);
  229. font-size: 28rpx;
  230. justify-content: space-evenly;
  231. align-items: center;
  232. }
  233. .renwu-bu{
  234. width: 105rpx;
  235. height: 50rpx;
  236. border-radius: 110rpx;
  237. line-height:50rpx;
  238. text-align: center;
  239. }
  240. .bianji{
  241. border: 1rpx solid rgba(0, 97, 255, 1);
  242. color: rgba(0, 97, 255, 1);
  243. }
  244. .delete{
  245. margin-left: 20rpx;
  246. border: 1rpx solid rgba(212, 48, 48, 1);
  247. color: rgba(212, 48, 48, 1);
  248. }
  249. .project{
  250. display: flex;
  251. margin: 61rpx 0 0 0;
  252. justify-content: space-evenly;
  253. }
  254. .butt{
  255. width: 330rpx;
  256. height: 90rpx;
  257. border-radius: 117rpx;
  258. font-size: 32rpx;
  259. line-height: 90rpx;
  260. text-align: center;
  261. }
  262. .quxiao{
  263. border: 1rpx solid rgba(0, 97, 255, 1);
  264. color: rgba(0, 97, 255, 1);
  265. }
  266. .queren{
  267. background: rgba(0, 97, 255, 1);
  268. color: rgba(255, 255, 255, 1);
  269. }
  270. </style>