|  | @@ -1,5 +1,5 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -    <div>
 | 
	
		
			
				|  |  | +    <div  v-loading="fullscreenLoading">
 | 
	
		
			
				|  |  |          <div class="groupedit">
 | 
	
		
			
				|  |  |              <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
 | 
	
		
			
				|  |  |                  <div class="required-box">
 | 
	
	
		
			
				|  | @@ -89,9 +89,9 @@
 | 
	
		
			
				|  |  |                      </el-form-item>
 | 
	
		
			
				|  |  |                  </el-form>
 | 
	
		
			
				|  |  |                  <el-form-item>
 | 
	
		
			
				|  |  | -                  <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
 | 
	
		
			
				|  |  | +                  <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
 | 
	
		
			
				|  |  |                    <el-button @click="resetForm('ruleForm')">重 置</el-button>
 | 
	
		
			
				|  |  | -                  <el-button @click="resetForm('ruleForm')">返 回</el-button>
 | 
	
		
			
				|  |  | +                  <el-button @click="clickback()">返 回</el-button>
 | 
	
		
			
				|  |  |                  </el-form-item>
 | 
	
		
			
				|  |  |                </el-form>
 | 
	
		
			
				|  |  |          </div>
 | 
	
	
		
			
				|  | @@ -99,11 +99,14 @@
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | +import { el } from '@fullcalendar/core/internal-common';
 | 
	
		
			
				|  |  | +import { all } from 'q';
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |      data() {
 | 
	
		
			
				|  |  |        return {
 | 
	
		
			
				|  |  |          editid:'',
 | 
	
		
			
				|  |  |          token:'',
 | 
	
		
			
				|  |  | +        userid:'',
 | 
	
		
			
				|  |  |          ruleForm: {
 | 
	
		
			
				|  |  |            quotenum:'',
 | 
	
		
			
				|  |  |            groupname: '',
 | 
	
	
		
			
				|  | @@ -176,24 +179,31 @@ export default {
 | 
	
		
			
				|  |  |              { required: true, message: '请输入出款额', trigger: 'blur' },
 | 
	
		
			
				|  |  |              {pattern:"^\\d+(\\.\\d+)?$",message: "请输入正浮点数或整数",trigger: "blur"}
 | 
	
		
			
				|  |  |            ]
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        fullscreenLoading:false
 | 
	
		
			
				|  |  |        };
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      methods: {
 | 
	
		
			
				|  |  | -      submitForm(formName) {
 | 
	
		
			
				|  |  | -        this.$refs[formName].validate((valid) => {
 | 
	
		
			
				|  |  | -          if (valid) {
 | 
	
		
			
				|  |  | -            alert('submit!');
 | 
	
		
			
				|  |  | -          } else {
 | 
	
		
			
				|  |  | -            console.log('error submit!!');
 | 
	
		
			
				|  |  | -            return false;
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      resetForm(formName) {
 | 
	
		
			
				|  |  | -        this.$refs[formName].resetFields();
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      getdown(){
 | 
	
		
			
				|  |  | +        submitForm(formName) {
 | 
	
		
			
				|  |  | +            this.$refs[formName].validate((valid) => {
 | 
	
		
			
				|  |  | +            if (valid) {
 | 
	
		
			
				|  |  | +                this.addGroupInfo()
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                console.log('error submit!!');
 | 
	
		
			
				|  |  | +                return false;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //清空
 | 
	
		
			
				|  |  | +        resetForm(formName) {
 | 
	
		
			
				|  |  | +            this.$refs[formName].resetFields();
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //返回
 | 
	
		
			
				|  |  | +        clickback(){
 | 
	
		
			
				|  |  | +            this.$router.go(-1);
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //获取下拉列表
 | 
	
		
			
				|  |  | +        getdown(){
 | 
	
		
			
				|  |  |              var url="/api/Groups/GroupEditBasicSource"
 | 
	
		
			
				|  |  |              var that=this
 | 
	
		
			
				|  |  |              this.$axios({
 | 
	
	
		
			
				|  | @@ -213,23 +223,39 @@ export default {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  | +        //新增获取销售号
 | 
	
		
			
				|  |  |          getSalesQuoteNo(){
 | 
	
		
			
				|  |  | -            var url="/api/Groups/GetGroupSalesQuoteNo"
 | 
	
		
			
				|  |  | -            var that=this
 | 
	
		
			
				|  |  |              if(this.editid==undefined){
 | 
	
		
			
				|  |  | -                this.$axios({
 | 
	
		
			
				|  |  | -                    method: 'post',
 | 
	
		
			
				|  |  | -                    url:url,
 | 
	
		
			
				|  |  | -                    headers:{
 | 
	
		
			
				|  |  | -                        Authorization:'Bearer '+this.token
 | 
	
		
			
				|  |  | -                    },
 | 
	
		
			
				|  |  | -                }).then(function(res){
 | 
	
		
			
				|  |  | -                    if(res.data.code==200){
 | 
	
		
			
				|  |  | -                        that.ruleForm.quotenum=res.data.data.salesQuoteNo;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                })
 | 
	
		
			
				|  |  | +                var url="/api/Groups/GetGroupSalesQuoteNo"
 | 
	
		
			
				|  |  | +                var that=this
 | 
	
		
			
				|  |  | +                if(this.editid==undefined){
 | 
	
		
			
				|  |  | +                    this.$axios({
 | 
	
		
			
				|  |  | +                        method: 'post',
 | 
	
		
			
				|  |  | +                        url:url,
 | 
	
		
			
				|  |  | +                        headers:{
 | 
	
		
			
				|  |  | +                            Authorization:'Bearer '+this.token
 | 
	
		
			
				|  |  | +                        },
 | 
	
		
			
				|  |  | +                    }).then(function(res){
 | 
	
		
			
				|  |  | +                        if(res.data.code==200){
 | 
	
		
			
				|  |  | +                            that.ruleForm.quotenum=res.data.data.salesQuoteNo;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    })
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  | +        //处理时间
 | 
	
		
			
				|  |  | +        disposeTime(val){
 | 
	
		
			
				|  |  | +            var date = new Date(val);
 | 
	
		
			
				|  |  | +            var y = date.getFullYear();
 | 
	
		
			
				|  |  | +            var m = date.getMonth() + 1;
 | 
	
		
			
				|  |  | +            m = m < 10 ? ('0' + m) : m;
 | 
	
		
			
				|  |  | +            var d = date.getDate();
 | 
	
		
			
				|  |  | +            d = d < 10 ? ('0' + d) : d;
 | 
	
		
			
				|  |  | +            let time = y + '-' + m + '-' + d;
 | 
	
		
			
				|  |  | +            return time
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //编辑获取原数据
 | 
	
		
			
				|  |  |          getGroupInfo(){
 | 
	
		
			
				|  |  |              var url="/api/Groups/GetGroupInfo"
 | 
	
		
			
				|  |  |              var that=this
 | 
	
	
		
			
				|  | @@ -275,11 +301,78 @@ export default {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  })
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //新增编辑
 | 
	
		
			
				|  |  | +        addGroupInfo(){
 | 
	
		
			
				|  |  | +            var url="/api/Groups/GroupOperation";
 | 
	
		
			
				|  |  | +            var that=this;
 | 
	
		
			
				|  |  | +            that.fullscreenLoading = true;
 | 
	
		
			
				|  |  | +            var status
 | 
	
		
			
				|  |  | +            if(this.editid!=undefined){
 | 
	
		
			
				|  |  | +                status=2
 | 
	
		
			
				|  |  | +            }else{
 | 
	
		
			
				|  |  | +                status=1
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            debugger
 | 
	
		
			
				|  |  | +            this.$axios({
 | 
	
		
			
				|  |  | +                    method: 'post',
 | 
	
		
			
				|  |  | +                    url:url,
 | 
	
		
			
				|  |  | +                    headers:{
 | 
	
		
			
				|  |  | +                        Authorization:'Bearer '+this.token
 | 
	
		
			
				|  |  | +                    },
 | 
	
		
			
				|  |  | +                    data:{
 | 
	
		
			
				|  |  | +                        portType:1,
 | 
	
		
			
				|  |  | +                        status:status,//添加1//修改2//删除3
 | 
	
		
			
				|  |  | +                        id:that.editid,
 | 
	
		
			
				|  |  | +                        userId:that.userid,
 | 
	
		
			
				|  |  | +                        salesQuoteNo:that.ruleForm.quotenum,
 | 
	
		
			
				|  |  | +                        jietuanOperator:parseInt(that.ruleForm.person),//
 | 
	
		
			
				|  |  | +                        teamLevSId:parseInt(that.ruleForm.grades),//
 | 
	
		
			
				|  |  | +                        teamDid:parseInt(that.ruleForm.OP),//
 | 
	
		
			
				|  |  | +                        teamName:that.ruleForm.groupname,
 | 
	
		
			
				|  |  | +                        clientName:that.ruleForm.customername,
 | 
	
		
			
				|  |  | +                        clientUnit:that.ruleForm.customerunits,
 | 
	
		
			
				|  |  | +                        visitCountry:that.ruleForm.countriesvisited.replaceAll("、","|"),
 | 
	
		
			
				|  |  | +                        visitDate:that.disposeTime(that.ruleForm.visitingtime),
 | 
	
		
			
				|  |  | +                        visitDays:parseInt(that.ruleForm.numdays),
 | 
	
		
			
				|  |  | +                        visitPNumber:parseInt(that.ruleForm.numperson),
 | 
	
		
			
				|  |  | +                        tontractTime:that.disposeTime(that.ruleForm.contracttime),
 | 
	
		
			
				|  |  | +                        payDay:parseInt(that.ruleForm.occasion),
 | 
	
		
			
				|  |  | +                        paymentMoney:parseInt(that.ruleForm.payments),
 | 
	
		
			
				|  |  | +                        visitPurpose:that.ruleForm.purposevisit,
 | 
	
		
			
				|  |  | +                        specialNeeds:that.ruleForm.specialneeds,
 | 
	
		
			
				|  |  | +                        otherNeeds:that.ruleForm.otherneeds,
 | 
	
		
			
				|  |  | +                        cgrwspbmmc:that.ruleForm.approvalname,
 | 
	
		
			
				|  |  | +                        cgrwspwh:that.ruleForm.approvalnumber1,
 | 
	
		
			
				|  |  | +                        zzscbmmc:that.ruleForm.censorshipdepartment,
 | 
	
		
			
				|  |  | +                        zzscspwh:that.ruleForm.approvalnumber2,
 | 
	
		
			
				|  |  | +                        tellPhone:that.ruleForm.phonenumber,
 | 
	
		
			
				|  |  | +                        remark:that.ruleForm.remark,
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }).then(function(res){
 | 
	
		
			
				|  |  | +                    console.log(res)
 | 
	
		
			
				|  |  | +                    if(res.data.code==200){
 | 
	
		
			
				|  |  | +                        that.$message({
 | 
	
		
			
				|  |  | +                            message: res.data.msg,
 | 
	
		
			
				|  |  | +                            type: 'success',
 | 
	
		
			
				|  |  | +                            offset:50
 | 
	
		
			
				|  |  | +                        });
 | 
	
		
			
				|  |  | +                        that.fullscreenLoading = false;
 | 
	
		
			
				|  |  | +                    }else{
 | 
	
		
			
				|  |  | +                        that.$message({
 | 
	
		
			
				|  |  | +                            message:res.data.msg,
 | 
	
		
			
				|  |  | +                            type: 'warning',
 | 
	
		
			
				|  |  | +                            offset:50
 | 
	
		
			
				|  |  | +                        });
 | 
	
		
			
				|  |  | +                        that.fullscreenLoading = false;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                })
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      mounted(){
 | 
	
		
			
				|  |  |          this.editid=this.$route.query.id;
 | 
	
		
			
				|  |  |          this.token=JSON.parse(localStorage.getItem('userinif')).token;
 | 
	
		
			
				|  |  | +        this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
 | 
	
		
			
				|  |  |          this.getSalesQuoteNo();
 | 
	
		
			
				|  |  |          this.getdown();
 | 
	
		
			
				|  |  |          this.getGroupInfo();
 |