inform.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view>
  3. <view style="padding:5rpx 20rpx 45rpx 20rpx;">
  4. <view class="desc">
  5. <uni-row>
  6. <uni-col :span="5">
  7. <view class="desc" style="font-size: 25rpx;">
  8. 标题
  9. </view>
  10. </uni-col>
  11. <uni-col :span="19">
  12. <view>
  13. <uni-easyinput primaryColor="#37babd" v-model="form.noticeTitle">
  14. </uni-easyinput>
  15. </view>
  16. </uni-col>
  17. </uni-row>
  18. </view>
  19. <view class="desc">
  20. <uni-row>
  21. <uni-col :span="5">
  22. <view class="desc" style="font-size: 25rpx;">
  23. 发起人
  24. </view>
  25. </uni-col>
  26. <uni-col :span="19">
  27. <view>
  28. <uni-easyinput primaryColor="#37babd" v-model="form.noticeUsers" disabled>
  29. </uni-easyinput>
  30. </view>
  31. </uni-col>
  32. </uni-row>
  33. </view>
  34. <view class="desc">
  35. <uni-row>
  36. <uni-col :span="5">
  37. <view class="desc" style="font-size: 25rpx;">
  38. 接收人
  39. </view>
  40. </uni-col>
  41. <uni-col :span="19">
  42. <view class="pickerView">
  43. <picker @change="deptBindPickerChange" :value="deptConfig.deptIndex"
  44. :range="deptConfig.deptDatas" range-key="deptName">
  45. <view class="pickerText"
  46. v-if="deptConfig.deptDatas && deptConfig.deptDatas.length>0 && deptConfig.deptIndex !== undefined">
  47. {{ deptConfig.deptDatas[deptConfig.deptIndex].deptName }}
  48. </view>
  49. <view class="pickerText" v-else>
  50. {{defaultDept}}
  51. </view>
  52. </picker>
  53. </view>
  54. </uni-col>
  55. </uni-row>
  56. </view>
  57. <view class="desc">
  58. <view class="desc" style="font-size: 25rpx;">
  59. 通知内容
  60. </view>
  61. <view>
  62. <uni-easyinput type="textarea" primaryColor="#37babd" v-model="form.contentOfNotice">
  63. </uni-easyinput>
  64. </view>
  65. </view>
  66. <view class="desc">
  67. <view class="desc" style="font-size: 25rpx;">
  68. 备注
  69. </view>
  70. <view>
  71. <uni-easyinput type="textarea" primaryColor="#37babd" v-model="form.remark">
  72. </uni-easyinput>
  73. </view>
  74. </view>
  75. </view>
  76. <u-gap height="70" bgColor="#ffffff"></u-gap>
  77. <view class="bottim_view">
  78. <view>
  79. <u-row>
  80. <u-col span="11">
  81. <u-button :disabled="isDisabled" class="btnDoPay" shape="circle" @click="submit"
  82. color="rgb(55,186,189)" text="提交"></u-button>
  83. </u-col>
  84. </u-row>
  85. </view>
  86. </view>
  87. <!-- 下一步选择人员弹窗 -->
  88. <uni-popup ref="popup" background-color="#fff">
  89. <view style="height: 800rpx;">
  90. <view class="desc">
  91. <uni-row>
  92. <uni-col :span="10">
  93. <view style="font-size: 40rpx;color: rgb(145, 145, 145);">
  94. </view>
  95. </uni-col>
  96. <uni-col :span="11">
  97. <view style="font-size: 40rpx;color: rgb(98, 98, 98);">
  98. 下一步
  99. </view>
  100. </uni-col>
  101. <uni-col :span="3">
  102. <view @click="submitPass" style="font-size: 40rpx;color: rgb(55,186,189);">
  103. 确认
  104. </view>
  105. </uni-col>
  106. </uni-row>
  107. </view>
  108. <view>
  109. <!-- -->
  110. <uni-row>
  111. <uni-col>
  112. <view style="padding: 15rpx 20rpx;">
  113. <uni-data-picker ref="picker" placeholder="请选择" :popup-title="selectTitle"
  114. :localdata="dataTree" v-model="hxForm.candidate" @change="nextApprovalChange">
  115. </uni-data-picker>
  116. </view>
  117. </uni-col>
  118. </uni-row>
  119. </view>
  120. </view>
  121. </uni-popup>
  122. </view>
  123. </template>
  124. <script>
  125. export default {
  126. data() {
  127. return {
  128. isDisabled: false,
  129. selectTitle: '',
  130. hxForm: {},
  131. pageType: '',
  132. searchGoodsName: '',
  133. dataTree: [],
  134. form: {
  135. goodsId: '',
  136. goodsName: '',
  137. amount: 1,
  138. unit: '',
  139. remark: ''
  140. },
  141. org_dept_parent_id: '',
  142. index: 0,
  143. defaultDept: ''
  144. }
  145. },
  146. onLoad() {
  147. //申请人初始化
  148. this.form.applyUserName = uni.getStorageSync("userInfo").nickName
  149. },
  150. methods: {
  151. change(e) {
  152. console.log(e);
  153. },
  154. radioChange: function(evt) {
  155. this.form.remark = evt.detail.value
  156. },
  157. async submit() {
  158. this.isDisabled = true
  159. setTimeout(() => {
  160. this.isDisabled = false
  161. }, 1000)
  162. // if (!this.form.applyDepartment) {
  163. // this.isDisabled = false
  164. // uni.showModal({
  165. // content: '请选择所属部门',
  166. // title: '提交失败',
  167. // showCancel: false
  168. // })
  169. // return
  170. // }
  171. // if (!this.form.goodsName) {
  172. // this.isDisabled = false
  173. // uni.showModal({
  174. // content: '请选择物资',
  175. // title: '提交失败',
  176. // showCancel: false
  177. // })
  178. // return
  179. // }
  180. // if (!this.form.amount) {
  181. // this.isDisabled = false
  182. // uni.showModal({
  183. // content: '请填写数量',
  184. // title: '提交失败',
  185. // showCancel: false
  186. // })
  187. // return
  188. // }
  189. // if (!this.form.applyReason) {
  190. // this.isDisabled = false
  191. // uni.showModal({
  192. // content: '请选择领用类型',
  193. // title: '提交失败',
  194. // showCancel: false
  195. // })
  196. // return
  197. // }
  198. //统一写入参数
  199. this.form.applyUserId = uni.getStorageSync('setUserName')
  200. this.form.applyUserName = uni.getStorageSync('userInfo').nickName
  201. const {
  202. data: res
  203. } = await this.$httpRequest({
  204. url: '/app/submitApply/instantNotice',
  205. method: 'post',
  206. data: this.form,
  207. urlType: this.$getUrlType()
  208. });
  209. if (res.code === 200) {
  210. this.dataTree = res.data.tree
  211. this.hxForm.taskId = res.data.taskId
  212. this.$refs.popup.open('bottom')
  213. this.selectTitle = "请选择" + this.dataTree[0].text
  214. this.isDisabled = false
  215. } else {
  216. this.$showModal(res.msg)
  217. }
  218. this.isDisabled = false
  219. },
  220. async submitPass() {
  221. if (!this.hxForm.candidate) {
  222. uni.showModal({
  223. content: '请选择' + this.dataTree[0].text,
  224. title: '提交失败',
  225. showCancel: false,
  226. })
  227. }
  228. const {
  229. data: res
  230. } = await this.$httpRequest({
  231. url: '/app/task/submit/candidate?taskId=' + this.hxForm.taskId +
  232. '&candidate=' + this.hxForm.candidate + '&applyUserName=' + this.hxForm.applyUserName,
  233. method: 'get',
  234. urlType: this.$getUrlType()
  235. });
  236. if (res.code === 200) {
  237. uni.showModal({
  238. content: '已提交给审批人员',
  239. title: '提交成功',
  240. showCancel: false,
  241. success() {
  242. uni.navigateBack()
  243. }
  244. })
  245. } else {
  246. uni.showModal({
  247. content: res.msg,
  248. title: '提交失败',
  249. showCancel: false,
  250. success() {
  251. uni.navigateBack()
  252. }
  253. })
  254. }
  255. },
  256. nextApprovalChange(e) {
  257. // console.log('onchange:', e.detail.value[1].text);
  258. this.hxForm.applyUserName = e.detail.value[1].text
  259. this.hxForm.candidate = e.detail.value[1].value
  260. },
  261. maskClick(e) {}
  262. }
  263. }
  264. </script>
  265. <style lang="scss" scoped>
  266. .desc {
  267. padding: 10rpx 5rpx;
  268. color: #818181;
  269. font-size: 20rpx;
  270. }
  271. .pickerView {
  272. // align-items: flex-end;
  273. padding: 10rpx 20rpx;
  274. border: 1rpx #eeeeee solid;
  275. }
  276. .pickerText {
  277. font-size: 26rpx;
  278. color: #b1b1b1;
  279. }
  280. .bottim_view {
  281. padding: 5px 20px 30px;
  282. position: fixed;
  283. left: 0px;
  284. bottom: 0px;
  285. width: 100%;
  286. height: 40px;
  287. background-color: #ffffff;
  288. }
  289. </style>