Browse Source

Merge branch 'master' of http://47.102.110.240:3000/yuxiangpei/jzmall_vue

leoone8322 1 year ago
parent
commit
f6096bf281

+ 1 - 1
.env.production

@@ -4,5 +4,5 @@ NODE_ENV = production
 ENV = 'production'
 
 # base api
-VUE_APP_BASE_API = 'https://jzmall.lifejingzhi.com/admin'
+VUE_APP_BASE_API = 'https://mall.zhaijieshi.cc/admin'
 

+ 1 - 0
package.json

@@ -44,6 +44,7 @@
     "jquery-ui-dist": "^1.12.1",
     "js-cookie": "2.2.0",
     "lodash": "^4.17.11",
+    "moment": "^2.29.4",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",

+ 25 - 1
src/api/goods.js

@@ -133,4 +133,28 @@ export function goodsExternalInsert(data) {
         method: 'post',
         data
     })
-}
+}
+export function sync2Douyin(goodsSn) {
+    return request({
+        url: '/goods/sync2Douyin',
+        method: 'get',
+        params: { goodsSn }
+       
+    })
+}
+export function updateGoodsInfo(data) {
+    return request({
+        url: '/goodsExternal/updateGoodsInfo',
+        method: 'get',
+        params: data
+       
+    })
+}
+export function operGoodsStatus(data) {
+    return request({
+        url: '/goodsExternal/operGoodsStatus',
+        method: 'get',
+        params: data
+       
+    })
+}

+ 44 - 0
src/api/order.js

@@ -356,3 +356,47 @@ export function onceReassign(orderId) {
         params: {orderId} 
     })
 }
+
+// 获取用户拥有的城市,驿站,服务站
+export function getUserAuthData(data) {
+    return request({
+        url: '/workerOccupy/getUserAuthData',
+        method: 'get',
+        params: data
+    })
+}
+
+// 条件查询档期与占用
+export function selectOccupyByQuery(data) {
+    return request({
+        url: '/workerOccupy/selectOccupyByQuery',
+        method: 'post',
+        data
+    })
+}
+// 修改订单地址
+export function updateOrderAddress(data) {
+    return request({
+        url: '/order/updateOrderAddress',
+        method: 'post',
+        data
+    })
+}
+
+// 查询要抖音订单核销情况
+export function getDyOrderList(data) {
+    return request({
+        url: '/dyOrderVerify/getList',
+        method: 'get',
+        params: data
+    })
+}
+
+// 手动核销抖音订单,传入订单id
+export function douyinVerifyOrder(data) {
+    return request({
+        url: '/dyOrderVerify/douyinVerifyOrder',
+        method: 'get',
+        params: data
+    })
+}

+ 30 - 0
src/router/index.js

@@ -208,6 +208,36 @@ export const asyncRouterMap = [
         }
       },
       {
+        path: "schedulingP",
+        component: () => import("@/views/order/schedulingP"),
+        name: "schedulingP",
+        meta: {
+          perms: [
+            'GET /admin/workerOccupy/getUserAuthData',
+            'POST /admin/workerOccupy/selectOccupyByQuery'
+          ],
+          title: "档期管理",
+          noCache: true,
+          icon: "form",
+          keepAlive:true
+        }
+      },
+      {
+        path: "dyorder",
+        component: () => import("@/views/order/dyorder"),
+        name: "dyorder",
+        meta: {
+          perms: [
+            "GET /admin/dyOrderVerify/douyinVerifyOrder",
+            "GET /admin/dyOrderVerify/getList",
+          ],
+          title: "抖音核销",
+          noCache: true,
+          icon: "list",
+          keepAlive:true
+        }
+      },
+      {
         path: "ordersource",
         component: () => import("@/views/order/ordersource"),
         name: "ordersource",

+ 16 - 2
src/views/goods/create.vue

@@ -152,14 +152,21 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row v-if="goods.type===0||goods.type==3">
-          <el-col :span="12">
+        <el-row >
+          <el-col :span="12" v-if="goods.type===0||goods.type==3">
             <el-form-item label="延迟几天可约" prop="bookDelayDay">
               <el-input v-model="goods.bookDelayDay" type="number" placeholder="下单时,可以从第几天开始预约,0或空值以默认值为准(1天)">
                 <template slot="append">天</template>
               </el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="渠道" prop="channel">
+                <el-select v-model="goods.channel" style="width: 160px" class="filter-item" placeholder="请选择渠道" clearable multiple>
+                    <el-option v-for="item in channels" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+           </el-form-item>
+          </el-col>
         </el-row>
 
         <el-row>
@@ -574,6 +581,7 @@ import {
   getShop,
   getStatisticsCategory,
 } from "@/api/goods";
+import { allChannel } from "@/api/channel";
 import { allRange } from "@/api/serviceTimeRange";
 import { createStorage, uploadPath } from "@/api/storage";
 import Editor from "@tinymce/tinymce-vue";
@@ -643,6 +651,7 @@ export default {
       }
     };
     return {
+      channels: [],
       uploadPath,
       timeArray: [],
       newKeywordVisible: false,
@@ -676,6 +685,7 @@ export default {
         sortOrder: 99,
         shops: [],
         attribute: "",
+        channel:[],
       },
       submiting: false, //商品提交中 防止多次提交
       specVisiable: false,
@@ -832,6 +842,10 @@ export default {
         this.sCategory = res.data.data;
       });
       this.getTimeRange();
