123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <template>
- <view>
- <view class="basemsg-box">
- <view >
- <text>基本信息</text>
- </view>
- <view class="basemsg">
- <label >
- <view class="label-name">
- 创建人
- </view>
- <view class="label-data" >
- <input disabled type="text" v-model="form.CreateMan">
- </view>
- </label>
- <label >
- <view class="label-name">
- 申请人
- </view>
- <view class="label-data">
- <input type="text" placeholder="申请人" v-model="form.ApplyMan">
- <!-- <uni-data-select
- v-model="valueApplyMan"
- :localdata="rangeApplyMan"
- @change="changeApplyMan"
- style="z-index: 999;"></uni-data-select> -->
- </view>
- </label>
- <label >
- <view class="label-name">
- 组织
- </view>
- <view class="label-data">
- <!-- <input type="text" placeholder="组织" v-model="form.organization"> -->
- <uni-data-select
- v-model="value"
- :localdata="range"
- @change="change"
- ></uni-data-select>
- </view>
- </label>
- <label >
- <view class="label-name">
- 申请日期
- </view>
- <view class="label-data">
- <input type="text" @click="open" v-model="form.ApplyTime" placeholder="请选择申请日期">
- <uni-calendar
- ref="calendar"
- :insert="false"
- @confirm="confirm"
- />
- </view>
- </label>
- <label >
- <view class="label-name">
- 隔离日期
- </view>
- <view class="label-data">
- <input type="text" @click="openQuarantine" v-model="form.IsolationTime" placeholder="请选择隔离日期">
- <uni-calendar
- ref="calendarQuarantine"
- :insert="false"
- @confirm="confirmQuarantine"/>
- </view>
- </label>
- </view>
- </view>
- <view class="register-box">
- <view class="">
- <text>人员信息登记</text>
- </view>
- <view >
- <textarea v-model="form.PersonMsg" class="register-textarea" name="" id="" cols="60" rows="10" ></textarea>
- </view>
- </view>
- <view class="button-box">
- <button class="button-msg" @click="submitF()">提交</button>
- <button class="button-msg" @click="back()">取消</button>
- </view>
- </view>
- </template>
- <script>
- import {applyadmission,getApplyManList} from "../../api/sampling.js"
- export default {
- data() {
- return {
- form:{
- ApplyTime:'',
- IsolationTime:'',
- CreateMan:'原动力',
- ApplyMan:'',
- OrganizationName:'',
- PersonMsg:''
- },
- range: [
- { value: 1, text: "养猪组织" },
- { value: 2, text: "养鱼组织" },
- { value: 3, text: "养花组织" },
- { value: 4, text: "养羊组织" },
- ],
- value: 0,
- rangeApplyMan: [
- { value: 1, text: "猪组织" },
- { value: 2, text: "鱼组织" },
- { value: 3, text: "花组织" },
- { value: 4, text: "羊组织" },
- ],
- valueApplyMan: 0
- };
- },
- methods:{
- changeApplyMan(e) {
- console.log("e:", e);
- this.form.ApplyMan = e
- },
- change(e) {
- // console.log("e:", e);
- this.form.OrganizationName = e
- },
- open(){
- this.$refs.calendar.open();
- },
- confirm(e) {
- // console.log(e);
- this.form.ApplyTime = e.fulldate
- },
- openQuarantine(){
- this.$refs.calendarQuarantine.open();
- },
- confirmQuarantine(e) {
- this.form.IsolationTime = e.fulldate
- },
- submitF(){
- const data = this.form
- if(this.form.ApplyMan === ""){
- uni.showToast({
- title: '请选择申请人',
- icon:'none',
- duration: 1000
- });
- return
- }
- if(this.form.OrganizationName === ""){
- uni.showToast({
- title: '请选择组织',
- icon:'none',
- duration: 1000
- });
- return
- }
- if(this.form.ApplyTime === ""){
- uni.showToast({
- title: '请选择申请时间',
- icon:'none',
- duration: 1000
- });
- return
- }
- if(this.form.IsolationTime === ""){
- uni.showToast({
- title: '请选择隔离时间',
- icon:'none',
- duration: 1000
- });
- return
- }
- // console.log(data)
- applyadmission(data).then((res)=>{
- console.log(res)
- if(res=="添加成功"){
- uni.showToast({
- title: '提交成功',
- icon:'none',
- duration: 1000
- });
- uni.navigateBack({
- delta: 1
- });
- }else{
- uni.showToast({
- title: '提交失败',
- icon:'none',
- duration: 1000
- });
- }
-
- })
- },
- back(){
- uni.navigateBack({
- delta: 1
- });
- }
- },
- onShow(){
- // getApplyManList().then(res=>{
- // console.log(res)
- // const newArr = res.map(item=>{
- // return { 'value':item.code, 'text': item.PersonName}
- // })
- // this.rangeApplyMan = newArr
- // })
- }
- }
- </script>
- <style lang="scss" scoped>
- page{
- background-color: #f8f8f8;
- }
- .register-box{
- margin: 30rpx;
- }
- .register-textarea{
- margin-top: 15rpx;
- background-color: white;
- border:2px solid #f8f8f8;
- padding: 20rpx;
- }
- .basemsg-box{
- margin: 30rpx;
- .basemsg{
- background-color: #ffffff;
- margin-top: 15rpx;
- }
- }
- .label-name,.label-data{
- display: inline-block;
-
- }
- .label-name{
- width: 20%;
- line-height: 80rpx;
- font-weight: 700;
- word-wrap: break-word;
- // text-align: center;
- padding-left: 20rpx;
- }
- .label-data{
- // text-align: center;
- padding-left: 50rpx;
- width: 65%;
- line-height: 80rpx;
- word-wrap: break-word;
- vertical-align: middle
- }
- .button-box{
- display: flex;
- justify-content:space-around;
- }
- .button-msg{
- width: 25%;
- border-radius: 30rpx;
- background-color: #1296db;
- color: #ffffff;
- font-size: 30rpx;
- }
- /deep/ .uni-select{
- border: none;
- // z-index: 99;
- }
- /deep/ .uni-select__selector{
- z-index: 99;
- }
- </style>
|