add.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view >
  3. <view class="bgtop"></view>
  4. <uni-forms :modelValue="datainfo">
  5. <view class="addbox">
  6. <view class="boxs pdbox" style="padding-bottom: 2rpx;">
  7. <view class="titbox mb14">
  8. <view class="tit flexc">
  9. <image :src="titimg"></image>
  10. <view>基本详情</view>
  11. </view>
  12. </view>
  13. <uni-forms-item label="会议名称" name="conferenceTitle" required>
  14. <uni-easyinput :inputBorder="false" type="text" v-model="datainfo.conferenceTitle" placeholder="请输入会议名称" />
  15. <!-- <view class="edtip pa">* 标题前无须加关于,标题后无须加的建议,系统将自动填写</view> -->
  16. </uni-forms-item>
  17. <picker mode="date" @change='bindDateChangea'>
  18. <uni-forms-item label="会议日期" name="conferenceDate" required>
  19. <view class="lbtabp">
  20. <view :class="datainfo.conferenceDate?'':'coa'">{{datainfo.conferenceDate || "请选择会议日期"}}</view>
  21. </view>
  22. </uni-forms-item>
  23. </picker>
  24. <picker mode="time" @change='bindDateChangeb'>
  25. <uni-forms-item label="会议时间" name="conferenceTime" required>
  26. <view class="lbtabp">
  27. <view :class="datainfo.conferenceTime?'':'coa'">{{datainfo.conferenceTime || "请选择会议时间"}}</view>
  28. </view>
  29. </uni-forms-item>
  30. </picker>
  31. <uni-forms-item label="会议地点" name="conferenceAddress" required>
  32. <uni-easyinput :inputBorder="false" type="text" v-model="datainfo.conferenceAddress" placeholder="请输入会议地点" />
  33. </uni-forms-item>
  34. </view>
  35. <!-- 参会人员 -->
  36. <view class="boxs pdbox">
  37. <view class="titbox mb14 flexc">
  38. <view class="tit flexc flex1">
  39. <image :src="titimg"></image>
  40. <view>参会人员</view>
  41. </view>
  42. <view class="addpeo" @click="getAddPeoFn">
  43. <image :src="addimg"></image>
  44. 添加人员
  45. </view>
  46. </view>
  47. <view class="peoBox">
  48. <block v-if="datainfo.zxConferenceUserList&&datainfo.zxConferenceUserList.length">
  49. <view v-for="(ite,idx) in datainfo.zxConferenceUserList" :key="idx">{{ite.userName}}
  50. <block v-if="idx<datainfo.zxConferenceUserList.length-1">,</block>
  51. </view>
  52. </block>
  53. <view class="coa" v-else>请选择参会人员</view>
  54. </view>
  55. </view>
  56. <view class="boxs pdbox">
  57. <view class="titbox mb20">
  58. <view class="tit flexc">
  59. <view>备注信息</view>
  60. </view>
  61. </view>
  62. <textarea placeholder="请输入备注信息" v-model="datainfo.remark"></textarea>
  63. </view>
  64. <view class="addbtn">
  65. <view class="btn btn1" @click="getZanFnt">暂存</view>
  66. <view class="btn btn2" @click="getSubmit">提交</view>
  67. </view>
  68. </view>
  69. </uni-forms>
  70. </view>
  71. </template>
  72. <script>
  73. import config from '@/config'
  74. const baseUrl = config.baseUrl
  75. import { getToken } from '@/utils/auth'
  76. import { selectValue } from '@/utils/common.js';
  77. import {getMeetAddFn,getMeetDetaiFn,getMeetEditFn} from "@/api/mine/meeting.js"
  78. import {getDictionaryFn} from "@/api/mine/register.js"
  79. export default{
  80. data(){
  81. return{
  82. titimg:require("@/work/static/images/titbg.png"),
  83. addimg:require("@/work/static/images/meeting/add.png"),
  84. datainfo:{
  85. "conferenceTitle":"",//会议名称
  86. "conferenceDate":"",//会议日期
  87. "conferenceTime":"",//会议时间
  88. "conferenceAddress":"",//会议地点,
  89. "remark":'',//备注
  90. 'zxConferenceUserList':[],//参会人员
  91. },
  92. id:"",
  93. pagetype:'add',
  94. editinfo:'',
  95. }
  96. },
  97. onUnload(){
  98. uni.$off('refreshtalb')
  99. },
  100. onLoad(e) {
  101. uni.$on('refreshtalb', (e) => {
  102. this.datainfo.zxConferenceUserList=e.zxConferenceUserList
  103. })
  104. if(e.type=='edit'){
  105. this.id=e.id;
  106. this.pagetype='edit'
  107. this.getDetail()
  108. }
  109. if(e.type=='old'&&uni.getStorageSync('cjhyList')){
  110. var newObj=JSON.parse(JSON.stringify(uni.getStorageSync('cjhyList')))
  111. var params=newObj.params;
  112. this.datainfo=params;
  113. }
  114. },
  115. methods:{
  116. kayType(ite,list){
  117. return selectValue(list, ite);
  118. },
  119. bindDateChangea(e){
  120. var val=e.detail.value;
  121. this.datainfo.conferenceDate=val;
  122. },
  123. bindDateChangeb(e){
  124. var val=e.detail.value;
  125. this.datainfo.conferenceTime=val+':00';
  126. },
  127. getDetail(){
  128. var that=this;
  129. getCaseDetailFn(this.id).then(res=>{
  130. if(res.code==200){
  131. var data=res.data;
  132. this.datainfo=res.data;
  133. var taryList=data.proposalUserList;
  134. if(taryList&&taryList.length){
  135. var newArr=[]
  136. taryList.forEach(ite=>{
  137. newArr.push(ite.name)
  138. })
  139. this.tary=newArr.join('/')
  140. }
  141. // this.dwdetList=res.data.proposalUnitReplyList;
  142. }
  143. })
  144. },
  145. getAddPeoFn(){
  146. var obj={
  147. list:this.datainfo.zxConferenceUserList,
  148. }
  149. this.$tab.navigateTo('/work/pages/meeting/people?data='+encodeURIComponent(JSON.stringify(obj)))
  150. },
  151. gettalbFn(){
  152. },
  153. // 暂存
  154. getZanFnt(){
  155. var that=this;
  156. var params=that.datainfo;
  157. var obj={
  158. params:params,
  159. }
  160. uni.setStorageSync('cjhyList', JSON.parse(JSON.stringify(obj)))
  161. that.$toast("暂存成功")
  162. },
  163. getSubmit(){
  164. var that=this;
  165. if(!this.datainfo.conferenceTitle){
  166. this.$toast("请输入会议名称")
  167. return
  168. }
  169. if(!this.datainfo.conferenceDate){
  170. this.$toast("请选择会议日期")
  171. return
  172. }
  173. if(!this.datainfo.conferenceTime){
  174. this.$toast("请选择会议时间")
  175. return
  176. }
  177. if(!this.datainfo.conferenceAddress){
  178. this.$toast("请输入会议地点")
  179. return
  180. }
  181. if(this.datainfo.zxConferenceUserList.length<1){
  182. this.$toast("请选择会议人员")
  183. return
  184. }
  185. var params=this.datainfo
  186. if(that.pagetype=='add'){
  187. getMeetAddFn(params).then(res=>{
  188. if(res.code==200){
  189. that.$toast("提交成功")
  190. uni.$emit("refreshlist")
  191. setTimeout(function(){
  192. uni.navigateBack({
  193. delta: 1 //返回层数,2则上上页
  194. });
  195. },1200)
  196. }
  197. })
  198. }else{
  199. getMeetEditFn(params).then(res=>{
  200. if(res.code==200){
  201. that.$toast("修改成功")
  202. uni.$emit("refreshdetail")
  203. setTimeout(function(){
  204. uni.navigateBack({
  205. delta: 1 //返回层数,2则上上页
  206. });
  207. },1200)
  208. }
  209. })
  210. }
  211. },
  212. }
  213. }
  214. </script>
  215. <style scoped lang="scss">
  216. .bgtop{height: 150rpx;background-color: $com-cd3;width: 100%;}
  217. .pdbox{padding: 34rpx 24rpx 16rpx;}
  218. .addbox /deep/ .uni-forms-item{margin-bottom:36rpx;}
  219. .addbox /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 30rpx;}
  220. .addbox /deep/ .uni-forms-item__label{font-weight: bold;font-size: 30rpx;color: #343434;width: 198rpx !important;padding-left:20rpx;}
  221. .addbox /deep/ .is-required{position: absolute;left: 0;top: 50%;margin-top: -10rpx;}
  222. .addbox /deep/ .uni-data-checklist{display: flex;align-items: center;justify-content: flex-end;}
  223. .addbox /deep/ .uni-easyinput__placeholder-class{font-weight: 500;font-size: 30rpx;color: #AAAAAA;}
  224. .addbox /deep/ .checklist-box{margin-right: 0 !important;margin-left: 40rpx !important;}
  225. .fjadd{
  226. .btn{font-weight: bold;font-size: 30rpx;color: #1D64E2;margin: 0;display: flex;align-items: center;}
  227. }
  228. .addbox{margin-top: -120rpx;
  229. padding: 0 24rpx 50rpx;
  230. .boxs{background: #FFFFFF;border-radius: 30rpx;margin-bottom: 24rpx;overflow: hidden;position: relative;
  231. .infobg{width: 102rpx;height: 106rpx;position: absolute;right: 26rpx;bottom: 22rpx;}
  232. .tips{background: #F1F6FF;padding: 18rpx 38rpx;display: flex;align-items: flex-start;
  233. image{width: 20rpx;height: 26rpx;margin-right: 16rpx;flex:0 0 auto;margin-top: 4rpx;}
  234. view{font-weight: 500;font-size: 26rpx;color: #1D64E2;}
  235. }
  236. .titbox{
  237. .tit{
  238. image{width: 32rpx;height: 18rpx;margin-right: 10rpx;}
  239. view{font-weight: bold;font-size: 32rpx;color: #222327;}
  240. }
  241. .titr{width: 146rpx;height: 50rpx;background: #E4EEFF;border-radius: 26rpx;font-weight: 500;font-size: 24rpx;color: #1D64E2;text-align: center;line-height: 50rpx;}
  242. }
  243. .titinf{display: flex;flex-wrap: wrap;
  244. .txt{font-weight: 500;font-size: 28rpx;margin-bottom: 18rpx;flex:0 1 auto;min-width: 50%;display: flex;align-items: flex-start;color: #222327;
  245. text{flex: 0 0 auto;color: #9F9F9F;}
  246. }
  247. }
  248. .addpeo{font-weight: bold;font-size: 30rpx;color: #1D64E2;display: flex;align-items: center;
  249. image{width: 26rpx;height: 24rpx;margin-right: 14rpx;}
  250. }
  251. .openbox{display: flex;align-items: center;justify-content: flex-end;font-weight: 500;
  252. font-size: 30rpx;height: 100%;color: #222327;
  253. }
  254. .edtip{font-weight: 500;font-size: 22rpx;color: #FF0000;
  255. text{margin: 4rpx 8rpx 0 0;}
  256. &.pa{position: absolute;right: 0;bottom: -15px;text-align: right;width: 702rpx;}
  257. }
  258. }
  259. }
  260. .matab{display: flex;align-items: center;flex-wrap: nowrap;overflow: auto;position: absolute;left: 0;right: -48rpx;
  261. .list{min-width:112rpx;height: 50rpx;background: #ffffff;border-radius: 25rpx;font-size: 30rpx;font-weight: 500;box-sizing: border-box;
  262. color: #AAAAAA;padding: 0 24rpx;box-sizing: border-box;margin-left:24rpx;flex: 0 0 auto;border: 2rpx solid #C1C1C1;display: flex;align-items: center;justify-content: center;
  263. &.act{background: #E4EEFF;color: #1D64E2;border: none;}
  264. }
  265. }
  266. // 附件
  267. .fjlists {display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 12rpx;
  268. image{margin-right: 18rpx;flex: 0 0 auto;}
  269. .imgl{width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 16rpx;
  270. image{width: 26rpx;height: 24rpx;}
  271. }
  272. .tit{font-size: 26rpx;color: #343434;font-weight: 500;margin-top: 4rpx;}
  273. .delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;
  274. image{width: 26rpx;height: 26rpx;}
  275. }
  276. }
  277. .peoBox{font-size: 30rpx;color: #AAAAAA;min-height: 200rpx;display: flex;
  278. view{color: #222327;}
  279. }
  280. // 按钮
  281. .addbtn{display: flex;align-items: center;justify-content: space-between;padding-top: 26rpx;
  282. .btn{width: 336rpx;height: 80rpx;font-weight: bold;font-size: 30rpx;box-sizing: border-box;border-radius: 40rpx;display: flex;align-items: center;justify-content: center;
  283. &.btn1{border: 2rpx solid #1D64E2;background: #ffffff;color: #1D64E2;}
  284. &.btn2{background: #1D64E2;color: #ffffff;}
  285. }
  286. }
  287. .lbtabp{display: flex;align-items: center;flex: 0 0 auto;margin-left: 24rpx;height: 100%;justify-content: flex-end;
  288. view{font-size: 30rpx;color: #222327;}
  289. }
  290. .addbox /deep/ .pbbox .ql-editor p{text-indent: 2rem;}
  291. </style>