rk
2025-09-28 2304d7b140c5c5b4bf3a83f9ced8bff37d20c42e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<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>