addRenwu.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view class="content">
  3. <view class="param">
  4. <view class="proMiao">任务名称</view>
  5. <input class="proINname" placeholder="请输入任务名称"/>
  6. <view class="proMiao">任务描述</view>
  7. <textarea class="proINname proIMi" placeholder="请输入评分标准"/>
  8. <view class="proMiao">附件</view>
  9. <view class="upload-img">
  10. <uni-file-picker limit="3"
  11. @select='selectUpload'
  12. :auto-upload='false'
  13. file-extname='pdf,docx,xlsx,'
  14. file-mediatype="all"
  15. @success='uploadSuccess'
  16. @fail='uploadFail'
  17. :list-styles='listStyles'
  18. v-model='fileList'
  19. ></uni-file-picker>
  20. </view>
  21. <span style="margin: 20rpx 0 0 20rpx;">支持pdf/word/xlsx格式,单个文件大小不超过5MB</span>
  22. <view class="proMiao">评分上限</view>
  23. <input class="proINname" placeholder="请输入评分上限"/>
  24. <view class="proMiao">权重</view>
  25. <input class="proINname" placeholder="请输入权重"/>
  26. <view class="proMiao">任务负责人</view>
  27. <view @click="toggle()">
  28. <uni-data-select class="proINname" :disabled="true"
  29. placeholder="请选择任务负责人"
  30. ></uni-data-select>
  31. </view>
  32. <view class="proMiao">提醒时间</view>
  33. <uni-datetime-picker class="proINname" type="datetime" v-model="datetimesingle" @change="changeLog" />
  34. <view class="proMiao">预警时间</view>
  35. <uni-datetime-picker class="proINname" type="datetime" v-model="datetimesingle" @change="changeLog" />
  36. <view class="proMiao">任务周期</view>
  37. <uni-datetime-picker class="proINname" v-model="datetimerange" type="datetimerange" rangeSeparator="至" />
  38. <!-- 操作键 -->
  39. <view class="project">
  40. <view class="butt quxiao">取消</view>
  41. <view class="butt queren">确认创建</view>
  42. </view>
  43. <view style="width: 100%;height: 60rpx;"></view>
  44. <!-- 任务负责人弹出框-->
  45. <uni-popup ref="popup" background-color="#fff">
  46. <view class="popup-content">
  47. <view class="popup-title">
  48. <view @click="quPopup">取消</view>
  49. <view>选择任务负责人</view>
  50. <view style="color: rgba(0, 97, 255, 1);">确定</view>
  51. </view>
  52. <view class="popup-list" v-for="(item,index) in people" :key="index">
  53. <view class="l-line"></view>
  54. <view class="l-kuang">
  55. <view class="l-circle"></view>
  56. <view style="margin-left: 20rpx;">
  57. <view style="font-size: 28rpx;">{{item.name}}</view>
  58. <view style="font-size: 24rpx;">{{item.danwei}}</view>
  59. </view>
  60. <label class="l-label">
  61. <view>
  62. <radio :id="item.name" :value="item.name" :checked="item.checked"></radio>
  63. </view>
  64. </label>
  65. </view>
  66. </view>
  67. </view>
  68. </uni-popup>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. datetimesingle: '',
  77. datetimerange: [],
  78. people:[
  79. {name:'张三',danwei:'校办'},
  80. {name:'张三',danwei:'校办'},
  81. {name:'张三',danwei:'校办',checked:'true'},
  82. ],
  83. // 附件
  84. fileList: [],
  85. listStyles: {
  86. "borderStyle": {
  87. "width": "0", // 边框宽度
  88. },
  89. "border": false, // 是否显示边框
  90. "dividline": false
  91. },
  92. }
  93. },
  94. onLoad() {
  95. },
  96. methods: {
  97. // 任务负责人弹框
  98. toggle() {
  99. console.log('dd')
  100. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  101. this.$refs.popup.open('bottom')
  102. },
  103. //取消弹框
  104. quPopup(){
  105. this.$refs.popup.close()
  106. },
  107. // 选择负责人
  108. checkboxChange: function(e) {
  109. console.log(e)
  110. var checked = e.target.value
  111. var changed = {}
  112. for (var i = 0; i < this.people.length; i++) {
  113. if (checked.indexOf(this.people[i].name) !== -1) {
  114. changed['people[' + i + '].checked'] = true
  115. } else {
  116. changed['people[' + i + '].checked'] = false
  117. }
  118. }
  119. },
  120. // 上传附件
  121. uploadSuccess(e) {
  122. console.log('上传成功', e)
  123. },
  124. uploadFail(e) {
  125. console.log('上传失败:', e)
  126. },
  127. selectUpload(e) {
  128. console.log('上传:', e)
  129. uni.uploadFile({
  130. url: 'url', //仅为示例,非真实的接口地址
  131. filePath: e.tempFilePaths[0],
  132. name: 'file',
  133. // formData: {
  134. // 'file': ''
  135. // },
  136. success: (uploadFileRes) => {
  137. console.log(uploadFileRes.data);
  138. },
  139. fail: (err) => {
  140. console.log(err);
  141. }
  142. })
  143. },
  144. }
  145. }
  146. </script>
  147. <style>
  148. .content {
  149. display: flex;
  150. flex-direction: column;
  151. align-items: center;
  152. justify-content: center;
  153. }
  154. .param{
  155. margin: 20rpx 0 0 0;
  156. width: 100%;
  157. background-color: rgba(255, 255, 255, 1);
  158. font-size: 28rpx;
  159. font-weight: 400;
  160. line-height: 41rpx;
  161. color: rgba(0, 0, 0, 1);
  162. }
  163. .proMiao{
  164. margin: 31rpx 0 0 20rpx;
  165. }
  166. /* 上传附件 */
  167. .upload-img{
  168. margin: 25rpx 0 0 21rpx;
  169. width: 200rpx;
  170. height: 80rpx;
  171. opacity: 1;
  172. border-radius: 13rpx;
  173. background: rgba(0, 97, 255, 0.1);
  174. border: 1rpx solid rgba(0, 97, 255, 1);
  175. }
  176. .proINname{
  177. margin: 25rpx 0 0 21rpx;
  178. width: 709rpx;
  179. height: 90rpx;
  180. border-radius: 13rpx;
  181. background: rgba(245, 248, 252, 1);
  182. border: 1rpx solid rgba(229, 229, 229, 1);
  183. font-size: 28rpx;
  184. line-height: 90rpx;
  185. color: rgba(179, 179, 179, 1);
  186. }
  187. .proIMi{
  188. height: 315rpx;
  189. }
  190. /* 操作键 */
  191. .project{
  192. display: flex;
  193. margin: 61rpx 0 0 0;
  194. justify-content: space-evenly;
  195. }
  196. .butt{
  197. width: 330rpx;
  198. height: 90rpx;
  199. border-radius: 117rpx;
  200. font-size: 32rpx;
  201. line-height: 90rpx;
  202. text-align: center;
  203. }
  204. .quxiao{
  205. border: 1rpx solid rgba(0, 97, 255, 1);
  206. color: rgba(0, 97, 255, 1);
  207. }
  208. .queren{
  209. background: rgba(0, 97, 255, 1);
  210. color: rgba(255, 255, 255, 1);
  211. }
  212. /* 任务负责人弹出框 */
  213. .popup-title{
  214. display: flex;
  215. width: 100%;
  216. height: 104rpx;
  217. font-size: 32rpx;
  218. line-height: 104rpx;
  219. justify-content: space-around;
  220. color: rgba(0, 0, 0, 1);
  221. }
  222. .l-line{
  223. width: 100%;
  224. border: 1rpx solid rgba(230, 230, 230, 1);
  225. }
  226. .l-kuang{
  227. margin: 40rpx 0 0 20rpx;
  228. display: flex;
  229. }
  230. .l-circle{
  231. width: 80rpx;
  232. height: 80rpx;
  233. border-radius: 50%;
  234. background-color:rgba(204, 204, 204, 1);
  235. }
  236. .l-label{
  237. margin-left: 504rpx;
  238. }
  239. </style>