<template> 
 | 
  <div class="box" style="max-height:calc(100% - 60px);margin-bottom:50px;overflow-y: auto" > 
 | 
    <el-form :model="form" ref="form"> 
 | 
      <div style="margin: 20px 0 20px 0;background-color: rgba(140,147,157,0.61)"> 
 | 
        <span style="font-size: 15px; font-weight: bold">【1】发单方取消订单配置</span> 
 | 
      </div> 
 | 
      <el-form-item label="" label-width="10px"  prop="releaseCancelTime"> 
 | 
        接单后,距离任务开始前 
 | 
        <el-input 
 | 
            style="width: 100px;margin:  0px 20px" 
 | 
            type="number" 
 | 
            v-model="form.releaseCancelTime" 
 | 
            placeholder="请输入" 
 | 
            v-trim 
 | 
        />小时,不可取消 
 | 
      </el-form-item> 
 | 
      <el-form-item label="" label-width="10px" prop="releaseCancelTimes"> 
 | 
      每日可主动取消 
 | 
        <el-input 
 | 
            style="width: 100px;margin: 0px 20px" 
 | 
            type="number" 
 | 
            v-model="form.releaseCancelTimes" 
 | 
            placeholder="请输入" 
 | 
            v-trim 
 | 
        />次<span style="font-size: 12px;color: #8c939d">(注:订单接单后可取消时间范围内)</span> 
 | 
      </el-form-item> 
 | 
      <div style="margin:50px 0 20px 0;background-color: rgba(140,147,157,0.61)"> 
 | 
        <span style="font-size: 15px; font-weight: bold">【2】接单方取消订单配置:</span> 
 | 
      </div> 
 | 
      <el-form-item label="" label-width="10px"  prop="receiveCancelTime"> 
 | 
        接单后,距离任务开始前 
 | 
        <el-input 
 | 
            style="width: 100px;margin: 0px 20px" 
 | 
            type="number" 
 | 
            v-model="form.receiveCancelTime" 
 | 
            placeholder="请输入" 
 | 
            v-trim 
 | 
        />小时,不可取消 
 | 
      </el-form-item> 
 | 
      <el-form-item label="" label-width="10px" prop="receiveCancelTimes"> 
 | 
        每日可主动取消 
 | 
        <el-input 
 | 
            style="width: 100px;margin: 0px 20px" 
 | 
            type="number" 
 | 
            v-model="form.receiveCancelTimes" 
 | 
            placeholder="请输入" 
 | 
            v-trim 
 | 
        />次<span style="font-size: 12px;color: #8c939d">(注:订单接单后可取消时间范围内)</span> 
 | 
      </el-form-item> 
 | 
        <div style="margin:50px 0 20px 0;background-color: rgba(140,147,157,0.61)"> 
 | 
          <span style="font-size: 15px; font-weight: bold">【3】自动派单:</span> 
 | 
        </div> 
 | 
        <el-form-item label="" label-width="10px"  prop="autoDispatch"> 
 | 
          <el-input 
 | 
              style="width: 100px;margin: 0px 20px" 
 | 
              type="number" 
 | 
              v-model="form.autoDispatch" 
 | 
              placeholder="请输入" 
 | 
              v-trim 
 | 
          />分钟无人接单,系统自动派单 
 | 
        </el-form-item> 
 | 
        <div style="margin:50px 0 20px 0;background-color: rgba(140,147,157,0.61)"> 
 | 
          <span style="font-size: 15px; font-weight: bold">【4】派单范围:</span> 
 | 
        </div> 
 | 
        <el-form-item label="" label-width="10px"  prop="autoDispatchDistance"> 
 | 
          距离用工地点<el-input 
 | 
              style="width: 100px;margin: 0px 20px" 
 | 
              type="number" 
 | 
              v-model="form.autoDispatchDistance" 
 | 
              placeholder="请输入" 
 | 
              v-trim 
 | 
          />km范围内,进行派单 
 | 
        </el-form-item> 
 | 
        <div style="margin:50px 0 20px 0;background-color: rgba(140,147,157,0.61)"> 
 | 
          <span style="font-size: 15px; font-weight: bold">【5】订单修改:</span> 
 | 
        </div> 
 | 
        <el-form-item label="" label-width="10px"  prop="autoConfirm"> 
 | 
          订单修改后,接单方<el-input 
 | 
              style="width: 100px;margin: 0px 20px" 
 | 
              type="number" 
 | 
              v-model="form.autoConfirm" 
 | 
              placeholder="请输入" 
 | 
              v-trim 
 | 
          />分钟后未确认,系统自动同意 
 | 
        </el-form-item> 
 | 
        <el-form-item style="margin-top: 100px;width: 100%;text-align: center"> 
 | 
          <el-button type="primary" style="width: 300px"  :loading="working" @click="submit">保存配置项</el-button> 
 | 
        </el-form-item> 
 | 
      </el-form> 
 | 
  </div> 
 | 