+
+      allChannel().then((res) => {
+       this.channels = res.data.data;
+     });
     },
     isNumber(rule, value, callback) {
       if (value === "") {

+ 16 - 3
src/views/goods/edit.vue

@@ -156,14 +156,21 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row v-if="goods.type===0||goods.type==3">
-          <el-col :span="12">
+        <el-row >
+          <el-col :span="12" v-if="goods.type===0||goods.type==3">
             <el-form-item label="延迟几天可约" prop="bookDelayDay">
               <el-input v-model="goods.bookDelayDay" type="number" placeholder="下单时,可以从第几天开始预约,0或空值以默认值为准(1天)">
                 <template slot="append">天</template>
               </el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="渠道" prop="channel">
+                <el-select v-model="goods.channel" style="width: 160px" class="filter-item" placeholder="请选择渠道" clearable multiple filterable>
+                    <el-option v-for="item in channels" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+           </el-form-item>
+          </el-col>
         </el-row>
 
         <el-row>
@@ -503,7 +510,7 @@ import {
   getShop,
   getStatisticsCategory,
 } from "@/api/goods";
-
+import { allChannel } from "@/api/channel";
 import { allRange } from "@/api/serviceTimeRange";
 import { createStorage, uploadPath } from "@/api/storage";
 import { listAllCity } from "@/api/city";
@@ -571,6 +578,7 @@ export default {
       }
     };
     return {
+      channels:[],
       uploadPath,
       timeArray: [],
       newKeywordVisible: false,
@@ -627,6 +635,7 @@ export default {
           disType: 0,
           disPercent: 0,
           disAmount: 0,
+          channel:[],
         },
       ],
       attributeVisiable: false,
@@ -805,6 +814,10 @@ export default {
         this.sCategory = res.data.data;
       });
       this.getTimeRange();
+
+      allChannel().then((res) => {
+       this.channels = res.data.data;
+     });
     },
     getTimeRange() {
       allRange().then((res) => {

+ 51 - 3
src/views/goods/goodsExternalConfig.vue

@@ -16,6 +16,7 @@
         class="filter-item"
         placeholder="请选择渠道"
         clearable
+        filterable
       >
         <el-option v-for="item in channels" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
@@ -87,6 +88,12 @@
             size="mini"
             @click="handleDeleteConfirm(scope.row)"
           >删除</el-button>
+            <el-button type="primary" size="mini" @click="updateGoodsInfo(scope.row)" >编辑</el-button>
+             <el-switch v-model="scope.row.isOnTheSelf"
+ active-text="上架" inactive-text="下架" @change="operGoodsStatus(scope.row)"  :active-value="1"
+    :inactive-value="2"/>
+              <!-- <el-button type="primary" size="mini" @click="operGoodsStatus(scope.row)" >上架</el-button>
+               <el-button type="danger" size="mini" @click="operGoodsStatus(scope.row)" >下架</el-button> -->
         </template>
       </el-table-column>
     </el-table>
@@ -136,7 +143,7 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="订单渠道" prop="channelId">
-              <el-select v-model="dataForm.channelId" style="width:100%" placeholder="请选择">
+              <el-select v-model="dataForm.channelId" style="width:100%" placeholder="请选择" filterable>
                 <el-option
                   v-for="item in channels"
                   :key="item.id"
@@ -165,7 +172,9 @@ import {
   goodsExternalList,
   goodsExternalDel,
   goodsExternalInsert,
-  listGoods3
+  listGoods3,
+  updateGoodsInfo,
+  operGoodsStatus
 } from "@/api/goods";
 import { allChannel } from "@/api/channel";
 import { statusMap, statusModifyMap } from "@/api/enumUtils";
@@ -322,7 +331,45 @@ export default {
           });
         });
     },
