Browse Source

系统设置新增 退改设置、客服设置

hzj18279462576@163.com 9 months ago
parent
commit
a6eec13f39
2 changed files with 160 additions and 26 deletions
  1. 2 2
      src/views/busquery/busquery.vue
  2. 158 24
      src/views/waiting/waiting.vue

+ 2 - 2
src/views/busquery/busquery.vue

@@ -1716,11 +1716,11 @@ const submitAddQuery = async (formEl) => {
 };
 
 // 是否可提前预约
-const stateChange = async (row,val) => {
+const stateChange = async (row, val) => {
   let data = new FormData();
   data.set("id", row.id);
   data.set("beforeState", row.before_state);
-  
+
   let res = await axios({
     method: "post",
     url: api.value + "/scheubs.action",

+ 158 - 24
src/views/waiting/waiting.vue

@@ -27,12 +27,13 @@
               >取消</el-button
             > -->
           </div>
+          <span>周期配置 :&nbsp;&nbsp;</span>
           <div
-            style="display: flex; align-items: center; margin-bottom: 8px"
-            v-for="(i, ind) in timeList.list" :key="ind"
+            style="margin-bottom: 8px"
+            v-for="(i, ind) in timeList.list"
+            :key="ind"
           >
             <div class="addTime">
-              <span>周期配置&nbsp;&nbsp;</span>
               <el-checkbox-group
                 @change="saveTime($event, i.id, '星期一')"
                 v-model="i.day1"
@@ -90,19 +91,19 @@
                   @change="saveTime($event, i.id)"
                 />
               </div>
-            </div>
-            <div>
-              <span
-                @click="addTime(ind)"
-                style="cursor: pointer; color: rgb(30, 125, 251)"
-                >添加</span
-              >
-              <span
-                v-if="timeList.list.length > 1"
-                @click="delTime(ind, i.id)"
-                style="cursor: pointer; color: #f56c6c"
-                >删除</span
-              >
+              <div>
+                <span
+                  @click="addTime(ind)"
+                  style="cursor: pointer; color: rgb(30, 125, 251)"
+                  >添加</span
+                >
+                <span
+                  v-if="timeList.list.length > 1"
+                  @click="delTime(ind, i.id)"
+                  style="cursor: pointer; color: #f56c6c"
+                  >删除</span
+                >
+              </div>
             </div>
           </div>
         </div>
@@ -217,6 +218,100 @@
           </div>
         </div>
       </div>
+      <div class="filter">
+        <div class="condition" style="margin: 10px 0">
+          <h3>退改设置</h3>
+          <div>
+            <span>发车前</span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.refundRule.a1.start"
+              class="w-50 m-2"
+              style="width: 80px"
+              @change="refundRuleClick"
+            />
+            <span>&nbsp;&nbsp;小时以上,免收手续费</span>
+          </div>
+          <div style="margin-top: 15px">
+            <span>发车前</span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.refundRule.a2.start"
+              class="w-50 m-2"
+              style="width: 80px"
+              @change="refundRuleClick"
+            />
+            <span>&nbsp;&nbsp;小时以上</span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.refundRule.a2.end"
+              class="w-50 m-2"
+              style="width: 80px"
+              @change="refundRuleClick"
+            />
+            <span>&nbsp;&nbsp;小时以内,收取</span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.refundRule.a2.fee"
+              class="w-50 m-2"
+              style="width: 60px"
+              @change="refundRuleClick"
+            />
+            <span>&nbsp;&nbsp;(元)手续费</span>
+          </div>
+          <div style="margin-top: 15px">
+            <span>发车前</span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.refundRule.a3.end"
+              class="w-50 m-2"
+              style="width: 80px"
+              @change="refundRuleClick"
+            />
+            <span>&nbsp;&nbsp;小时以内,收取</span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.refundRule.a3.fee"
+              class="w-50 m-2"
+              style="width: 80px"
+              @change="refundRuleClick"
+            />
+            <span>&nbsp;&nbsp;(元)手续费</span>
+          </div>
+          <div style="margin-top: 15px">
+            <span>发车后不退票</span>
+          </div>
+        </div>
+        <div class="condition">
+          <h3>客服设置</h3>
+          <div>
+            <span>客服工作时间 </span>
+            <el-time-picker
+              style="width: 180px"
+              class="timePicker"
+              v-model="ruleForm.workTime"
+              :clearable="false"
+              is-range
+              format="HH:mm"
+              value-format="HH:mm"
+              range-separator="-"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              @change="timeUpdata"
+            />
+          </div>
+          <div style="margin-top: 15px">
+            <span>客服手机号 </span>
+            <el-input
+              :clearable="false"
+              v-model="ruleForm.workMobile"
+              class="w-50 m-2"
+              style="width: 180px"
+              @change="timeUpdata"
+            />
+          </div>
+        </div>
+      </div>
     </div>
     <div class="footer"></div>
   </div>
@@ -251,6 +346,13 @@ const ruleForm = reactive({
   endTime: "", // 扫码后时间
   scanInterval: "", // 扫码间隔
   bb_before: "", // 报备人预约车辆时间设置
+  workTime: [], // 客服工作时间
+  workMobile: [], // 客服手机号
+  refundRule: {
+    a1: { fee: 0, start: 0 },
+    a2: { fee: 0, start: 0, end: 0 },
+    a3: { fee: 0, end: 0 },
+  }, // 退改设置
   id: "",
 });
 // 开始时间段配置
@@ -292,9 +394,14 @@ const getlist = async (message) => {
     ruleForm.startTime = res.data.data.sm_start;
     ruleForm.endTime = res.data.data.sm_end;
     ruleForm.bb_before = res.data.data.bb_before;
+    ruleForm.workTime = res.data.data.workTime.split("-");
+    ruleForm.workMobile = res.data.data.workMobile;
     ruleForm.id = res.data.data.id;
     sessionStorage.setItem("sm_start", res.data.data.sm_start);
     sessionStorage.setItem("sm_end", res.data.data.sm_end);
+
+    ruleForm.refundRule = res.data.data.refundRule;
+    
     if (message) {
       ElMessage({
         type: "success",
@@ -360,12 +467,12 @@ const getTimeList = async () => {
 };
 
 // 页面数据一修改就调用函数
-const timeVerify=(val)=>{
+const timeVerify = (val) => {
   const regex = /^[0-9]+$/;
-  if(regex.test(val)){
-    timeUpdata()
-  }else{
-    getlist()
+  if (regex.test(val)) {
+    timeUpdata();
+  } else {
+    getlist();
     ElMessage({
       type: "warning",
       showClose: true,
@@ -373,7 +480,24 @@ const timeVerify=(val)=>{
       center: true,
     });
   }
-}
+};
+
+// 退改设置修改就调用函数
+const refundRuleClick = (val) => {
+  const regex = /^(\d+)(\.\d{1,2})?$/;
+  if (regex.test(val)) {
+    timeUpdata();
+  } else {
+    getlist();
+    ElMessage({
+      type: "warning",
+      showClose: true,
+      message: "请输入正确数值",
+      center: true,
+    });
+  }
+};
+
 const timeUpdata = async () => {
   if (ruleForm.black_count <= 0) {
     ruleForm.black_count = 1;
@@ -389,7 +513,13 @@ const timeUpdata = async () => {
     sm_end: ruleForm.endTime,
     bb_before: ruleForm.bb_before,
     id: ruleForm.id,
+
+    workTime:ruleForm.workTime.join("-"),
+    workMobile:ruleForm.workMobile,
+    refundRule: JSON.stringify(ruleForm.refundRule),
   };
+  console.log(data);
+  
   let res = await axios({
     method: "post",
     url: api.value + "/carBook/cnupdate.action",
@@ -594,15 +724,18 @@ onUnmounted(() => {});
   .middle {
     width: calc(100% - 60px);
     height: calc(100% - 60px);
-    overflow: auto;
+    // overflow: auto;
     margin: 0 auto;
     color: #000;
+    display: flex;
 
     // border-bottom: 1px solid rgb(231, 231, 231);
     .filter {
+      height: 100%;
       display: flex;
-      flex-wrap: wrap;
+      // flex-wrap: wrap;
       flex-direction: column;
+      overflow: auto;
       .condition {
         display: flex;
         flex-direction: column;
@@ -617,6 +750,7 @@ onUnmounted(() => {});
         }
         .addTime {
           display: flex;
+          flex-wrap: wrap;
           align-items: center;
           .el-checkbox-group {
             .el-checkbox {