</template> 
 | 
  
 | 
<script> 
 | 
import { getPlatformConfig, updPlatformConfig } from '@/api/system/dictData' 
 | 
export default { 
 | 
  name: '', 
 | 
  data () { 
 | 
    return { 
 | 
      uploadData: { 
 | 
        folder: '' 
 | 
      }, 
 | 
      isUploading: false, 
 | 
      working: false, 
 | 
      form: { 
 | 
        releaseCancelTimes: null, 
 | 
        releaseCancelTime: null, 
 | 
        receiveCancelTimes: null, 
 | 
        receiveCancelTime: null, 
 | 
        autoDispatch: null, 
 | 
        autoDispatchDistance: null, 
 | 
        autoConfirm: null 
 | 
      } 
 | 
    } 
 | 
  }, 
 | 
  
 | 
  created () { 
 | 
    this.getData() 
 | 
  }, 
 | 
  
 | 
  methods: { 
 | 
    getData () { 
 | 
      getPlatformConfig({}) 
 | 
        .then(res => { 
 | 
          if (res) { 
 | 
            this.form ={ 
 | 
              releaseCancelTimes: res.releaseCancelTimes || null, 
 | 
              releaseCancelTime:   res.releaseCancelTime|| null, 
 | 
              receiveCancelTimes:  res.receiveCancelTimes|| null, 
 | 
              receiveCancelTime:  res.receiveCancelTime|| null, 
 | 
              autoDispatch:  res.autoDispatch|| null, 
 | 
              autoDispatchDistance:  res.autoDispatchDistance|| null, 
 | 
              autoConfirm:  res.autoConfirm|| null 
 | 
            } 
 | 
          } 
 | 
        }) 
 | 
    }, 
 | 
    submit () { 
 | 
      console.log(this.form) 
 | 
      this.$refs.form.validate((valid) => { 
 | 
        if (!valid) { 
 | 
          return 
 | 
        } 
 | 
        // 调用新建接口 
 | 
        this.isWorking = true 
 | 
        updPlatformConfig(this.form).then(res => { 
 | 
          this.$message.success('保存成功') 
 | 
          this.getData() 
 | 
        }) 
 | 
          .catch(e => { 
 | 
            this.$tip.apiFailed(e) 
 | 
          }) 
 | 
          .finally(() => { 
 | 
            this.isWorking = false 
 | 
          }) 
 | 
      }) 
 | 
    } 
 | 
  } 
 | 
} 
 | 
</script> 
 | 
<style lang="scss" scoped> 
 | 
.el-container /deep/  .el-main{ 
 | 
  width: 100%; 
 | 
  overflow-y: auto  !important ; 
 | 
  height: calc(100% - 94px); 
 | 
} 
 | 
/deep/ .el-main{ 
 | 
  width: 100%; 
 | 
  //height: 100%; 
 | 
  overflow-y: auto  !important ; 
 | 
  height: calc(100% - 94px); 
 | 
} 
 | 
.box { 
 | 
  width: 100%; 
 | 
  padding: 30px; 
 | 
  box-sizing: border-box; 
 | 
  background: #ffffff; 
 | 
} 
 | 
</style> 
 |