- 
+     updateGoodsInfo(row){
+     console.log(row);
+       updateGoodsInfo({goodsId:row.goodsId})
+        .then((response) => {
+          this.$notify.success({
+            title: "成功",
+            message: "编辑成功",
+          });
+        })
+        .catch((response) => {
+          this.$notify.error({
+            title: "失败",
+            message: response.data.errmsg,
+          });
+         
+        });
+   },
+ operGoodsStatus(row) {
+      console.log(row);
+      let operType=(row.isOnTheSelf
+==2?2:1);
+console.log(operType);
+      operGoodsStatus({goodsId:row.goodsId, operType:operType})
+        .then((response) => {
+          this.$notify.success({
+            title: "成功",
+            message: "商品上下架设置成功",
+          });
+               
+
+        })
+        .catch((response) => {
+          this.$notify.error({
+            title: "失败",
+            message: response.data.errmsg,
+          });
+     row.isOnTheSelf = (row.isOnTheSelf==1?2:1);
+        });
+    },
     confirmInsert() {
       this.$refs["dataForm"].validate(valid => {
         if (valid) {
@@ -414,5 +461,6 @@ export default {
 .fixed-width .el-button--mini {
   width: auto;
   min-width: 60px;
+  margin-bottom:8px;
 }
 </style>

+ 23 - 0
src/views/goods/list.vue

@@ -145,6 +145,7 @@
         <template slot-scope="scope">
           <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
           <el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
+          <el-button type="primary" size="mini" @click="handleDY(scope.row)" >同步抖音</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -183,6 +184,10 @@
 .el-table th.gutter {
   display: table-cell !important;
 }
+.fixed-width .el-button--mini{
+  margin-bottom:8px;
+  width:auto;
+}
 </style>
 
 <script>
@@ -193,6 +198,7 @@ import {
   onnew,
   onhot,
   onhide,
+  sync2Douyin
 } from "@/api/goods";
 import { listCatL1 } from "@/api/category";
 import BackToTop from "@/components/BackToTop";
@@ -262,6 +268,23 @@ export default {
     handleUpdate(row) {
       this.$router.push({ path: "/goods/edit", query: { id: row.id } });
     },
+   handleDY(row){
+     console.log(row);
+       sync2Douyin(row.goodsSn)
+        .then((response) => {
+          this.$notify.success({
+            title: "成功",
+            message: "同步成功",
+          });
+        })
+        .catch((response) => {
+          this.$notify.error({
+            title: "失败",
+            message: response.data.errmsg,
+          });
+         
+        });
+   },
     handleOnsale(row) {
       console.log(row);
       onsale(row)

+ 288 - 0
src/views/order/dyorder.vue

@@ -0,0 +1,288 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+   
+      <el-input v-model="listQuery.jzOrderSn" clearable class="filter-item" style="width: 160px;" placeholder="请输入鲸致订单号" />
+      <el-input v-model="listQuery.outOrderSn" clearable class="filter-item" style="width: 160px;" placeholder="请输入抖音订单号" />
+
+      <el-date-picker v-model="listQuery.timeArray" type="datetimerange" class="filter-item" range-separator="至" start-placeholder="下单开始日期" end-placeholder="下单下单结束日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd hh:mm:ss" />
+
+      <el-button v-permission="['GET /admin/dyOrderVerify/getList']" class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查找</el-button>
+    </div>
+
+    <!-- 查询结果 -->
+
+    <el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" border fit highlight-current-row>
+      <!-- <el-table-column align="center" label="客户手机" prop="customerTel" fixed="left" width="135" /> -->
+      <!-- <el-table-column align="center" label="服务订单编号" width="135" prop="orderId" /> -->
+      <el-table-column align="center" label="鲸致订单号"  prop="jzOrderSn" />
+      <el-table-column align="center" label="抖音订单号"  prop="outOrderSn" />
+      <el-table-column align="center" label="订单金额"  prop="price" />
+      <el-table-column align="center" label="核销状态" >
+        <template slot-scope="scope">
+          {{ statusMap[scope.row.isVerify] }}
+        </template>
+      </el-table-column>
+    
+      
+     <el-table-column align="center" label="退款单号"  prop="refundNo" />
+     <el-table-column align="center" label="退款金额"  prop="refundMoney" >
+        <template slot-scope="scope">
+         {{scope.row.refundMoney==undefined?'':(scope.row.refundMoney/100).toFixed(0)}}
+        </template>
+     </el-table-column>
+     <el-table-column align="center" label="抖音退款编号"  prop="outRefundNo" />
+     <el-table-column align="center" label="退款申请时间"  prop="refundSubmitTime" />
+    <el-table-column align="center" label="退款状态" >
+        <template slot-scope="scope">
+          {{ auditMap[scope.row.refundStatus] }}
+        </template>
+      </el-table-column>
+     <el-table-column align="center" label="退款审核时间"  prop="refundAuditTime" />
+     <el-table-column align="center" label="审核人id"  prop="refundAuditUserId" />
+
+      <el-table-column align="center" label="下单时间" min-width="90" prop="createTime" />
+
+
+      <el-table-column align="center" label="操作" class-name="small-padding fixed-width" fixed="right" width="140">
+        <template slot-scope="scope">
+          <el-button v-permission="['GET /admin/dyOrderVerify/douyinVerifyOrder']" type="primary" size="mini" @click="verifyOrder(scope.row)" v-if="scope.row.isVerify==0">核销</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
+
+   
+
+  </div>
+</template>
+
+<script>
+import axios from "axios";
+import {
+  getDyOrderList,
+  douyinVerifyOrder,
+
+
+} from "@/api/order";
+import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
+import { formatDate } from "@/utils/date";
+import checkPermission from "@/utils/permission"; // 权限判断函数
+import { getToken } from "@/utils/auth";
+
+let vm;
+
+export default {
+  name: "Order",
+  components: { Pagination },
+  filters: {
+  
+  },
+  data() {
+    return {
+       statusMap:[
+        '未核销',
+        '已核销',
+        '退款',
+        '取消支付'
+      ],
+       auditMap:{
+         1:'待审核',
+         2:'审核通过',
+         3:'审核拒绝'
+
+       },
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        limit: 20,
+        jzOrderSn: "",
+        outOrderSn:'',
+        timeArray: [],
+        sort: "create_time",
+        order: "desc",
+      },
+   
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
+      
+      headers: { "Content-Type": "multipart/form-data" },
+    };
+  },
+  computed: {},
+  beforeCreate() {
+    vm = this;
+  },
+  created() {
+    this.getList();
+   
+  },
+  methods: {
+    checkPermission,
+   
+    getList() {
+      this.listLoading = true;
+      if (this.listQuery.timeArray && this.listQuery.timeArray.length === 2) {
+        this.listQuery.start = this.listQuery.timeArray[0];
+        this.listQuery.end = this.listQuery.timeArray[1];
+      } else {
+        this.listQuery.start = null;
+        this.listQuery.end = null;
+      }
+
+      getDyOrderList(this.listQuery)
+        .then((response) => {
+          this.list = response.data.data.list;
+          this.total = response.data.data.total;
+          this.listLoading = false;
+        })
+        .catch(() => {
+          this.list = [];
+          this.total = 0;
+          this.listLoading = false;
+        });
+    },
+   
+    formatTime(time) {
+      if (time == null || time === "") {
+        return "";
+      }
+      const date = new Date(time);
+      return formatDate(date, "yyyy-MM-dd hh:mm:ss");
+    },
+    handleFilter() {
+      this.listQuery.page = 1;
+      this.getList();
+    },
+  
+     verifyOrder(row){
+       this.$confirm("确定要核销吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        douyinVerifyOrder({orderId:row.jzOrderId}).then((response) => {
+          this.$notify.success({
+            title: "成功",
+            message: "核销成功",
+          });
+          this.getList();
+        })
+        .catch((response) => {
+          this.$notify.error({
+            title: "失败",
+            message: response.data.errmsg,
+          });
+        });;
+      });
+     },
+  
+    formetdate(date) {
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var day = date.getDate();
+      return [year, month, day].map(this.formatNumber).join("-");
+    },
+    formatNumber(n) {
+      n = n.toString();
+      return n[1] ? n : "0" + n;
+    },
+   
+  },
+};
+</script>
+
+<style>
+.detail-container {
+  width: 80%;
+  padding: 20px 20px 20px 20px;
+  margin: 20px auto;
+}
+
+.operate-container {
+  background: #f2f6fc;
+  height: 80px;
+  margin: -20px -20px 0;
+  line-height: 80px;
+}
+
+.operate-button-container {
+  float: right;
+  margin-right: 20px;
+}
+
+.table-layout {
+  margin-top: 20px;
+  border-left: 1px solid #dcdfe6;
+  border-top: 1px solid #dcdfe6;
+}
+
+.table-cell {
+  height: 60px;
+  line-height: 20px;
+  border-right: 1px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+  padding: 10px;
+  font-size: 14px;
+  color: #606266;
+  text-align: center;
+  white-space: pre-wrap;
+  /* overflow: hidden; */
+}
+
+.table-cell-title {
+  border-right: 1px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+  padding: 10px;
+  background: #f2f6fc;
+  text-align: center;
+  font-size: 14px;
+  color: #303133;
+}
+.el-table th.gutter {
+  display: table-cell !important;
+}
+.color-danger {
+  color: #f56c6c;
+  font-size: 18px;
+}
+.is-appointment {
+  color: #1989fa;
+}
+.el-cascader--medium {
+  width: 360px;
+}
+</style>

+ 177 - 0
src/views/order/order.vue

@@ -169,6 +169,7 @@
           <el-button v-permission="['GET /admin/order/ishandle']" type="text" icon="el-icon-circle-plus-outline" size="mini" @click="handleContactCus(scope.row)">
             {{scope.row.isHandle?'未处理':'已处理'}}
           </el-button>
+          <el-button v-permission="['POST /admin/order/updateOrderAddress']" v-show="scope.row.orderStatus ==201" type="text" icon="el-icon-edit" size="mini" @click="updateOrderAddress(scope.row)">修改地址</el-button>
 
         </template>
       </el-table-column>
@@ -590,6 +591,49 @@
       </div>
     </el-dialog>
 
+
+    <!-- 修改地址 -->
+    <el-dialog :visible.sync="updateAddressVisible" title="修改地址" width="660px" center>
+      <el-form ref="updateAddressForm" :model="updateAddressForm" :rules="updateAddressFormRules" status-icon label-position="left" label-width="200px" style=" padding:10px 30px">
+        
+        <el-row :gutter="60">
+         
+            <el-form-item label="省市区" prop="area">
+              <el-cascader style="width:100%" :options="areaList" v-model="updateAddressForm.area" ref="cascader1" @change="handleUpdateAreaChange" clearable></el-cascader>
+            </el-form-item>
+         
+        </el-row>
+         <el-row :gutter="60">
+        <el-form-item label="服务地址" prop="addressDetail">
+          <el-input v-model="updateAddressForm.addressDetail" clearable />
+        </el-form-item>
+         </el-row>
+       
+        <el-row :gutter="60">
+        
+            <el-form-item label="是否取消已预约未服务工单" prop="cancelBookOrderDetail">
+              <!-- <el-select v-model="updateAddressForm.cancelBookOrderDetail" style="width:100%" placeholder="请选择支付渠道">
+
+                <el-option label="是" value="1" />
+                <el-option label="否" value="0" />
+              </el-select> -->
+                <el-radio-group v-model="updateAddressForm.cancelBookOrderDetail">
+                <el-radio label="1">是</el-radio>
+                <el-radio label="0">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+         
+
+         
+        </el-row>
+      
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="updateAddressVisible = false">取消</el-button>
+        <el-button type="primary" @click="confirmUpdateAddress">确定</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :visible.sync="showbaogangRefund" title="外部订单退还(口碑/宝钢)" width="900px" center>
       <el-form>
         <el-row :gutter="60">
@@ -812,6 +856,7 @@ import {
   orderBookDetail,
   orderIsHandle,
   orderBookReassign,
+  updateOrderAddress
 } from "@/api/order";
 import { allChannel } from "@/api/channel";
 import { send, getSmsTemplate } from "@/api/sms";
@@ -1207,6 +1252,30 @@ export default {
           { required: true, message: "请输入接收手机号", trigger: "change" },
         ],
       },
+      updateAddressVisible:false,
+      updateAddressForm:{
+         area:'',
+         addressDetail:'',
+         cancelBookOrderDetail:''
+      },
+      updateOrderInfo:{},
+      updateAddressFormRules: {
+      
+        area: [{ required: true, message: "请选择省市区", trigger: "change" }],
+        addressDetail: [
+          { required: true, message: "请输入客户地址", trigger: "blur" },
+        ],
+        goodsId: [{ required: true, message: "请选择商品", trigger: "change" }],
+       
+        cancelBookOrderDetail: [
+          {
+            required: true,
+            message: "是否取消已预约未服务工单",
+            trigger: "blur",
+          },
+        ]
+         }
+
     };
   },
   computed: {},
