admissionApply.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <view>
  3. <view class="basemsg-box">
  4. <view >
  5. <text>基本信息</text>
  6. </view>
  7. <view class="basemsg">
  8. <label >
  9. <view class="label-name">
  10. 创建人
  11. </view>
  12. <view class="label-data" >
  13. <input disabled type="text" v-model="form.CreateMan">
  14. </view>
  15. </label>
  16. <label >
  17. <view class="label-name">
  18. 申请人
  19. </view>
  20. <view class="label-data">
  21. <input type="text" placeholder="申请人" v-model="form.ApplyMan">
  22. <!-- <uni-data-select
  23. v-model="valueApplyMan"
  24. :localdata="rangeApplyMan"
  25. @change="changeApplyMan"
  26. style="z-index: 999;"></uni-data-select> -->
  27. </view>
  28. </label>
  29. <label >
  30. <view class="label-name">
  31. 组织
  32. </view>
  33. <view class="label-data">
  34. <!-- <input type="text" placeholder="组织" v-model="form.organization"> -->
  35. <uni-data-select
  36. v-model="value"
  37. :localdata="range"
  38. @change="change"
  39. ></uni-data-select>
  40. </view>
  41. </label>
  42. <label >
  43. <view class="label-name">
  44. 申请日期
  45. </view>
  46. <view class="label-data">
  47. <input type="text" @click="open" v-model="form.ApplyTime" placeholder="请选择申请日期">
  48. <uni-calendar
  49. ref="calendar"
  50. :insert="false"
  51. @confirm="confirm"
  52. />
  53. </view>
  54. </label>
  55. <label >
  56. <view class="label-name">
  57. 隔离日期
  58. </view>
  59. <view class="label-data">
  60. <input type="text" @click="openQuarantine" v-model="form.IsolationTime" placeholder="请选择隔离日期">
  61. <uni-calendar
  62. ref="calendarQuarantine"
  63. :insert="false"
  64. @confirm="confirmQuarantine"/>
  65. </view>
  66. </label>
  67. </view>
  68. </view>
  69. <view class="register-box">
  70. <view class="">
  71. <text>人员信息登记</text>
  72. </view>
  73. <view >
  74. <textarea v-model="form.PersonMsg" class="register-textarea" name="" id="" cols="60" rows="10" ></textarea>
  75. </view>
  76. </view>
  77. <view class="button-box">
  78. <button class="button-msg" @click="submitF()">提交</button>
  79. <button class="button-msg" @click="back()">取消</button>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import {applyadmission,getApplyManList} from "../../api/sampling.js"
  85. export default {
  86. data() {
  87. return {
  88. form:{
  89. ApplyTime:'',
  90. IsolationTime:'',
  91. CreateMan:'原动力',
  92. ApplyMan:'',
  93. OrganizationName:'',
  94. PersonMsg:''
  95. },
  96. range: [
  97. { value: 1, text: "养猪组织" },
  98. { value: 2, text: "养鱼组织" },
  99. { value: 3, text: "养花组织" },
  100. { value: 4, text: "养羊组织" },
  101. ],
  102. value: 0,
  103. rangeApplyMan: [
  104. { value: 1, text: "猪组织" },
  105. { value: 2, text: "鱼组织" },
  106. { value: 3, text: "花组织" },
  107. { value: 4, text: "羊组织" },
  108. ],
  109. valueApplyMan: 0
  110. };
  111. },
  112. methods:{
  113. changeApplyMan(e) {
  114. console.log("e:", e);
  115. this.form.ApplyMan = e
  116. },
  117. change(e) {
  118. // console.log("e:", e);
  119. this.form.OrganizationName = e
  120. },
  121. open(){
  122. this.$refs.calendar.open();
  123. },
  124. confirm(e) {
  125. // console.log(e);
  126. this.form.ApplyTime = e.fulldate
  127. },
  128. openQuarantine(){
  129. this.$refs.calendarQuarantine.open();
  130. },
  131. confirmQuarantine(e) {
  132. this.form.IsolationTime = e.fulldate
  133. },
  134. submitF(){
  135. const data = this.form
  136. if(this.form.ApplyMan === ""){
  137. uni.showToast({
  138. title: '请选择申请人',
  139. icon:'none',
  140. duration: 1000
  141. });
  142. return
  143. }
  144. if(this.form.OrganizationName === ""){
  145. uni.showToast({
  146. title: '请选择组织',
  147. icon:'none',
  148. duration: 1000
  149. });
  150. return
  151. }
  152. if(this.form.ApplyTime === ""){
  153. uni.showToast({
  154. title: '请选择申请时间',
  155. icon:'none',
  156. duration: 1000
  157. });
  158. return
  159. }
  160. if(this.form.IsolationTime === ""){
  161. uni.showToast({
  162. title: '请选择隔离时间',
  163. icon:'none',
  164. duration: 1000
  165. });
  166. return
  167. }
  168. // console.log(data)
  169. applyadmission(data).then((res)=>{
  170. console.log(res)
  171. if(res=="添加成功"){
  172. uni.showToast({
  173. title: '提交成功',
  174. icon:'none',
  175. duration: 1000
  176. });
  177. uni.navigateBack({
  178. delta: 1
  179. });
  180. }else{
  181. uni.showToast({
  182. title: '提交失败',
  183. icon:'none',
  184. duration: 1000
  185. });
  186. }
  187. })
  188. },
  189. back(){
  190. uni.navigateBack({
  191. delta: 1
  192. });
  193. }
  194. },
  195. onShow(){
  196. // getApplyManList().then(res=>{
  197. // console.log(res)
  198. // const newArr = res.map(item=>{
  199. // return { 'value':item.code, 'text': item.PersonName}
  200. // })
  201. // this.rangeApplyMan = newArr
  202. // })
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. page{
  208. background-color: #f8f8f8;
  209. }
  210. .register-box{
  211. margin: 30rpx;
  212. }
  213. .register-textarea{
  214. margin-top: 15rpx;
  215. background-color: white;
  216. border:2px solid #f8f8f8;
  217. padding: 20rpx;
  218. }
  219. .basemsg-box{
  220. margin: 30rpx;
  221. .basemsg{
  222. background-color: #ffffff;
  223. margin-top: 15rpx;
  224. }
  225. }
  226. .label-name,.label-data{
  227. display: inline-block;
  228. }
  229. .label-name{
  230. width: 20%;
  231. line-height: 80rpx;
  232. font-weight: 700;
  233. word-wrap: break-word;
  234. // text-align: center;
  235. padding-left: 20rpx;
  236. }
  237. .label-data{
  238. // text-align: center;
  239. padding-left: 50rpx;
  240. width: 65%;
  241. line-height: 80rpx;
  242. word-wrap: break-word;
  243. vertical-align: middle
  244. }
  245. .button-box{
  246. display: flex;
  247. justify-content:space-around;
  248. }
  249. .button-msg{
  250. width: 25%;
  251. border-radius: 30rpx;
  252. background-color: #1296db;
  253. color: #ffffff;
  254. font-size: 30rpx;
  255. }
  256. /deep/ .uni-select{
  257. border: none;
  258. // z-index: 99;
  259. }
  260. /deep/ .uni-select__selector{
  261. z-index: 99;
  262. }
  263. </style>