#
whycq
2023-11-22 3913b3c5c8cde03f8c92d1c738d28c4a9bae7e55
pages/business/goBusiness/addgoBusiness.vue
@@ -203,7 +203,7 @@
                        subTitle: '出发日期',
                        placeholder: '请选择出发日期',
                        placeholderStyle: 'font-size:20rpx',
                        value: '2021-5-3',
                        value: '',
                        type: 'businessStartTime',
                        inputType: 'data',
                        required: true
@@ -222,7 +222,7 @@
                        subTitle: '结束日期',
                        placeholder: '请选择结束日期',
                        placeholderStyle: 'font-size:20rpx',
                        value: '2021-5-3',
                        value: '',
                        type: 'businessEndTime',
                        inputType: 'data',
                        required: true
@@ -269,8 +269,15 @@
         const eventChannel = this.getOpenerEventChannel();
         eventChannel.on('goBusinessDel', function(data) {
            if (data.data == 'add') {
               _this.getOrderId('')
            }
         })
         // 项目跟踪传过来的
         eventChannel.on('addType', function(data) {
            if (data.data.comeFrom == 'saleManage') {
               _this.form2[0].info[0].submitVal = data.data.orderId
               _this.form2[0].info[0].unshow = true
               _this.form2[0].info[0].required = false
            }
         })
@@ -280,7 +287,6 @@
      },
      methods: {
         getOrderId(condition) {
            // console.log(condition);
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/orderQueryName/auth`,
@@ -400,6 +406,8 @@
                              this.form[sub.type] = odd.id
                           }
                        }
                     } else {
                        this.form[sub.type] = sub.submitVal
                     }
                  } else {
                     this.form[sub.type] = sub.value
@@ -416,15 +424,40 @@
               }
            }
            // console.log(this.form.orderId);
            // console.log(this.orderIds);
            console.log(this.form);
            this.formAdd(this.form)
            // console.log(subPass);
            if (subPass) {
               // console.log(this.form);
            }
         },
         formAdd(form) {
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/businessTrip/add/auth`,
               header: {
                  'token': uni.getStorageSync('token'),
                  'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
               },
               sslVerify: false,
               data: form,
               method: 'POST',
               success(res) {
                  res = res.data
                  if (res.code === 200) {
                     uni.showToast({title: '添加成功', icon: "none", position: 'top'})
                     setTimeout(()=>{
                        uni.navigateBack({})
                     },1000)
                  } else if (res.code === 500) {
                     uni.showToast({title: '添加成功', icon: "none", position: 'top'})
                  } else {
                  }
               }
            })
         },
         showPicker(e) {
            switch (e) {
@@ -449,25 +482,25 @@
            }
         },
         businessTransportationConfirm(e) {
            console.log('confirm', e)
            // console.log('confirm', e)
            this.form2[1].info[0].value = e.value[0]
            this.form2[1].info[0].submitVal = e.indexs[0]
            this.businessTransportationShow = false
         },
         businessReturnConfirm(e) {
            console.log('confirm', e)
            // console.log('confirm', e)
            this.form2[1].info[1].value = e.value[0]
            this.form2[1].info[1].submitVal = e.indexs[0]
            this.businessReturnShow = false
         },
         businessStartTimeDayConfirm(e) {
            console.log('confirm', e)
            // console.log('confirm', e)
            this.form2[2].info[1].value = e.value[0]
            this.form2[2].info[1].submitVal = e.indexs[0]
            this.businessStartTimeDayShow = false
         },
         businessEndTimeDayConfirm(e) {
            console.log('confirm', e)
            // console.log('confirm', e)
            this.form2[2].info[3].value = e.value[0]
            this.form2[2].info[3].submitVal = e.indexs[0]
            this.businessEndTimeDayShow = false
@@ -504,7 +537,7 @@
            // console.log(shen.value , shi.value, qu.value);
            this.form2[1].info[4].value = e.value[0] + '/' + e.value[1] + '/' + e.value[2]
            this.form2[1].info[4].submitVal = shen.value + ',' + shi.value + ',' + qu.value
            console.log(this.form2[1].info[4].value, this.form2[1].info[4].submitVal);
            // console.log(this.form2[1].info[4].value, this.form2[1].info[4].submitVal);
         },
         pcdEndConfirm(e) {
            // console.log('confirm', e)
@@ -523,7 +556,7 @@
            // console.log(shen.value , shi.value, qu.value);
            this.form2[1].info[6].value = e.value[0] + '/' + e.value[1] + '/' + e.value[2]
            this.form2[1].info[6].submitVal = shen.value + ',' + shi.value + ',' + qu.value
            console.log(this.form2[1].info[6].value, this.form2[1].info[6].submitVal);
            // console.log(this.form2[1].info[6].value, this.form2[1].info[6].submitVal);
         }
      }
   }