@@ -2323,6 +2392,114 @@ export default {
           });
       }
     },
+    updateOrderAddress(row){
+      this.updateAddressVisible=true;
+      this.updateOrderInfo=row;
+      this.updateAddressForm={
+         area:'',
+         addressDetail:(row.address.split(' '))[1],
+         cancelBookOrderDetail:'',
+      };
+    },
+    confirmUpdateAddress(){
+       this.$refs["updateAddressForm"].validate((valid) => {
+        if (valid) {
+          // this.$confirm("确定要修改吗?", "提示", {
+          //   confirmButtonText: "确定",
+          //   cancelButtonText: "取消",
+          //   type: "warning",
+          // }).then(() => {
+            const loading = this.$loading({
+              lock: true,
+              text: "提交中...",
+              spinner: "el-icon-loading",
+              background: "rgba(0, 0, 0, 0.5)",
+            });
+//             {
+//   "addressDto": {
+//     "addressDetail": "string",
+//     "areaCode": "string",
+//     "city": "string",
+//     "county": "string",
+//     "lat": "string",
+//     "lng": "string",
+//     "name": "string",
+//     "province": "string",
+//     "shopId": 0,
+//     "tel": "string",
+//     "userId": 0
+//   },
+//   "cancelBookOrderDetail": 0,
+//   "orderId": 0
+// }
+            updateOrderAddress({
+              addressDto: {
+                addressDetail: this.updateAddressForm.addressDetail,
+                areaCode: this.updateAddressForm.areaCode,
+                city: this.updateAddressForm.city,
+                county: this.updateAddressForm.county,
+                province: this.updateAddressForm.province,
+              },
+              orderId:this.updateOrderInfo.id,
+              cancelBookOrderDetail:this.updateAddressForm.cancelBookOrderDetail,
+              // customerName: this.orderInputForm.customerName,
+              // goodsId: this.orderInputForm.goodsId,
+              // message: this.orderInputForm.message,
+              // orderChannel: this.orderInputForm.orderChannel,
+              // orderPrice: this.orderInputForm.orderPrice,
+              // tel: this.orderInputForm.tel,
+              // payId: this.orderInputForm.payId,
+              // payTime: this.orderInputForm.payTime,
+              // payChannel: this.orderInputForm.payChannel,
+              // orderType: this.orderInputForm.orderType,
+            })
+              .then((response) => {
+                loading.close();
+                this.updateAddressVisible= false;
+                this.$notify.success({
+                  title: "成功",
+                  message: "修改成功",
+                });
+                this.getList();
+              })
+              .catch((response) => {
+                loading.close();
+                this.$notify.error({
+                  title: "修改失败",
+                  message: response.data.errmsg,
+                });
+              });
+          // });
+        }
+      });
+    },
+  handleUpdateAreaChange(value) {
+      console.log(value);
+      console.log(this.updateAddressForm.area == "");
+      let node = this.$refs["cascader1"].getCheckedNodes();
+      console.log(node);
+      if (node.length > 0) {
+        console.log(node[0].path, node[0].pathLabels);
+        this.updateAddressForm.areaCode = node[0].path[2];
+        this.updateAddressForm.province = node[0].pathLabels[0];
+        this.updateAddressForm.city = node[0].pathLabels[1];
+        this.updateAddressForm.county = node[0].pathLabels[2];
+        if (
+          node[0].pathLabels[2] == "市辖区" &&
+          node[0].pathLabels[0] != "北京市" &&
+          node[0].pathLabels[0] != "上海市" &&
+          node[0].pathLabels[0] != "重庆市" &&
+          node[0].pathLabels[0] != "天津市"
+        ) {
+          this.$notify.error({
+            title: "请选择具体区域",
+          });
+          this.updateAddressForm.area = "";
+          return false;
+        }
+   
+      }
+    },
   },
 };
 </script>

+ 272 - 0
src/views/order/schedulingP.vue

@@ -0,0 +1,272 @@
+<template>
+  <div class="content">
+    <div class="crumbs">
+      <el-breadcrumb separator="/">
+        <el-breadcrumb-item>
+          订单中心
+          <span class="titleColor"></span> - 档期管理
+        </el-breadcrumb-item>
+      </el-breadcrumb>
+    </div>
+    <div class="container">
+      <!-- 检索 -->
+      <el-form :inline="true" class="demo-form-inline">
+        <!-- <el-form-item label="单位名称">
+          <el-input v-model="unitName" clearable></el-input>
+        </el-form-item> -->
+        <!-- <el-form-item label="来源">
+          <el-select
+            placeholder="请选择"
+            v-model="sourceId"
+            width="100px"
+          >
+            <el-option
+               v-for="item in sourcelist"
+                :key="item.id"
+                :label="item.source_name"
+                :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item> -->
+        <el-form-item label="城市">
+          <el-select placeholder="请选择" @change="selectStationByCity" v-model="sourceCity" width="100px">
+        
+            <el-option v-for="item in citylist" :key="item.id" :label="item.cityName" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="服务站">
+          <el-select v-model="servieceStation" placeholder="请选择" width="100px" clearable>
+            <!-- <el-option value label="请选择"></el-option> -->
+            <el-option v-for="item in stationlist" :key="item.id" :label="item.stationName" :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="服务者姓名">
+          <el-input v-model="workerName" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="占用事件">
+          <el-select v-model="event" width="100px" clearable>
+            <el-option v-for="item in eventList" :key="item.id" :label="item.eventName" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="日期范围">
+          <div class="block">
+            <span class="demonstration"></span>
+            <el-date-picker v-model="timeRange" type="daterange" range-separator="至" start-placeholder="开始日期"
+              end-placeholder="结束日期" value-format="yyyy-MM-dd"></el-date-picker>
+          </div>
+        </el-form-item>
+        <el-button icon="el-icon-search" type="primary" plan @click="listQuery">查询</el-button>
+      </el-form>
+
+      <!-- 表单 -->
+      <el-table :data="sourceUnitData" border class="table">
+        <!-- <el-table-column type="index" width="55" label="序号"></el-table-column> -->
+        <el-table-column prop="orderId" label="订单编号"></el-table-column>
+        <el-table-column prop="workerId" label="服务者id"></el-table-column>
+        <el-table-column prop="workerName" label="服务者姓名"></el-table-column>
+        <el-table-column prop="stationName" label="服务站"></el-table-column>
+        <el-table-column label="占用事件">
+          <template slot-scope="scope">
+            {{ eventMap[scope.row.event] }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="dateDay" label="服务日期" :formatter="dateFormat"></el-table-column>
+        <!-- <el-table-column prop="stationName" label="包含服务站"></el-table-column> -->
+        <el-table-column label="服务开始结束时间">
+          <template slot-scope="scope">
+            <span>{{scope.row.startTime+'-'+scope.row.endTime}}</span>
+          </template>
+        </el-table-column>
+
+      </el-table>
+      <!-- 分页 -->
+      <pagination :total="total" :page.sync="currentPage" :limit.sync="pageSize" @pagination="listQuery" />
+
+
+    </div>
+  </div>
+</template>
+<script>
+import moment from "moment";
+import Pagination from "@/components/Pagination"; 
+import {
+  getUserAuthData,
+  selectOccupyByQuery
+
+} from "@/api/order";
+const eventMap = {
+  1: '服务工单',
+  2: '特派工单',
+  3: '休息日',
+  4: '请假',
+  5: '订单预占',
+  6: '培训',
+  7: '跟单',
+  8: '活动',
+};
+export default {
+  components: { Pagination },
+  data() {
+    return {
+      // sourceId: this.$route.query.sourceId,
+      // sourceName: this.$route.query.sourceName,
+      eventMap: eventMap,
+      sourceId: '',
+      sourcelist: [],
+      servieceStation: '',
+      workerName: '',
+      event: '',
+      eventList: [
+        { id: 1, eventName: '服务工单' },
+        { id: 2, eventName: '特派工单' },
+        { id: 3, eventName: '休息日' },
+        { id: 4, eventName: '请假' },
+        { id: 5, eventName: '订单预占' },
+        { id: 6, eventName: '培训' },
+        { id: 7, eventName: '跟单' },
+        { id: 8, eventName: '活动' }],
+      timeRange: "",
+      chargeList: [],
+      unitName: "",
+      addVisible: false,
+      stopVisible: false,
+      total: 0,
+      currentPage: 1,
+      pageSize: 10,
+      sourceCity: "",
+      // citylist: globalData.getuserCity(), //城市
+      citylist: [], //城市
+      // stationlist: globalData.getuserStation(), //驿站
+      stationlist:[], //服务站
+      wholeStationList:[],
+      sourceUnitData: [],
+      addSourceUnitForm: {
+        // source_id: this.$route.query.sourceId,
+        source_id: '',
+        unit_name: "",
+        city_id: "",
+        address: "",
+        remark: "",
+        chargeId: ''
+        // intentionStageId: []
+      },
+      editSourceUnitForm: {
+        id: "",
+        source_id: "",
+        unit_name: "",
+        city_id: "",
+        address: "",
+        remark: "",
+        chargeId: ''
+      },
+      editintentionStageId: [],
+      sourceUnitlist: [],
+      rules: {
+        source_id: [
+          { required: true, message: "请选择来源", trigger: "change" }
+        ],
+        unit_name: [
+          { required: true, message: "请选择单位名称", trigger: "change" }
+        ],
+        city_id: [
+          { required: true, message: "请选择所属城市", trigger: "change" }
+        ],
+        intentionStageId: [
+          { required: true, message: "请选择服务站", trigger: "change" }
+        ],
+        address: [{ required: true, message: "请填写地址", trigger: "blur" }],
+        chargeId: [{ required: true, message: "请选择门店负责人", trigger: "blur" }],
+
+      }
+    };
+  },
+  created() {
+
+    this.listQuery();
+    this.getCityListData();
+    //  this.getsourceDate();
+  },
+  methods: {
+    //获取城市下拉数据
+    getCityListData() {
+      getUserAuthData()
+        .then(res => {
+          console.log(res);
+          this.citylist = res.data.data.city;
+          this.wholeStationList=res.data.data.station;
+          this.stationlist = res.data.data.station;
+        })
+        .catch(err => {
+          console.log(err);
+        });
+    },
+    //查询
+    listQuery() {
+      let timeRange = this.timeRange;
+      let startDate = "";
+      let endDate = "";
+      if (timeRange != "" && timeRange != null) {
+        startDate = timeRange[0];
+        endDate = timeRange[1];
+      }
+      selectOccupyByQuery({
+          // sourceId: this.sourceId,
+          cityId: this.sourceCity==0?'':this.sourceCity,
+          stationId: this.servieceStation,
+          workerName: this.workerName,
+          event: this.event,
+          pageNo: this.currentPage,
+          pageSize: this.pageSize,
+          startDate: startDate,
+          endDate: endDate
+        })
+        .then(res => {
+          console.log(res);
+          this.sourceUnitData = res.data.data.dataList;
+          this.total = res.data.data.total;
+        })
+        .catch(err => {
+          console.log(err);
+        });
+    },
+
+  
+
+    //查询驿站
+    selectStationByCity(vId) {
+      console.log(vId);
+      this.servieceStation = '';
+      if (vId == 0) {
+        this.stationlist =this.wholeStationList;
+      } else {
+        this.stationlist = this.wholeStationList.filter(item=>{return item.cityId==vId});
+        console.log(this.stationlist);
+      }
+    },
+ 
+    //时间格式化
+    dateFormat(row, column) {
+      var date = row[column.property];
+      if (date == undefined) {
+        return "";
+      }
+      // return moment(date).format("YYYY-MM-DD HH:mm");
+      return moment(date).format("YYYY-MM-DD");
+    },
+
+ 
+
+
+  }
+};
+</script>
+<style scoped>
+  .content{
+    padding:10px;
+  }
+  .crumbs{
+    margin:10px 0;
+  }
+</style>
+