Bläddra i källkod

Merge branch 'qiankun-240313' of http://47.102.110.240:3000/yuxiangpei/jzmall_vue into qiankun-240313

暖心小太阳 1 månad sedan
förälder
incheckning
72c117c746
34 ändrade filer med 7396 tillägg och 1933 borttagningar
  1. 113 0
      src/api/broadbandService.js
  2. 27 1
      src/api/couponpackage.js
  3. 2 2
      src/api/order.js
  4. 28 3
      src/api/orderBookDetail.js
  5. 34 6
      src/router/index.js
  6. 10 2
      src/views/config/order.vue
  7. 2 0
      src/views/config/timerange.vue
  8. 536 572
      src/views/goods/create.vue
  9. 601 527
      src/views/goods/edit.vue
  10. 28 7
      src/views/goods/goodsSkuDetail.vue
  11. 4 3
      src/views/goods/list.vue
  12. 86 34
      src/views/goods/selectCity.vue
  13. 439 0
      src/views/order/components/broadbandServiceRef.vue
  14. 0 0
      src/views/order/components/dispatchCycleOrder.vue.bak
  15. 13 1
      src/views/order/components/orderInfoRef.vue
  16. 165 121
      src/views/order/components/reassignOrder.vue
  17. 392 0
      src/views/order/components/serviceBookRef .vue.bak
  18. 453 226
      src/views/order/components/serviceBookRef.vue
  19. 85 37
      src/views/order/order.vue
  20. 11 3
      src/views/order/orderBookBoard.vue
  21. 168 140
      src/views/order/serviceBook.vue
  22. 14 35
      src/views/order/serviceorder.vue
  23. 10 27
      src/views/order/serviceordercategory.vue
  24. 13 27
      src/views/order/serviceordercycle.vue
  25. 12 26
      src/views/order/serviceorderonce.vue
  26. 7 19
      src/views/order/storage/storageBookList.vue
  27. 3 5
      src/views/order/storage/storageOrderList.vue
  28. 1630 0
      src/views/order/telecomCard/broadbandService.vue
  29. 1329 0
      src/views/order/telecomCard/numberCardService.vue
  30. 88 30
      src/views/promotion/coupon.vue
  31. 61 22
      src/views/promotion/couponDetail.vue
  32. 95 21
      src/views/promotion/couponPackage.vue
  33. 293 36
      src/views/promotion/couponPackageDetail.vue
  34. 644 0
      src/views/promotion/couponPackageDetailOld.vue

+ 113 - 0
src/api/broadbandService.js

@@ -0,0 +1,113 @@
+import request from '@/utils/request'
+import Qs from 'qs'
+
+export function getPageList(data) {
+  return request({
+    url: '/telecomOrder/getList',
+    method: 'post',
+    data
+  })
+}
+
+
+export function create(data) {
+  return request({
+    url: '/telecomOrder/createOrder',
+    method: 'post',
+    data
+  })
+}
+
+export function updateDxOrderStatus(data) {
+  return request({
+    url: '/telecomOrder/updateDxOrderStatus',
+    method: 'post',
+    data
+  })
+}
+
+export function addDeviceNumber(data) {
+  return request({
+    url: '/telecomOrder/addDeviceNumber',
+    method: 'post',
+    data
+  })
+}
+
+
+export function updateIsCoAddress(query) {
+  return request({
+    url: '/telecomOrder/updateIsCoAddress',
+    method: 'get',
+    params: query
+  })
+}
+
+export function updateAddress(query) {
+  return request({
+    url: '/telecomOrder/updateAddress',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getLog(query) {
+  return request({
+    url: '/telecomOrder/getLog',
+    method: 'get',
+    params: query
+  })
+}
+
+export function exportData(data) {
+  return request({
+    url: '/telecomOrder/export',
+    method: 'post',
+    data,
+    responseType: 'blob'
+  })
+}
+
+
+export function getHkPageList(data) {
+  return request({
+    url: '/telecomHkOrder/getList',
+    method: 'post',
+    data
+  })
+}
+
+export function exportHkData(data) {
+  return request({
+    url: '/telecomHkOrder/export',
+    method: 'post',
+    data,
+    responseType: 'blob'
+  })
+}
+
+export function updateTelecomStatus(query) {
+  return request({
+    url: '/telecomOrder/updateTelecomStatus',
+    method: 'get',
+    params: query
+  })
+}
+
+export function addDeviceHkNumber(data) {
+  return request({
+    url: '/telecomHkOrder/addDeviceHkNumber',
+    method: 'post',
+    data
+  })
+}
+
+export function updateDate(query) {
+  return request({
+    url: '/telecomHkOrder/updateDate',
+    method: 'get',
+    params: query
+  })
+}
+
+

+ 27 - 1
src/api/couponpackage.js

@@ -103,4 +103,30 @@ export function packageImport(data, config) {
       config: config,
       data
   })
-}
+}
+
+export function importPhone(data, config) {
+  return request({
+    url: '/couponPackageDetail/importPhone',
+    method: 'post',
+    config: config,
+    data
+  })
+}
+
+export function sendSmsInPhone(data, config) {
+  return request({
+    url: '/couponPackageDetail/sendSmsInPhone',
+    method: 'post',
+    config: config,
+    data
+  })
+}
+
+export function getSmsTemplateByType(query) {
+  return request({
+    url: '/couponPackageDetail/getSmsTemplateByType',
+    method: 'get',
+    params: query
+  })
+}

+ 2 - 2
src/api/order.js

@@ -109,11 +109,11 @@ export function cancelBook(query) {
     })
 }
 
-export function getAssignmentPerson(detailId) {
+export function getAssignmentPerson(query) {
     return request({
         url: '/orderbook/getAssignmentPerson',
         method: 'get',
-        params: { detailId }
+        params: query
     })
 }
 export function orderBookReassign(data, config) {

+ 28 - 3
src/api/orderBookDetail.js

@@ -23,9 +23,9 @@ export function tranBookToFra(data) {
 
  
 
-export function modifyFee(data) {
+export function setWorkerFee(data) {
     return request({
-        url: '/orderbookdetail/modifyFee',
+        url: '/orderbookdetail/setWorkerFee',
         method: 'post',
         data
     })
@@ -38,4 +38,29 @@ export function notify(data) {
         method: 'post',
         data
     })
-}
+}
+
+
+export function getDetailWorker(data) {
+    return request({
+        url: '/orderbookdetail/getDetailWorker',
+        method: 'get',
+        params: data
+    })
+}
+
+export function modifyBookAddress(data) {
+    return request({
+        url: '/orderbookdetail/modifyBookAddress',
+        method: 'post',
+        data
+    })
+}
+
+export function changeWorker(data) {
+    return request({
+        url: '/orderbookdetail/changeWorker',
+        method: 'post',
+        data
+    })
+}

+ 34 - 6
src/router/index.js

@@ -202,7 +202,7 @@ export const constantRouterMap = [
             "POST /admin/order/reply",
             "POST /admin/order/createMemo",
             'POST /admin/hmInterst/addInterst',
-            'POST /admin/orderbook/reassign',
+            'POST /admin/orderbookdetail/changeWorker',
             'GET /admin/orderbook/cancelBook',
             'GET /admin/orderbook/finish',
             "POST /admin/sms/send",
@@ -283,7 +283,7 @@ export const constantRouterMap = [
           perms: [
             "GET /admin/orderbook/list",
             "GET /admin/orderbook/detail",
-            "POST /admin/orderbook/reassign",
+            "POST /admin/orderbookdetail/changeWorker",
             "GET /admin/orderbook/cancelBook"
           ],
           title: "服务订单",
@@ -299,7 +299,7 @@ export const constantRouterMap = [
         meta: {
           perms: [
             "GET /admin/orderbook/oncelist",
-            "POST /admin/orderbook/reassign",
+            "POST /admin/orderbookdetail/changeWorker",
             "GET /admin/orderbook/cancelBook"
           ],
           title: "单次服务订单",
@@ -315,7 +315,7 @@ export const constantRouterMap = [
         meta: {
           perms: [
             "GET /admin/orderbook/cyclelist",
-            "POST /admin/orderbook/reassign",
+            "POST /admin/orderbookdetail/changeWorker",
             "GET /admin/orderbook/cancelBook"
           ],
           title: "周期服务订单",
@@ -331,7 +331,7 @@ export const constantRouterMap = [
         meta: {
           perms: [
             "GET /admin/orderbook/categorylist",
-            "POST /admin/orderbook/reassign",
+            "POST /admin/orderbookdetail/changeWorker",
             "GET /admin/orderbook/cancelBook"
           ],
           title: "品类服务订单",
@@ -946,6 +946,34 @@ export const constantRouterMap = [
         },
         hidden: true
       },
+      {
+        path: "broadbandService",
+        component: () => import("@/views/order/telecomCard/broadbandService"),
+        name: "broadbandService",
+        meta: {
+          perms: [
+            "POST /admin/telecomOrder/getList",
+          ],
+          title: "宽带业务",
+          noCache: true,
+          keepAlive: true
+        },
+        hidden: true
+      },
+      {
+        path: "numberCardService",
+        component: () => import("@/views/order/telecomCard/numberCardService"),
+        name: "numberCardService",
+        meta: {
+          perms: [
+            "POST /admin/telecomOrder/getList",
+          ],
+          title: "号卡业务",
+          noCache: true,
+          keepAlive: true
+        },
+        hidden: true
+      },
     ]
   },
   {
@@ -995,7 +1023,7 @@ export const constantRouterMap = [
         name: "zfbOrderVocher",
         meta: {
           perms: [
-            "GET /admin/zfbOrderVocher/list", 
+            "GET /admin/zfbOrderVocher/list",
           ],
           title: "支付宝团购",
           noCache: true,

+ 10 - 2
src/views/config/order.vue

@@ -25,6 +25,12 @@
         </el-input>
         <span class="info">未到账,分佣金额冻结状态</span>
       </el-form-item>
+      <el-form-item label="新客天数" prop="jz_order_newscus_day">
+        <el-input v-model="dataForm.jz_order_newscus_day" class="input-width">
+          <template slot="append">天</template>
+        </el-input>
+        <span class="info">多少天未购买过属于新客</span>
+      </el-form-item>
 
       <el-form-item>
         <el-button @click="cancel">取消</el-button>
@@ -45,7 +51,8 @@ export default {
         jz_order_unpaid: 0,
         jz_order_unconfirm: 0,
         jz_order_comment: 0,
-        jz_order_commission: 0
+        jz_order_commission: 0,
+        jz_goods_newscus_day:0
       },
       rules: {
         jz_order_unpaid: [
@@ -59,7 +66,8 @@ export default {
         ],
         jz_order_commission: [
           { required: true, message: '不能为空', trigger: 'blur' }
-        ]
+        ],
+        jz_order_newscus_day:[{ required: true, message: '不能为空', trigger: 'blur' }]
       }
     }
   },

+ 2 - 0
src/views/config/timerange.vue

@@ -11,6 +11,7 @@
         <el-option label="收纳" :value="5" />
         <el-option label="其他" :value="6" />
       </el-select>
+      <el-input type="number" clearable class="filter-item" style="width: 170px;"  v-model="listQuery.duration"   placeholder="请输入时长" /> 
       <el-button v-permission="['GET /admin/serviceTimeRange/list']" class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查找</el-button>
       <el-button v-permission="['POST /admin/serviceTimeRange/create']" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">添加</el-button>
     </div>
@@ -127,6 +128,7 @@ export default {
         limit: 20,
         sort: "create_time",
         order: "desc",
+        duration:''
       },
       dataForm: {
         id: undefined,

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 536 - 572
src/views/goods/create.vue


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 601 - 527
src/views/goods/edit.vue


+ 28 - 7
src/views/goods/goodsSkuDetail.vue

@@ -3,13 +3,34 @@
 
 
     <!-- 评论回复 -->
-    <el-dialog :visible.sync="isShow"  width='1400px' title="SKU详情">
+    <el-dialog :visible.sync="isShow"  width='1450px' title="SKU详情">
       <el-table  :data="list"  >
         <el-table-column property="id" width="100" label="SKUID" />
         <el-table-column property="price" width="100" label="实际售卖价" />
         <el-table-column property="counterPrice" width="100" label="市场售价" />
-        <el-table-column property="attribute" width="100" label="商品属性" />
-        <el-table-column property="type" width="100" label="商品类型" />
+        <el-table-column property="newCusPrice" width="100" label="新客价" />
+        <el-table-column property="attribute" width="200" label="规格属性" >
+          <template slot-scope="scope">
+              <div style="text-align: left;">
+                <span style="font-weight: 600;">规格名称:</span>
+                {{  scope.row.specifications }}
+                <br />
+                <span style="font-weight: 600;">属性:</span>
+                {{  scope.row.attribute }}
+                <br />
+                <span style="font-weight: 600;">类型:</span>
+                {{  scope.row.type }}
+                <br />
+                <span style="font-weight: 600;">是否新客价:</span>
+                {{  scope.row.isNew==true?'是':'否' }}
+                <br />
+                <span style="font-weight: 600;">限购数:</span>
+                {{  scope.row.limit }}
+                <br />
+                </div>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column property="type" width="100" label="商品类型" /> -->
         <el-table-column property="price" label="服务设置" width="150">
             <template slot-scope="scope">
               <div style="text-align: left;">
@@ -30,10 +51,7 @@
                 <br />
                  <span style="font-weight: 600;">加购单价:</span>
                 {{ scope.row.unitPrice }}
-                <br />
-                  <span style="font-weight: 600;">所需技能:</span>
-                {{ scope.row.serviceSkill }}
-                <br />
+                <br /> 
                   <span style="font-weight: 600;">计提金额:</span>
                 {{ scope.row.serviceFee }}
                 <br />
@@ -49,6 +67,9 @@
           <el-table-column  label="预约设置" width="300">
             <template slot-scope="scope">
               <div style="text-align: left;">
+                <span style="font-weight: 600;">所需技能:</span>
+                {{ scope.row.serviceSkill }}
+                <br />
                  <span style="font-weight: 600;">预约时段类型:</span>
                 {{ scope.row.timeRangeType==1?'指定时间段可约':'固定时间段可约(默认半小时)' }}
                 <br />

+ 4 - 3
src/views/goods/list.vue

@@ -132,11 +132,12 @@
       <el-tab-pane label="所有商品" name="0" />
       <el-tab-pane label="微信商城" name="5" />
       <el-tab-pane label="抖音鲸致" name="26" />
-      <!-- <el-tab-pane label="抖音云嘉" name="107" /> -->
+      <el-tab-pane label="抖音云嘉" name="107" />
       <el-tab-pane label="美团" name="104" />
       <el-tab-pane label="快手" name="103" />
       <el-tab-pane label="众安" name="106" />
       <el-tab-pane label="支付宝" name="110" />
+      <el-tab-pane label="花王" name="112" />
     </el-tabs>
 
     <!-- 查询结果 -->
@@ -319,12 +320,12 @@
             inactive-text="非热卖"
             @change="handleOnhot(scope.row)"
           />
-          <el-switch
+          <!-- <el-switch
             v-model="scope.row.isNew"
             active-text="新客专享"
             inactive-text="非新客专享"
             @change="handleOnnew(scope.row)"
-          />
+          /> -->
           <el-switch
             v-model="scope.row.isHide"
             active-text="隐藏"

+ 86 - 34
src/views/goods/selectCity.vue

@@ -1,4 +1,3 @@
-
 <template>
     <el-dialog class="tag-dialog" title="请选择上线城市" :visible.sync="Pvisible" :close-on-click-modal="false">
         <div>
@@ -11,21 +10,33 @@
                         <div class="tag-group-name">{{ item }}</div>
                         <div class="tag-group-list flex">
                             <div class="tag-list">
-                                <el-button v-for="unit in citys.filter(city => city.province == item)" :key="unit.id"
-                                    :class="isChecked(unit) ? 'selected' : ''" @click="selectOneTag(unit)">{{ unit.cityName
-                                    }}</el-button>
+                                <template v-for="unit in citys.filter(city => city.province == item)">
+                                    <el-button :key="unit.id" v-if="ckhuawangcity(unit.id)"
+                                        :class="isChecked(unit) ? 'selected' : ''" @click="selectOneTag(unit)">{{
+        unit.cityName
+    }}</el-button>
+
+                                </template>
+
+                                <!--   -->
                             </div>
                         </div>
                     </div>
                 </div>
             </div>
             <div style="height:auto;margin-top: 8px;height: auto;">
-                <div v-if="activeTab=='抖音商城'">
+                <div v-if="activeTab=='抖音鲸致'">
                 <div>抖音商城 ({{ selectedCitys.filter(item => item.channel == 26).length }}个城市):</div>
                 <el-button v-for="p in selectedCitys.filter(item => item.channel == 26)" :key="p.id" class="selected"
                     @click="deleteOneTag(p)">{{
                         p.city }}</el-button>
                  </div>
+                 <div v-if="activeTab=='抖音云嘉'">
+                <div>抖音云嘉 ({{ selectedCitys.filter(item => item.channel == 107).length }}个城市):</div>
+                <el-button v-for="p in selectedCitys.filter(item => item.channel == 107)" :key="p.id" class="selected"
+                    @click="deleteOneTag(p)">{{
+                        p.city }}</el-button>
+                 </div>
                 <div v-if="activeTab=='微信商城'">
                 <div style="margin-top:10px">微信商城 ({{ selectedCitys.filter(item => item.channel == 5).length }}个城市):</div>
                 <el-button v-for="p in selectedCitys.filter(item => item.channel == 5)" :key="p.id" class="selected"
@@ -34,7 +45,13 @@
                 </div>
                 <div v-if="activeTab=='支付宝'">
                 <div style="margin-top:10px">支付宝 ({{ selectedCitys.filter(item => item.channel == 110).length }}个城市):</div>
-                <el-button v-for="p in selectedCitys.filter(item => item.channel == 5)" :key="p.id" class="selected"
+                <el-button v-for="p in selectedCitys.filter(item => item.channel == 110)" :key="p.id" class="selected"
+                    @click="deleteOneTag(p)">{{
+                        p.city }}</el-button>
+                </div>
+                <div v-if="activeTab=='花王'">
+                <div style="margin-top:10px">花王 ({{ selectedCitys.filter(item => item.channel == 112).length }}个城市):</div>
+                <el-button v-for="p in selectedCitys.filter(item => item.channel == 112)" :key="p.id" class="selected"
                     @click="deleteOneTag(p)">{{
                         p.city }}</el-button>
                 </div>
@@ -73,16 +90,16 @@ export default {
         loading: {
             type: Boolean,
             default: false,
-        }, 
-        activeTab:{
-            type:String,
-            default:() =>'抖音商城'
         },
-        tabs:{
-             type: Array,
-             default:() =>  ['抖音商城'],
+        activeTab: {
+            type: String,
+            default: () => '抖音商城'
         },
-       
+        tabs: {
+            type: Array,
+            default: () => ['抖音商城'],
+        },
+
     },
     data() {
         return {
@@ -90,7 +107,7 @@ export default {
             // tabs: ['抖音商城', '微信商城'],
             provinces: [],
             citys: [],
-            selectedCitys:this.selected, 
+            selectedCitys: this.selected,
             dialogVisibleAddTag: false,
         };
     },
@@ -103,7 +120,7 @@ export default {
                 this.$emit('update:visible', val);
             },
         },
-       
+
     },
     watch: {
         selected(val) {
@@ -115,6 +132,15 @@ export default {
         this.getCitys();
     },
     methods: {
+        ckhuawangcity(cityId) {
+            if(this.activeTab == '花王'){
+                let citys = "1,2,3,4,5,7,8,10,11,12,13,70,77".split(',');
+                console.log(citys);
+                console.log(citys.includes(cityId+''))
+                return citys.includes(cityId+''); 
+            }
+            return true;
+        },
         getCitys() {
             listAllCity().then(res => {
                 this.citys = res.data.data;
@@ -144,50 +170,76 @@ export default {
                 return this.selectedCitys.some((el) => {
                     return unit.id === el.cityId && el.channel === 5;
                 });
-            else if(this.activeTab == '抖音商城')
+            else if (this.activeTab == '抖音鲸致')
                 return this.selectedCitys.some((el) => {
                     return unit.id === el.cityId && el.channel === 26;
                 });
+            else if (this.activeTab == '抖音云嘉')
+                return this.selectedCitys.some((el) => {
+                    return unit.id === el.cityId && el.channel === 107;
+                });
             else if (this.activeTab == '支付宝')
                 return this.selectedCitys.some((el) => {
                     return unit.id === el.cityId && el.channel === 110;
-                });    
+                });
+            else if (this.activeTab == '花王')
+                return this.selectedCitys.some((el) => {
+                    return unit.id === el.cityId && el.channel === 112;
+                });
         },
         selectOneTag(city) {
             // let channel = this.activeTab == '微信商城' ? 5 : 26;
-            let channel =5;
-            if(this.activeTab=='抖音商城'){
-                channel=26;
+            let channel = 5;
+            if (this.activeTab == '抖音鲸致') {
+                channel = 26;
             }
-            if(this.activeTab=='支付宝'){
-                channel=110;
+            if (this.activeTab == '抖音云嘉') {
+                channel = 107;
+            }
+            if (this.activeTab == '支付宝') {
+                channel = 110;
+            }
+            if (this.activeTab == '花王') {
+                channel = 112;
             }
             const index = this.selectedCitys.findIndex((ele) => ele.cityId === city.id && ele.channel == channel);
             if (index === -1) {
                 this.selectedCitys.push({ cityId: city.id, city: city.cityName, channel: channel, province: city.province });
-            }else
-                this.selectedCitys.splice(index, 1); 
+            } else
+                this.selectedCitys.splice(index, 1);
         },
         deleteOneTag(city) {
             const index = this.selectedCitys.findIndex((ele) => ele.cityId === city.cityId && ele.channel == city.channel);
             if (index >= 0)
                 this.selectedCitys.splice(index, 1);
         },
-        selectAll() { 
+        selectAll() {
             // let channel = this.activeTab == '微信商城' ? 5 : 26;
-            let channel =5;
-            if(this.activeTab=='抖音商城'){
-                channel=26;
+            let channel = 5;
+            if (this.activeTab == '抖音鲸致') {
+                channel = 26;
+            }
+            if (this.activeTab == '抖音云嘉') {
+                channel = 107;
             }
-            if(this.activeTab=='支付宝'){
-                channel=110;
+            if (this.activeTab == '支付宝') {
+                channel = 110;
+            }
+            if (this.activeTab == '花王') {
+                channel = 112;
             }
             let filterCity = this.selectedCitys.filter(item => item.channel != channel);
             this.selectedCitys = filterCity.concat(this.citys.map(city => { return { cityId: city.id, city: city.cityName, channel: channel, province: city.province } }))
+           
+            if(this.activeTab == '花王'){ 
+                let that=this;
+                this.selectedCitys  =this.selectedCitys.filter(e => that.ckhuawangcity(e.cityId));
+                
+            }
+        },
+        selectAllNo() {
+            this.selectedCitys = [];
         },
-           selectAllNo() {
-               this.selectedCitys=[];
-           }, 
         closed() {
             this.selectedCitys = this.selected;
             this.Pvisible = false;

+ 439 - 0
src/views/order/components/broadbandServiceRef.vue

@@ -0,0 +1,439 @@
+<template>
+  <div>
+    <!-- 订单详情对话框 -->
+    <el-dialog :visible.sync="orderDialogVisible" title="订单详情" width="800">
+      <el-card shadow="never" style="margin-top: 15px">
+        <div class="operate-container">
+          <i class="el-icon-warning color-danger" style="margin-left: 20px" />
+          <span class="color-danger">
+            当前订单状态:{{  orderStatusFilter(orderDetail.status) }}
+          </span>
+          <span class="color-rebuy" style="margin-left:100px"> 核销时间: {{ formatTime(orderDetail.verificationTime) }} </span>
+        </div>
+
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="shopping" style="color: #606266" />
+          <span class="font-small">客户信息</span>
+        </div>
+        <div class="table-layout">
+          <el-row>
+            <el-col :span="4" class="table-cell-title">客户姓名</el-col>
+            <el-col :span="4" class="table-cell-title">客户手机号码</el-col>
+            <el-col :span="6" class="table-cell-title">客户身份证</el-col>
+            <el-col :span="10" class="table-cell-title">客户地址</el-col>
+
+          </el-row>
+          <el-row>
+            <el-col :span="4" class="table-cell">{{ orderDetail.name }}</el-col>
+            <el-col :span="4" class="table-cell">{{ orderDetail.contactMobile }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.idCard }}</el-col>
+            <el-col :span="10" class="table-cell">{{ orderDetail.installedAddress }}</el-col>
+
+          </el-row>
+        </div>
+
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="shopping" style="color: #606266" />
+          <span class="font-small">下单信息</span>
+        </div>
+        <div class="table-layout">
+          <el-row>
+            <el-col :span="6" class="table-cell-title">商品名</el-col>
+            <el-col :span="4" class="table-cell-title">渠道运营商</el-col>
+            <el-col :span="4" class="table-cell-title">领客订单号</el-col>
+            <el-col :span="6" class="table-cell-title">抖音订单号</el-col>
+            <el-col :span="4" class="table-cell-title">核销券码</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell">{{ orderDetail.commodityName }}</el-col>
+            <el-col :span="4" class="table-cell">{{ operatorChannelText(orderDetail.operatorChannel) }}</el-col>
+            <el-col :span="4" class="table-cell">{{ orderDetail.outOrderNo }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.orderNo }}</el-col>
+            <el-col :span="4" class="table-cell">{{ orderDetail.ticketCode }}</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell-title">支付时间</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell">{{ formatTime(orderDetail.dyPaymentTime) }}</el-col>
+          </el-row>
+        </div>
+
+
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="shopping" style="color: #606266" />
+          <span class="font-small">预约信息</span>
+        </div>
+        <div class="table-layout">
+          <el-row>
+            <el-col :span="12" class="table-cell-title">预计上门时间</el-col>
+            <el-col :span="12" class="table-cell-title">预约上门地址</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12" class="table-cell">{{ orderDetail.predictVisitDate }}</el-col>
+            <el-col :span="12" class="table-cell">{{ orderDetail.installedAddress }}</el-col>
+          </el-row>
+
+
+          <el-row>
+            <el-col :span="12" class="table-cell-title">操作客服</el-col>
+            <el-col :span="12" class="table-cell-title">操作时间</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12" class="table-cell">{{ orderDetail.createOrderUser }}</el-col>
+            <el-col :span="12" class="table-cell">{{ formatTime(orderDetail.createTime) }}</el-col>
+          </el-row>
+        </div>
+
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="shopping" style="color: #606266" />
+          <span class="font-small">客服代下单</span>
+        </div>
+        <div class="table-layout">
+          <el-row>
+            <el-col :span="6" class="table-cell-title">设备号</el-col>
+            <el-col :span="6" class="table-cell-title">充值金额</el-col>
+            <el-col :span="6" class="table-cell-title">充值时间</el-col>
+            <el-col :span="6" class="table-cell-title">是否代下单</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell">{{ orderDetail.deviceNumber }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.topUpAmount }}</el-col>
+            <el-col :span="6" class="table-cell">{{ formatTime(orderDetail.topUpDate) }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.isCreateOrder==1?'是':'否' }}</el-col>
+          </el-row>
+
+          <el-row>
+            <el-col :span="6" class="table-cell-title">下单客服</el-col>
+            <el-col :span="6" class="table-cell-title">下单工单号</el-col>
+            <el-col :span="6" class="table-cell-title">支付订单号</el-col>
+            <el-col :span="6" class="table-cell-title">客服备注</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell">{{ orderDetail.createOrderUser }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.telecomOrderNo }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.paymentNo }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.remark }}</el-col>
+
+          </el-row>
+        </div>
+
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="shopping" style="color: #606266" />
+          <span class="font-small">退费登记</span>
+        </div>
+        <div class="table-layout">
+          <el-row>
+            <el-col :span="8" class="table-cell-title">充值后退费金额</el-col>
+            <el-col :span="8" class="table-cell-title">提交线下退费月份</el-col>
+            <el-col :span="8" class="table-cell-title">订单号</el-col>
+
+          </el-row>
+          <el-row>
+            <el-col :span="8" class="table-cell">{{ orderDetail.refundAmount }}</el-col>
+            <el-col :span="8" class="table-cell">{{ orderDetail.refundDate }}</el-col>
+            <el-col :span="8" class="table-cell">{{ orderDetail.refundNo }}</el-col>
+          </el-row>
+        </div>
+
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="shopping" style="color: #606266" />
+          <span class="font-small">客户备注</span>
+        </div>
+        <div class="table-layout">
+          <el-row>
+            <el-col :span="24" class="table-cell-title">备注</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24" class="table-cell">{{ orderDetail.userRemark }}</el-col>
+          </el-row>
+        </div>
+<!--         商品信息
+        <div style="margin-top: 20px">
+          <svg-icon icon-class="product" style="color: #606266" />
+          <span class="font-small">下单信息</span>
+        </div>
+        <el-table :data="orderDetail.orderGoods" style="width: 100%;margin-top: 20px" border>
+          <el-table-column label="商品图片" width="120" align="center">
+            <template slot-scope="scope">
+              <img :src="scope.row.picUrl" style="height: 80px" />
+            </template>
+          </el-table-column>
+
+          <el-table-column label="商品名称" width="250" align="center">
+            <template slot-scope="scope">
+              <p>{{ scope.row.goodsName }}</p>
+              &lt;!&ndash; <p>品牌:{{ scope.row.productBrand }}</p> &ndash;&gt;
+            </template>
+          </el-table-column>
+
+          <el-table-column label="价格/货号" align="center">
+            <template slot-scope="scope">
+              <p>价格:¥{{ scope.row.price }}</p>
+              <p>货号:{{ scope.row.goodsSn }}</p>
+            </template>
+          </el-table-column>
+
+          <el-table-column style="border-right: 0px" label="小计" align="center">
+            <template slot-scope="scope">¥{{ scope.row.price * scope.row.number }}</template>
+          </el-table-column>
+        </el-table>-->
+        <div style="float: right;padding-top:10px;padding-bottom: 10px ">
+          <el-button type="primary" @click="orderDialogVisible = false">确 认</el-button>
+          <!--<el-button type="primary" @click="printOrder">打 印</el-button>-->
+        </div>
+      </el-card>
+    </el-dialog>
+  </div>
+</template>
+
+
+
+<script>
+import { detailOrder, readMemo, orderBookDetail } from "@/api/order";
+import { allChannel } from "@/api/channel";
+
+import {
+  statusMap,
+  statusModifyMap,
+  bookStatusMap,
+  ObjectToArray,
+  cancelReasonList,
+  changeReasonMap
+} from "@/api/enumUtils";
+import { formatDate } from "@/utils/date";
+let vm;
+export default {
+  name: "orderInfoRef",
+  components: {},
+  beforeCreate() {
+  },
+  filters: {
+    aftersaleStatusFilter(status) {
+      if (status == 1) return "-退款申请中";
+      if (status == 2) return "-退款审核通过";
+      if (status == 3) return "-退款成功";
+      if (status == 4) return "-退款拒绝";
+      if (status == 5) return "-退款取消";
+      return "";
+    },
+  },
+  data() {
+    return {
+      channels: [],
+      payChannelMap: { "WX": '微信', 'ZFB': '支付宝', 'DOUYIN': '抖音' },
+      orderDetail: {
+        order: ''
+      },
+      orderMemo: [],
+      orderDialogVisible: false,
+      bookDetals: [],
+      bookStatusMap: bookStatusMap,
+    };
+  },
+  created() {
+  },
+  methods: {
+    getDetail(row) {
+      console.log(row)
+        this.orderDetail = row;
+      this.orderDialogVisible=true;
+    },
+    getBookDetail(orderId) {
+      orderBookDetail(orderId).then(res => {
+        this.bookDetals = res.data.data
+      })
+    },
+    formatTime(time) {
+      if (time == null || time === "") {
+        return "";
+      }
+      const date = new Date(time);
+      return formatDate(date, "yyyy-MM-dd hh:mm:ss");
+    },
+    channelsFilter(value) {
+      const rs = this.channels.filter((item) => {
+        return item.id === value;
+      });
+      if (rs != null && rs.length > 0) {
+        return rs[0].name;
+      }
+    },
+    formatStepStatus() {
+      let value = this.orderDetail ? this.orderDetail.order.orderStatus : '';
+      let time = this.orderDetail ? this.orderDetail.order.commentTime : '';
+      if (value === 201) {
+        // 待发货
+        return 2;
+      } else if (value === 301) {
+        // 已发货
+        return 3;
+      } else if (value === 401 || value === 402) {
+        // 已完成
+        if (time != null && time != "undefined") {
+          return 5;
+        } else {
+          return 4;
+        }
+      } else {
+        // 待付款、已关闭、无限订单
+        return 1;
+      }
+    },
+    /*  -1已取消,0待确认,1确认,8已完成*/
+    orderStatusFilter(status) {
+      if(status==0){
+        return '待确认'
+      }else if(status==-1){
+        return '已取消'
+      }else if(status==1){
+        return '确认'
+      }else if(status==8){
+        return '已完成'
+      }
+      return ""
+    },
+    //1 上海电信 2 浙江移动 3 北京移动
+    operatorChannelText(operatorChannel){
+      if(operatorChannel==1){
+        return '上海电信'
+      }else if(operatorChannel==2){
+        return '浙江移动'
+      }else if(operatorChannel==3){
+        return '北京移动'
+      }
+      return ""
+    }
+  }
+}
+</script>
+
+
+
+<style> .pagination-container {
+   margin-top: 0px;
+   padding: 5px 16px !important;
+ }
+
+ .el-table .accept {
+   background-color: #cc5858;
+ }
+
+ .el-table .completed {
+   background-color: #999;
+ }
+
+ .el-table .waiting {
+   background-color: #73bfec;
+ }
+
+ .el-table .nobook {
+   background-color: #bebbbb;
+ }
+
+ .el-table .cancel {
+   background-color: #bebbbb;
+ }
+
+ .el-table .processing {
+   background-color: rgb(169 201 234);
+ }
+
+
+ .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;
+ }
+
+ .el-button+.el-button {
+   margin-left: 0px;
+ }
+
+ .el-table colgroup.gutter {
+   display: table-cell !important;
+ }
+
+ .el-table .warning-row {
+   background: oldlace;
+ }
+
+ .el-table .success-row {
+   background: #f0f9eb;
+ }
+
+ .color-danger {
+   color: #f56c6c;
+   font-size: 18px;
+ }
+
+ .color-rebuy {
+   color: #09afff;
+   font-size: 18px;
+ }
+
+ .el-dialog .el-cascader {
+   width: 400px;
+ }
+
+ .fixed-width .el-button--mini {
+   width: auto;
+   min-width: 60px;
+ }
+
+ .el-step.is-center .el-step__description {
+   padding-left: 18%;
+   padding-right: 18%;
+ }
+
+ .el-table th.gutter {
+   display: table-cell !important;
+ }
+
+
+ </style>

src/views/order/components/dispatchCycleOrder.vue → src/views/order/components/dispatchCycleOrder.vue.bak


+ 13 - 1
src/views/order/components/orderInfoRef.vue

@@ -140,6 +140,14 @@
             <el-col :span="6" class="table-cell"><el-tag>{{ channelsFilter(orderDetail.order.orderChannel)
             }}</el-tag></el-col>
           </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell-title">优惠券使用渠道</el-col>
+            <el-col :span="6" class="table-cell-title">用户来源(首次消费)</el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6" class="table-cell">{{ channelsFilter(orderDetail.order.couponChannel) }}</el-col>
+            <el-col :span="6" class="table-cell">{{ orderDetail.user.channelName }}</el-col>
+          </el-row>
         </div>
 
 
@@ -274,7 +282,8 @@ export default {
       channels: [],
       payChannelMap: { "WX": '微信', 'ZFB': '支付宝', 'DOUYIN': '抖音' },
       orderDetail: {
-        order: ''
+        order: '',
+        user:{}
       },
       orderMemo: [],
       orderDialogVisible: false,
@@ -312,6 +321,9 @@ export default {
       return formatDate(date, "yyyy-MM-dd hh:mm:ss");
     },
     channelsFilter(value) {
+      if(value==null||value==''){
+        return '';
+      }
       const rs = this.channels.filter((item) => {
         return item.id === value;
       });

+ 165 - 121
src/views/order/components/reassignOrder.vue

@@ -1,56 +1,70 @@
 <template>
   <div class="reassign-dialog">
-    <el-drawer title="改派" :visible.sync="drawerShow" direction="rtl" size="70%" > 
-      <div style="padding:20px;overflow-y:scroll;" >
-      <el-form :inline="true" size="small" v-model="listQuery">
-        <el-form-item label="时间">
-          <el-date-picker v-model="listQuery.month" type="month" placeholder="选择日期" value-format="yyyy-MM" />
-        </el-form-item>
-
-        <el-form-item label="服务者">
-          <el-select v-model="listQuery.worker" placeholder="请选择" filterable clearable>
-            <el-option v-for="item in servantList" :key="item.code" :label="item.workerName" :value="item.workerId" />
-          </el-select>
-        </el-form-item>
-
-        <el-form-item>
-          <el-button icon="el-icon-search" type="primary" plan @click="querySearch">查询</el-button>
-        </el-form-item>
-      </el-form>
-
-      <el-table :data="dataList" border v-loading="listLoading" height="500px">
-        <el-table-column property="workerId" label="服务者id" width="80" fixed></el-table-column>
-        <el-table-column property="workerName" label="服务者姓名" width="100" fixed></el-table-column>
-        <el-table-column v-for="(item, index) in dayList" :property="item" :label="item + '(' + getDateWeek(item) + ')'"
-          :key="index" width="180">
-          <template slot-scope="scope">
-            <div v-for="(item2, index2) in scope.row.dayStock[item]" :key="index2">
-              <!-- {{scope.row.dayStock[item]}} -->
-              <div @click="checkChange(item, item2, scope.$index, index2, scope.row.workerId)">
-                <!--   -->
-                <!-- <el-checkbox v-model="item2.isChecked" :disabled="item2.isOccupy!=0" @change="checkChange(item,item2,scope.$index,index2)">
+    <el-drawer title="改派" :visible.sync="drawerShow" direction="rtl" size="70%">
+      <template v-for="(item,index) in  workers" >
+      <el-row :style="index==parentIndex?'color:#09afff':''"  :key="item.id"> 服务者{{ index + 1 }} ({{ item.skillName }},{{ item.serviceLength }}小时,
+        {{item.sort != null && item.sort > 0 ? '有序' : '无序' }}),
+        {{ item.workerName }}{{ item.bookDate+' '+item.bookStartTime+'-'+item.bookEndTime }}</el-row>
+      </template>
+      <div style="padding:20px;overflow-y:scroll;">
+        <el-form :inline="true" size="small" v-model="listQuery">
+          <el-form-item label="时间">
+            <el-date-picker v-model="listQuery.month" type="month" placeholder="选择日期" value-format="yyyy-MM" />
+
+            <el-form-item label="服务技能">
+              <el-select disabled v-model="listQuery.skillId" class="filter-item" style="width:100%" placeholder="服务技能"
+                filterable @change="getServantList">
+                <el-option v-for="item in  skilllist" :key="item.id" :label="item.skillName" :value="item.skillId" />
+              </el-select>
+            </el-form-item>
+          </el-form-item>
+
+          <el-form-item label="服务者">
+            <el-select v-model="listQuery.worker" placeholder="请选择" filterable clearable>
+              <el-option v-for="item in servantList" :key="item.code" :label="item.workerName" :value="item.workerId" />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button icon="el-icon-search" type="primary" plan @click="querySearch">查询</el-button>
+          </el-form-item>
+        </el-form>
+
+        <el-table :data="dataList" border v-loading="listLoading"  >
+          <el-table-column property="workerId" label="服务者id" width="80" fixed></el-table-column>
+          <el-table-column property="workerName" label="服务者姓名" width="100" fixed></el-table-column>
+          <el-table-column v-for="(item, index) in dayList" :property="item"
+            :label="item + '(' + getDateWeek(item) + ')'" :key="index" width="180">
+            <template slot-scope="scope">
+              <div v-for="(item2, index2) in scope.row.dayStock[item]" :key="index2">
+                <!-- {{scope.row.dayStock[item]}} -->
+                <div @click="checkChange(item, item2, scope.$index, index2, scope.row.workerId, scope.row.workerName)">
+                  <!--   -->
+                  <!-- <el-checkbox v-model="item2.isChecked" :disabled="item2.isOccupy!=0" @change="checkChange(item,item2,scope.$index,index2)">
                     </el-checkbox>  -->
-                <!-- <i class="el-icon-circle-check" v-if="item2.isOccupy==1"></i> -->
-                {{ item2.startTime }}-{{ item2.endTime }}
-                <i class="el-icon-success" v-if="item2.isChecked && item2.isOccupy == 0"
-                  style="color:#09afff;font-size:22px;"></i>
-                <i class="el-icon-success" v-if="!item2.isChecked && item2.isOccupy == 0"
-                  style="color:#ccc;font-size:22px;"></i>
-                <span v-if="item2.isOccupy == 1" style="font-size:10px;color:#09afff;cursor: pointer;">{{
-                  item2.cooupyEvent }}</span>
-
-              </div>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-        
-      <pagination v-show="total > 0" :total="total" :page.sync="listQuery.pageNo" :limit.sync="listQuery.pageSize"
-        @pagination="getList" />
-
-      <div style="text-align:center;margin-top:20px;">
-        <el-button type="primary" @click="confirmReassign">确定改派</el-button>
-      </div>
+                  <!-- <i class="el-icon-circle-check" v-if="item2.isOccupy==1"></i> -->
+                  {{ item2.startTime }}-{{ item2.endTime }}
+                  <i class="el-icon-success" v-if="item2.isChecked && item2.isOccupy == 0"
+                    style="color:#09afff;font-size:22px;"></i>
+                  <i class="el-icon-success" v-if="!item2.isChecked && item2.isOccupy == 0"
+                    style="color:#ccc;font-size:22px;"></i>
+                  <span v-if="item2.isOccupy == 1" style="font-size:10px;color:#09afff;cursor: pointer;">{{
+      item2.cooupyEvent }}</span>
+
+                </div>
+              </div> 
+            </template>
+          </el-table-column>
+          <!-- <el-table-column v-if="dayList.length<5" width="400">
+            </el-table-column> -->
+        </el-table>
+
+        <pagination v-show="total > 0" :total="total" :page.sync="listQuery.pageNo" :limit.sync="listQuery.pageSize"
+          @pagination="getList" />
+
+        <div style="text-align:center;margin-top:20px;">
+          <el-button type="primary" @click="confirmReassign2">确定</el-button>
+        </div>
       </div>
     </el-drawer>
 
@@ -105,50 +119,25 @@ export default {
   data() {
 
     return {
+      heights:'500px',
       drawerShow: false,
+      tempSkillId: '',//防止篡改下拉框
       listQuery: {
         month: moment(new Date()).format("YYYY-MM"),
+        detailId: '',
         worker: '',
+        skillId: '',
         pageSize: 5,
         pageNo: 1
       },
       list: [],
       total: 1,
       activeName: "全职",
-      listLoading: true,
-      orderInfo: {},
+      listLoading: true, 
+      skilllist: [],//{skillId: "1004", skillName: "开荒保洁", serviceTotal: 1}
       servantList: [],
-      updateAddressForm: {
-        consignee: '',
-        mobile: '',
-        addressDetail: '',
-        cancelBookOrderDetail: 0,
-        location: '',//经纬度
-        orderId: '',
-      },
-      updateAddressFormRules: {
-        bookTime: [{ required: true, message: "请选择服务时间", trigger: "blur" },],
-        bookDate: [{ required: true, message: "请选择服务日期", trigger: "blur" },],
-        consignee: [
-          { required: true, message: "请输入客户名称", trigger: "blur" },
-        ],
-        mobile: [
-          { required: true, message: "请输入客户电话", trigger: "blur" },
-        ],
-        area: [{ required: true, message: "请选择省市区", trigger: "change" }],
-        addressDetail: [
-          { required: true, message: "请输入客户地址", trigger: "blur" },
-        ],
-        cancelBookOrderDetail: [
-          {
-            required: true,
-            message: "是否取消已预约未服务工单",
-            trigger: "blur",
-          },
-        ]
-      },
-      fraServantList: [],//兼职人员
-
+      workers:[],//上个页面已选人员
+      parentIndex:[],
       dataList: [
 
       ],
@@ -157,9 +146,11 @@ export default {
       ],
       reassignForm: {
         servantId: '',
+        workerName: '',
         bookDate: '',
         startTime: '',
-        endTime: ''
+        endTime: '',
+        scheduleId: '',
       }
 
 
@@ -173,13 +164,32 @@ export default {
   },
   methods: {
     checkPermission,
-    initDrawer(data, type) {
-      this.orderInfo = data;
+    initDrawer(detailId, skilllist,skillId,workers,parentIndex) { 
+      this.skilllist = skilllist;
+      this.workers=workers;
+      this.parentIndex=parentIndex;
+
       this.drawerShow = true;
+
+      this.listQuery.detailId =detailId;
+      this.listQuery.skillId=skillId;
+      // if (this.skilllist != null && this.skilllist.length > 0) {
+      //   this.listQuery.skillId = this.skilllist[0].skillId;
+      // }
+
+      this.reassignForm = {
+        servantId: '',
+        workerName: '',
+        bookDate: '',
+        startTime: '',
+        endTime: '',
+        scheduleId: '',
+      };
+
       this.querySearch();
-      this.getServantList(this.orderInfo.id);
+      this.getServantList();
     },
-    checkChange(item1, item2, index1, index2, workerId) {
+    checkChange(item1, item2, index1, index2, workerId, workerName) {
 
       console.log(item1);
       console.log(item2);
@@ -200,9 +210,11 @@ export default {
 
         this.$forceUpdate();
         this.reassignForm.servantId = workerId;
+        this.reassignForm.workerName = workerName;
         this.reassignForm.bookDate = item1;
         this.reassignForm.startTime = item2.startTime;
         this.reassignForm.endTime = item2.endTime;
+        this.reassignForm.scheduleId = item2.scheduleId;
       }
       else if (item2.isOccupy == 1) {
         let event = item2.cooupyEvent;
@@ -210,60 +222,91 @@ export default {
         this.$router.push({ path: "/goods/edit", query: { id: id } });
       }
     },
-    checkClick() {
-      console.log(1);
-    },
     querySearch() {
       this.listQuery.pigeNo = 1;
       this.getList();
     },
-    getServantList(id) {
-      getAssignmentPerson(id).then((res) => {
-        this.servantList = res.data.data;
+    getServantList() { 
+      getAssignmentPerson({ detailId: this.listQuery.detailId, skillId: this.listQuery.skillId }).then((res) => {
+        this.servantList = res.data.data; 
       });
     },
     reassignSuccess() {
       this.drawerShow = false;
-      this.$parent.orderBookDetail(this.orderInfo.orderId);
+      this.$parent.$parent.orderBookDetail();
     },
-    confirmReassign() {
+    confirmReassign2() {
       if (this.reassignForm.bookDate == '') {
-        this.$message.error('请选择改派日期');
+        this.$message.error('请选择预约时段');
         return false;
-
       }
 
-      let params = {
-        id: this.orderInfo.id,
+      let skillName = '';
+      let that = this;
+      this.skilllist.forEach(e => {
+        if (e.skillId == that.tempSkillId) {
+          skillName = e.skillName;
+        }
+      })
+
+      let resWorker = {
+        type: 0,
+        workerId: this.reassignForm.servantId,
+        workerName: this.reassignForm.workerName,
+        scheduleId: this.reassignForm.scheduleId,
+        workerSkillId: this.tempSkillId,
+        skillName: skillName,
         bookDate: this.reassignForm.bookDate,
         bookStartTime: this.reassignForm.startTime,
-        bookEndTime: this.reassignForm.endTime,
-        servantId: this.reassignForm.servantId,
+        bookEndTime: this.reassignForm.endTime
       };
-      orderBookReassign(params)
-        .then((response) => {
-          this.$message.success("改派成功");
-          console.log(response);
-          this.drawerShow = false;
-          this.$parent.orderBookDetail(this.orderInfo.orderId);
-        })
-        .catch((response) => {
-          this.$notify.error({
-            title: "失败",
-            message: response.data.errmsg,
-          });
-        });
+      console.log(resWorker);
+      this.drawerShow = false;
+      try {
+        this.$parent.$parent.settingFullWorker(resWorker);
+      } catch (error) {
+        console.log(error);
+      }
 
     },
+    // confirmReassign() {
+    //   if (this.reassignForm.bookDate == '') {
+    //     this.$message.error('请选择改派日期');
+    //     return false;
+
+    //   }
+
+    //   let params = {
+    //     id: this.orderInfo.id,
+    //     bookDate: this.reassignForm.bookDate,
+    //     bookStartTime: this.reassignForm.startTime,
+    //     bookEndTime: this.reassignForm.endTime,
+    //     servantId: this.reassignForm.servantId,
+    //   };
+    //   orderBookReassign(params)
+    //     .then((response) => {
+    //       this.$message.success("改派成功");
+    //       console.log(response);
+    //       this.drawerShow = false;
+    //       this.$parent.orderBookDetail(this.orderInfo.orderId);
+    //     })
+    //     .catch((response) => {
+    //       this.$notify.error({
+    //         title: "失败",
+    //         message: response.data.errmsg,
+    //       });
+    //     });
+
+    // },
     getList() {
+      this.tempSkillId = this.listQuery.skillId;
       getCalendarStock({
-        detailId: this.orderInfo.id,
-        orderId: this.orderInfo.orderId,
-        orderBookId: this.orderInfo.orderBookId,
+        detailId: this.listQuery.detailId, 
         month: this.listQuery.month,
         workerName: this.listQuery.worker,
+        skillId: this.listQuery.skillId,
         pageSize: this.listQuery.pageSize,
-        pageNo: this.listQuery.pageNo
+        pageNo: this.listQuery.pageNo,
       })
         .then((response) => {
           console.log(response);
@@ -303,10 +346,11 @@ export default {
 };
 </script>
 
-<style >
->>> .el-drawer__body {
+<style scoped>
+>>>.el-drawer__body {
   padding: 20px !important;
   height: 500px;
   overflow-y: scroll;
 }
+ 
 </style>

+ 392 - 0
src/views/order/components/serviceBookRef .vue.bak

@@ -0,0 +1,392 @@
+<template>
+    <el-dialog title="客户服务预约" :visible.sync="dislogFormVisible" width="900px" :close-on-click-modal="false" center
+        :modal="true">
+        <el-form ref="updateAddressForm" :model="updateAddressForm" :rules="updateAddressFormRules" status-icon
+            label-position="center" label-width="100px">
+            <el-row v-if="updateAddressForm.status==8">
+                <el-form-item label="客户意向" prop="expect">
+                    <el-radio-group v-model="updateAddressForm.expect" @change="expectChange">
+                        <el-radio :label="1">预约</el-radio>
+                        <el-radio :label="2">有预期</el-radio>
+                        <el-radio :label="3">暂不预约</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+            </el-row>
+            <el-row>
+                <el-col :span="12">
+                    <el-form-item label="预约联系人" prop="consignee">
+                        <el-input v-model="updateAddressForm.consignee" clearable placeholder="请输入预约联系人" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="预约电话" prop="mobile">
+                        <el-input v-model="updateAddressForm.mobile" clearable placeholder="请输入预约联系人的电话" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="12">
+                    <el-form-item label="服务地址" prop="addressDetail">
+                        <el-input v-model="updateAddressForm.addressDetail" placeholder="请输入客户详细服务地址">
+                            <i slot="suffix" class="el-icon-location" style="font-size:25px;cursor: pointer;margin-top:6px"
+                                @click="btnSearchClick"></i></el-input>
+                        <!-- <el-button type="primary" size="mini" @click=" btnSearchClick ">查询地址</el-button> -->
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12" style="display: flex;">
+                    <el-form-item label="服务日期" prop="bookDate" style="margin-bottom: 2px">
+                        <el-date-picker v-model="updateAddressForm.bookDate" :disabled="updateAddressForm.expect == 3" type="date" placeholder="请选择服务日期"
+                            style="width: 180px" value-format="yyyy-MM-dd" />
+                        <el-select v-model="updateAddressForm.bookTime" clearable :disabled="updateAddressForm.expect == 3" style="width: 140px" class="filter-item"
+                            placeholder="服务时间段">
+                            <el-option v-for="item in  timerange" :key="item" :label="item" :value="item" />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="12">
+                    <el-form-item label="服务人员" prop="servantId">
+                        <el-select v-model="updateAddressForm.servantId" :disabled="updateAddressForm.expect != 1" clearable class="filter-item" style="width:100%"
+                            placeholder="服务人员" filterable>
+                            <el-option v-for="item in  fraWorkers " :key="item.id"  :label="item.name+'('+item.tel+')'"  :value="item.id" />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="7">
+                    <el-form-item label="计提金额" prop="servantFee">
+                        <el-input v-model="updateAddressForm.servantFee" type="number" :disabled="updateAddressForm.expect != 1" placeholder="服务者的计提" />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5" style="text-align: right;">
+                    <el-button @click="dislogFormVisible = false">取消</el-button>
+                    <el-button type="success" @click="submit">保存</el-button>
+                </el-col>
+            </el-row>
+
+        </el-form>
+        <div id="container" style=" height: 450px; width: 100%;"></div>
+
+    </el-dialog>
+</template>
+
+
+<script>
+import moment from "moment";
+import { updateOrderAddressV2, getGoodsTimeRange, getWorkerByFraId } from "@/api/order";
+import { getLngLat } from "@/api/address"
+export default {
+    name: 'serviceBookRef',
+    data() {
+        var validBookDate = (rule, value, callback) => {
+            if (this.updateAddressForm.expect == 3) {
+                callback();
+            } else {
+                if (this.updateAddressForm.bookDate == null || this.updateAddressForm.bookTime == null)
+                    callback(new Error("请选择日期"));
+                else 
+                callback();
+            }
+        };
+        return {
+            servantList: [],
+            timerange: [],
+            dislogFormVisible: false,
+            map: "",
+            marker: '',
+            fraWorkers: [],//加盟商的兼职阿姨
+            updateAddressForm: {
+                consignee: '',
+                mobile: '',
+                addressDetail: '',
+                cancelBookOrderDetail: 0,
+                location: '',//经纬度
+                orderId: '',
+            },
+            updateAddressFormRules: {
+                bookTime: [{ validator:validBookDate,required: true, message: "请选择服务时间", trigger: "blur" },],
+                bookDate: [{ validator:validBookDate,required: true, message: "请选择服务日期", trigger: "blur" },],
+                consignee: [
+                    { required: true, message: "请输入客户名称", trigger: "blur" },
+                ],
+                mobile: [
+                    { required: true, message: "请输入客户电话", trigger: "blur" },
+                ],
+                area: [{ required: true, message: "请选择省市区", trigger: "change" }],
+                addressDetail: [
+                    { required: true, message: "请输入客户地址", trigger: "blur" },
+                ],
+                cancelBookOrderDetail: [
+                    {
+                        required: true,
+                        message: "是否取消已预约未服务工单",
+                        trigger: "blur",
+                    },
+                ]
+            }
+        }
+    },
+    mounted() {
+    },
+    methods: {
+        expectChange() {
+            if (this.updateAddressForm.expect == 3) {
+                this.updateAddressForm.bookDate = null;
+                this.updateAddressForm.bookTime = null;
+                this.updateAddressForm.servantId = null;
+                this.updateAddressForm.servantFee = null;
+            }
+            if (this.updateAddressForm.expect == 2) {
+                this.updateAddressForm.servantId = null;
+                this.updateAddressForm.servantFee = null;
+            }
+
+        },
+        btnSearchClick() {
+            if (!this.updateAddressForm.addressDetail || this.updateAddressForm.addressDetail == '' || this.updateAddressForm.addressDetail.length < 12) {
+                this.$notify.warning({
+                    title: "提醒",
+                    message: "请输入客户详细地址",
+                });
+                return;
+            }
+            getLngLat({ address: this.updateAddressForm.addressDetail }).then(res => {
+                this.updateAddressForm.location = res.data.data;
+                this.makeMarker();
+            }).catch(response => {
+          this.$notify.error({
+            title: '失败',
+            message: response.data.errmsg
+          })
+        })
+        },
+        init(data) {
+            this.dislogFormVisible = true;
+            let location = [];
+            if (data.lng) {
+                location.push(data.lng);
+                location.push(data.lat);
+            }
+            // console.info(location)
+
+            this.getGoodsTimeRange(data.orderId);
+            this.getFraWorkers(data.fraId);
+            this.updateAddressForm = {
+                mobile: data.mobile,
+                consignee: data.consignee,
+                addressDetail: data.address,
+                cancelBookOrderDetail: 0,
+                location: location,
+                orderId: data.orderId,
+                bookDate: data.bookDate,
+                bookTime: (data.bookStartTime ? (data.bookStartTime + '-' + data.bookEndTime) : ''),
+                serviceId: data.id,
+                servantId: data.servantId?parseInt(data.servantId):'',
+                servantName: data.servantName,
+                servantMobile: data.servantMobile,
+                servantFee:data.servantFee,
+                orderChannel:data.orderChannel,
+                status:data.status,
+                expect:1
+            }
+
+            // console.info(this.updateAddressForm)
+            if (this.marker != '')
+                this.marker.setMap(null);
+            setTimeout(() => {
+                this.initMap();
+                this.makeMarker('init');
+            }, 1000);
+        },
+        submit() {
+            //预约时间是否小于今天
+            let now = moment(new Date()).format("YYYY-MM-DD");
+            if (this.updateAddressForm.bookDate < now) {
+                this.$notify.warning({
+                    title: "提醒",
+                    message: "预约时间不能小于当天",
+                });
+                return;
+            }
+            if(this.updateAddressForm.location.length<2){
+                this.$notify.warning({
+                    title: "提醒",
+                    message: "请点击地址框后的图标 定位客户地址",
+                });
+                return;
+            }
+
+            this.$refs["updateAddressForm"].validate((valid) => {
+                console.info(valid)
+                if (valid) {
+                    const loading = this.$loading({
+                        lock: true,
+                        text: "提交中...",
+                        spinner: "el-icon-loading",
+                        background: "rgba(0, 0, 0, 0.5)",
+                    });
+                    console.info(this.updateAddressForm.location)
+                    if (this.updateAddressForm.servantId) {
+                        let servnats = this.fraWorkers.filter(item => { return item.id == this.updateAddressForm.servantId });
+                        if (servnats.length > 0) {
+                            this.updateAddressForm.servantName = servnats[0].name;
+                            this.updateAddressForm.servantMobile = servnats[0].tel;
+                        }
+
+                    }
+                    updateOrderAddressV2({
+                        addressDto: {
+                            addressDetail: this.updateAddressForm.addressDetail,
+                            name: this.updateAddressForm.consignee,
+                            tel: this.updateAddressForm.mobile,
+                            lng: this.updateAddressForm.location[0],
+                            lat: this.updateAddressForm.location[1],
+                        },
+                        serviceId: this.updateAddressForm.serviceId,
+                        bookDate: this.updateAddressForm.bookDate,
+                        bookTime: this.updateAddressForm.bookTime,
+                        orderId: this.updateAddressForm.orderId,
+                        servantId: this.updateAddressForm.servantId,
+                        servantName: this.updateAddressForm.servantName,
+                        servantMobile: this.updateAddressForm.servantMobile,
+                        servantFee:this.updateAddressForm.servantFee,
+                        cancelBookOrderDetail: this.updateAddressForm.cancelBookOrderDetail,
+                        expect:this.updateAddressForm.expect
+                    })
+                        .then((response) => {
+                            loading.close();
+                            this.dislogFormVisible = false;
+                            this.$notify.success({
+                                title: "成功",
+                                message: "修改成功,请刷新查看",
+                            });
+                            this.$emit('success',
+                                {
+                                    serviceId: this.updateAddressForm.serviceId,
+                                    orderId: this.updateAddressForm.orderId,
+                                    address: this.updateAddressForm.addressDetail,
+                                    mobile: this.updateAddressForm.mobile,
+                                    consignee: this.updateAddressForm.consignee,
+                                    position: this.updateAddressForm.location.join(','),
+                                    workerId: this.updateAddressForm.servantId,
+                                    workerName: this.updateAddressForm.servantName,
+                                    workerTel: this.updateAddressForm.servantMobile,
+                                    bookTime: this.updateAddressForm.bookDate + " " + this.updateAddressForm.bookTime.split('-')[0],
+                                    bookStartTime: this.updateAddressForm.bookTime.split('-')[0],
+                                    bookEndTime: this.updateAddressForm.bookTime.split('-')[1]
+                                });
+                        })
+                        .catch((response) => {
+                            loading.close();
+                            this.$notify.error({
+                                title: "修改失败",
+                                message: response.data.errmsg,
+                            });
+                        });
+                    // });
+                }
+            });
+        },
+        initMap() {
+            if (this.map) return;
+            let that = this;
+            this.map = new AMap.Map("container", {
+                resizeEnable: true
+            });
+            this.map.setDefaultCursor("pointer");
+            this.map.on('click', function (e) {
+                that.updateAddressForm.location = [];
+                that.updateAddressForm.location.push(e.lnglat.getLng())
+                that.updateAddressForm.location.push(e.lnglat.getLat())
+                console.info(that.updateAddressForm.location)
+                that.makeMarker('');
+            });
+        },
+        getFraWorkers(fraId) {
+            getWorkerByFraId({ fraId: fraId }).then(res => {
+                this.fraWorkers = res.data.data
+            })
+        },
+        getGoodsTimeRange(orderId) {
+            getGoodsTimeRange({ orderId: orderId }).then(res => {
+                this.timerange = res.data.data;
+            })
+        },
+        makeMarker(type) {
+            console.info('makeMarker')
+            if (this.updateAddressForm.location == '' || this.updateAddressForm.location.length == 0) return;
+            if (this.marker == '') {
+                this.marker = new AMap.Marker({
+                    icon: "https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png",
+                    position: this.updateAddressForm.location,
+                    offset: new AMap.Pixel(-15, -15),
+                    map: this.map
+                });
+                this.marker.setLabel({
+                    offset: new AMap.Pixel(0, -10),  //设置文本标注偏移量
+                    content: "<div class='info'>" + this.updateAddressForm.addressDetail + "</div>", //设置文本标注内容
+                    direction: 'right' //设置文本标注方位
+                });
+            }
+            else {
+                this.marker.setMap(this.map);
+                this.marker.setPosition(this.updateAddressForm.location);
+                this.marker.setLabel({
+                    offset: new AMap.Pixel(0, -10),  //设置文本标注偏移量
+                    content: "<div class='info'>" + this.updateAddressForm.addressDetail + "</div>", //设置文本标注内容
+                    direction: 'right' //设置文本标注方位
+                });
+            }
+
+            this.map.setCenter(this.updateAddressForm.location);
+            if (type && type == "init")
+                this.map.setZoom(15);
+        }
+    }
+}
+</script>
+
+<style>
+.marker {
+    position: absolute;
+    top: -20px;
+    right: -118px;
+    color: #fff;
+    padding: 4px 10px;
+    box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
+    white-space: nowrap;
+    font-size: 12px;
+    font-family: "";
+    background-color: #25A5F7;
+    border-radius: 3px;
+}
+
+.dialog-footer {
+    text-align: right;
+}
+
+.amap-icon img,
+.amap-marker-content img {
+    width: 25px;
+    height: 34px;
+}
+
+.marker {
+    position: absolute;
+    top: -20px;
+    right: -118px;
+    color: #fff;
+    padding: 4px 10px;
+    box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
+    white-space: nowrap;
+    font-size: 12px;
+    font-family: "";
+    background-color: #25A5F7;
+    border-radius: 3px;
+}
+
+.el-dialog--center .el-dialog__body {
+    padding-top: 10px;
+    padding-bottom: 5px;
+}
+</style>

+ 453 - 226
src/views/order/components/serviceBookRef.vue

@@ -1,39 +1,39 @@
 <template>
-    <el-dialog title="客户服务预约" :visible.sync="dislogFormVisible" width="900px" :close-on-click-modal="false" center
+    <el-dialog title="修改预约" :visible.sync="dislogFormVisible" width="1350px" :close-on-click-modal="false" center
         :modal="true">
-        <el-form ref="updateAddressForm" :model="updateAddressForm" :rules="updateAddressFormRules" status-icon
-            label-position="center" label-width="100px">
-            <el-row v-if="updateAddressForm.status==8">
-                <el-form-item label="客户意向" prop="expect">
-                    <el-radio-group v-model="updateAddressForm.expect" @change="expectChange">
-                        <el-radio :label="1">预约</el-radio>
-                        <el-radio :label="2">有预期</el-radio>
-                        <el-radio :label="3">暂不预约</el-radio>
-                    </el-radio-group>
-                </el-form-item>
-            </el-row>
-            <el-row>
-                <el-col :span="12">
-                    <el-form-item label="预约联系人" prop="consignee">
-                        <el-input v-model="updateAddressForm.consignee" clearable placeholder="请输入预约联系人" />
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="预约电话" prop="mobile">
-                        <el-input v-model="updateAddressForm.mobile" clearable placeholder="请输入预约联系人的电话" />
-                    </el-form-item>
-                </el-col>
-            </el-row>
-            <el-row>
-                <el-col :span="12">
-                    <el-form-item label="服务地址" prop="addressDetail">
-                        <el-input v-model="updateAddressForm.addressDetail" placeholder="请输入客户详细服务地址">
-                            <i slot="suffix" class="el-icon-location" style="font-size:25px;cursor: pointer;margin-top:6px"
-                                @click="btnSearchClick"></i></el-input>
-                        <!-- <el-button type="primary" size="mini" @click=" btnSearchClick ">查询地址</el-button> -->
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12" style="display: flex;">
+        <div style="width:1310px;height:680px;">
+            <div style="width:600px;border-right: 2px solid #f4f4f5;float:left;">
+                <el-row class="titlename">
+                    <h3>客户信息</h3>
+                </el-row>
+
+                <el-form ref="updateAddressForm" :model="updateAddressForm" :rules="updateAddressFormRules" status-icon
+                    label-position="center" label-width="100px">
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="预约联系人" prop="bookName">
+                                <el-input v-model="updateAddressForm.bookName" clearable placeholder="请输入预约联系人" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="预约电话" prop="bookTel">
+                                <el-input v-model="updateAddressForm.bookTel" clearable placeholder="请输入预约联系人的电话" />
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-form-item label="服务地址" prop="bookAddress">
+                            <el-input style="width:420px;" v-model="updateAddressForm.bookAddress"
+                                placeholder="请输入客户详细服务地址">
+                                <i slot="suffix" class="el-icon-location"
+                                    style="font-size:25px;cursor: pointer;margin-top:6px"
+                                    @click="btnSearchClick"></i></el-input>
+                            <div style="color:red;font-size: 12px;position: absolute;">
+                                客户信息修改后,请点击保存(地址输入后,需点击后面小图标定位后再保存)</div>
+                            <el-button type="primary" size="mini" @click="submit">保存</el-button>
+                        </el-form-item>
+
+                        <!-- <el-col :span="12" style="display: flex;">
                     <el-form-item label="服务日期" prop="bookDate" style="margin-bottom: 2px">
                         <el-date-picker v-model="updateAddressForm.bookDate" :disabled="updateAddressForm.expect == 3" type="date" placeholder="请选择服务日期"
                             style="width: 180px" value-format="yyyy-MM-dd" />
@@ -42,31 +42,97 @@
                             <el-option v-for="item in  timerange" :key="item" :label="item" :value="item" />
                         </el-select>
                     </el-form-item>
-                </el-col>
-            </el-row>
-            <el-row>
-                <el-col :span="12">
-                    <el-form-item label="服务人员" prop="servantId">
-                        <el-select v-model="updateAddressForm.servantId" :disabled="updateAddressForm.expect != 1" clearable class="filter-item" style="width:100%"
-                            placeholder="服务人员" filterable>
-                            <el-option v-for="item in  fraWorkers " :key="item.id"  :label="item.name+'('+item.tel+')'"  :value="item.id" />
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="7">
-                    <el-form-item label="计提金额" prop="servantFee">
-                        <el-input v-model="updateAddressForm.servantFee" type="number" :disabled="updateAddressForm.expect != 1" placeholder="服务者的计提" />
-                    </el-form-item>
-                </el-col>
-                <el-col :span="5" style="text-align: right;">
-                    <el-button @click="dislogFormVisible = false">取消</el-button>
-                    <el-button type="success" @click="submit">保存</el-button>
-                </el-col>
-            </el-row>
+                </el-col> -->
+                    </el-row>
 
-        </el-form>
-        <div id="container" style=" height: 450px; width: 100%;"></div>
+                </el-form>
+                <div id="container" style=" margin-top:20px;height: 450px; width: 100%;"></div>
+            </div>
 
+            <div style="width:700px;float:right;">
+                <el-row class="titlename">
+                    <h3>服务信息(工单编号:{{updateAddressForm.detailId}})</h3>
+                </el-row>
+                <el-row><span class="servicename">商品名称:</span>{{ bookservantInfo.productName }}</el-row>
+                <el-row><span class="servicename">服务人数:</span>{{ bookservantInfo.assignedWorkerTotal }}/{{
+        bookservantInfo.workerTotal }} &nbsp;&nbsp;&nbsp; {{ bookservantInfo.skillMsg }}</el-row>
+                <el-row><span class="servicename">客户预约时间:</span>{{ bookservantInfo.bookTime }}</el-row>
+                <div :style="bookservantInfo.workers.length > 2 ? 'overflow-y:scroll;height: 500px;' : ''">
+                    <el-row v-for="(bk, index) in bookservantInfo.workers" :key="index">
+                        <hr />
+                        <div style="width:400px;font-size: 20px;font-weight: bold;margin-top:20px;margin-bottom: 10px;">
+                            服务者{{ index + 1 }} ({{ bk.skillName }},{{ bk.serviceLength }}小时,{{
+        bk.sort != null && bk.sort > 0 ? '有序' : '无序' }})
+                        </div>
+                        <div>
+                            <el-form labelPosition="right" label-width="90px">
+                                <el-row>
+                                    <el-col :span="9">
+                                        <el-form-item label="人员类型">
+                                            <el-select v-model="bk.type" class="filter-item" placeholder="人员类型"
+                                                filterable @change="selectWorkerType(bk, index)">
+                                                <el-option v-for="item in  servantType " :key="item.type"
+                                                    :label="item.name" :value="item.type" />
+                                            </el-select>
+                                        </el-form-item>
+                                    </el-col>
+                                    <el-col :span="15">
+                                        <el-form-item label="服务人员">
+                                            <el-select v-if="bk.type == null || bk.type == 1" v-model="bk.workerId"
+                                                @change="changeTempWorker(bk, index)" clearable class="filter-item"
+                                                style="width:100%" placeholder="服务人员" filterable>
+                                                <el-option v-for="item in  fraWorkers " :key="item.id"
+                                                    :label="item.name + '(' + item.tel + ')'" :value="item.id + ''" />
+                                            </el-select>
+                                            <template v-else>
+                                                <el-input disabled style="width:220px;" v-model="bk.workerName"
+                                                    clearable />
+                                                <span @click="showFullBook(index,bk.workerSkillId)"
+                                                    style="color:deepskyblue;cursor:pointer;">改派全职</span>
+                                                <span @click="changeFUllWorker(bk)" v-if="bk.workerName != ''"
+                                                    style="color:deepskyblue;cursor:pointer;">清除</span>
+                                            </template>
+                                        </el-form-item>
+                                    </el-col>
+                                    <el-col :span="9">
+                                        <el-form-item label="服务技能">
+                                            <el-select v-model="bk.workerSkillId" class="filter-item" disabled
+                                                style="width:100%" placeholder="服务技能">
+                                                <el-option v-for="item in  bookservantInfo.skillWorkerTotalList "
+                                                    :key="item.id" :label="item.skillName" :value="item.skillId" />
+                                            </el-select>
+                                        </el-form-item>
+                                    </el-col>
+                                    <el-col :span="15">
+                                        <el-form-item label="服务日期" style="margin-bottom: 2px">
+                                            <el-date-picker v-model="bk.bookDate" type="date"
+                                                :disabled="bk.type != null && bk.type == 0" placeholder="请选择服务日期"
+                                                style="width: 160px" value-format="yyyy-MM-dd" popper-class='noClear' />
+                                            <el-select v-model="bk.timested" style="width: 140px"  @change="setTimeStEd(bk)"
+                                                :disabled="bk.type != null && bk.type == 0" class="filter-item"
+                                                placeholder="服务时间段">
+                                                <el-option v-for="item in  getskillTimeRange(bk.serviceLength)"
+                                                    :key="item" :label="item" :value="item" />
+                                            </el-select>
+                                        </el-form-item>
+                                    </el-col>
+
+                                </el-row>
+                            </el-form>
+                        </div>
+
+                    </el-row>
+                </div>
+                <el-row style="color:red;font-size:12px;">*多人服务时,日期不可跨天,相同技能服务时间需一致</el-row>
+            </div>
+
+        </div>
+
+        <div style="text-align:right;margin-top:10px;height:60px;">
+            <el-button type="info" plain @click="dislogFormVisible = false">取消</el-button>
+            <el-button type="primary" @click="updateWorker">提交</el-button>
+        </div>
+        <reassignOrder ref="reassignOrderRef" />
     </el-dialog>
 </template>
 
@@ -74,123 +140,78 @@
 <script>
 import moment from "moment";
 import { updateOrderAddressV2, getGoodsTimeRange, getWorkerByFraId } from "@/api/order";
+import { getDetailWorker, modifyBookAddress, changeWorker } from "@/api/orderBookDetail";
 import { getLngLat } from "@/api/address"
+import { enableConsult } from '@/api/ticketConsult';
+import reassignOrder from "@/views/order/components/reassignOrder";
 export default {
     name: 'serviceBookRef',
+    components: { reassignOrder },
     data() {
-        var validBookDate = (rule, value, callback) => {
-            if (this.updateAddressForm.expect == 3) {
-                callback();
-            } else {
-                if (this.updateAddressForm.bookDate == null || this.updateAddressForm.bookTime == null)
-                    callback(new Error("请选择日期"));
-                else 
-                callback();
-            }
-        };
+
         return {
-            servantList: [],
-            timerange: [],
+            failworker: '',
+            tempRow: { id: '', orderId: '', fraId: '' },//工单id,订单id,加盟商id
+            tempIndex: '',//选全职时标记行
+            servantType: [{ type: 0, name: '全职' }, { type: 1, name: '兼职' }],
+            bookservantInfo: {
+                skillWorkerTotalList: [],//技能对应人数
+                workers: []
+            },
+            skillTimerange: [],
             dislogFormVisible: false,
             map: "",
             marker: '',
             fraWorkers: [],//加盟商的兼职阿姨
-            updateAddressForm: {
-                consignee: '',
-                mobile: '',
-                addressDetail: '',
-                cancelBookOrderDetail: 0,
-                location: '',//经纬度
+            updateAddressForm: {//客户信息
+                detailId: '',
                 orderId: '',
+                fraId: '',
+                bookName: '',
+                bookTel: '',
+                bookAddress: '',
+                lat: '',
+                lng: '',
             },
             updateAddressFormRules: {
-                bookTime: [{ validator:validBookDate,required: true, message: "请选择服务时间", trigger: "blur" },],
-                bookDate: [{ validator:validBookDate,required: true, message: "请选择服务日期", trigger: "blur" },],
-                consignee: [
+
+                bookName: [
                     { required: true, message: "请输入客户名称", trigger: "blur" },
                 ],
-                mobile: [
+                bookTel: [
                     { required: true, message: "请输入客户电话", trigger: "blur" },
                 ],
-                area: [{ required: true, message: "请选择省市区", trigger: "change" }],
-                addressDetail: [
+
+                bookAddress: [
                     { required: true, message: "请输入客户地址", trigger: "blur" },
                 ],
-                cancelBookOrderDetail: [
-                    {
-                        required: true,
-                        message: "是否取消已预约未服务工单",
-                        trigger: "blur",
-                    },
-                ]
             }
         }
     },
     mounted() {
     },
     methods: {
-        expectChange() {
-            if (this.updateAddressForm.expect == 3) {
-                this.updateAddressForm.bookDate = null;
-                this.updateAddressForm.bookTime = null;
-                this.updateAddressForm.servantId = null;
-                this.updateAddressForm.servantFee = null;
-            }
-            if (this.updateAddressForm.expect == 2) {
-                this.updateAddressForm.servantId = null;
-                this.updateAddressForm.servantFee = null;
-            }
-
-        },
-        btnSearchClick() {
-            if (!this.updateAddressForm.addressDetail || this.updateAddressForm.addressDetail == '' || this.updateAddressForm.addressDetail.length < 12) {
-                this.$notify.warning({
-                    title: "提醒",
-                    message: "请输入客户详细地址",
-                });
-                return;
-            }
-            getLngLat({ address: this.updateAddressForm.addressDetail }).then(res => {
-                this.updateAddressForm.location = res.data.data;
-                this.makeMarker();
-            }).catch(response => {
-          this.$notify.error({
-            title: '失败',
-            message: response.data.errmsg
-          })
-        })
-        },
         init(data) {
-            this.dislogFormVisible = true;
-            let location = [];
-            if (data.lng) {
-                location.push(data.lng);
-                location.push(data.lat);
-            }
-            // console.info(location)
+            console.info(data)
 
-            this.getGoodsTimeRange(data.orderId);
-            this.getFraWorkers(data.fraId);
+            this.dislogFormVisible = true;
+            this.tempRow = data;
             this.updateAddressForm = {
-                mobile: data.mobile,
-                consignee: data.consignee,
-                addressDetail: data.address,
-                cancelBookOrderDetail: 0,
-                location: location,
+                detailId: data.id,
                 orderId: data.orderId,
-                bookDate: data.bookDate,
-                bookTime: (data.bookStartTime ? (data.bookStartTime + '-' + data.bookEndTime) : ''),
-                serviceId: data.id,
-                servantId: data.servantId?parseInt(data.servantId):'',
-                servantName: data.servantName,
-                servantMobile: data.servantMobile,
-                servantFee:data.servantFee,
-                orderChannel:data.orderChannel,
-                status:data.status,
-                expect:1
+                fraId: data.fraId,
+                bookName: '',
+                bookTel: '',
+                bookAddress: '',
+                lat: '',
+                lng: '',
             }
 
-            // console.info(this.updateAddressForm)
+
+            this.getbookServantInfo();//工单上服务人员信息
+            this.getGoodsTimeRange();
+            this.getFraWorkers();//兼职人员
+
             if (this.marker != '')
                 this.marker.setMap(null);
             setTimeout(() => {
@@ -198,17 +219,212 @@ export default {
                 this.makeMarker('init');
             }, 1000);
         },
-        submit() {
-            //预约时间是否小于今天
-            let now = moment(new Date()).format("YYYY-MM-DD");
-            if (this.updateAddressForm.bookDate < now) {
-                this.$notify.warning({
-                    title: "提醒",
-                    message: "预约时间不能小于当天",
+        showFullBook(index,skillId) {
+            //标记被选的行
+            this.tempIndex = index;
+            console.log(this.tempIndex);
+            this.$refs.reassignOrderRef.initDrawer(this.tempRow.id, this.bookservantInfo.skillWorkerTotalList,skillId,this.bookservantInfo.workers,index);
+        },
+        settingFullWorker(resWorker) {
+            //接收全职人员的信息
+            //         let resWorker={
+            //       type:0,
+            //       workerId:this.reassignForm.servantId,
+            //       workerName:this.reassignForm.workerName,
+            //       scheduleId:this.reassignForm.scheduleId,
+            //       workerSkillId:this.tempSkillId,
+            //       skillName:skillName,
+            //       bookDate :this.reassignForm.bookDate,
+            //       bookStartTime :this.reassignForm.startTime,
+            //       bookEndTime : this.reassignForm.endTime
+            //   };
+            let tempworker = this.bookservantInfo.workers[this.tempIndex];
+            tempworker.type = 0;
+            tempworker.workerId = resWorker.workerId;
+            tempworker.workerName = resWorker.workerName;
+            tempworker.scheduleId = resWorker.scheduleId;
+            tempworker.workerSkillId = resWorker.workerSkillId;
+            tempworker.skillName = resWorker.skillName;
+            tempworker.bookDate = resWorker.bookDate;
+            tempworker.timested = resWorker.bookStartTime + '-' + resWorker.bookEndTime;
+            tempworker.bookStartTime=resWorker.bookStartTime;
+            tempworker.bookEndTime=resWorker.bookEndTime;
+
+            this.bookservantInfo.workers[this.tempIndex] = tempworker;
+            console.log(this.bookservantInfo.workers[this.tempIndex]);
+        },
+        updateWorker() {
+            let worker = this.validChooseWorker();
+            if (this.failworker != '') {
+                this.$message({
+                    type: "warning",
+                    message: this.failworker
                 });
                 return;
             }
-            if(this.updateAddressForm.location.length<2){
+            const loading = this.$loading({
+                lock: true,
+                text: "提交中...",
+                spinner: "el-icon-loading",
+                background: "rgba(0, 0, 0, 0.5)",
+            });
+            let req = {
+                detailId: this.updateAddressForm.detailId,
+                fraId: this.updateAddressForm.fraId,
+                // bookDate: worker.length == 0 ? this.bookservantInfo.bookDate : worker[0].bookDate,
+                // bookStartTime: worker.length == 0 ? this.bookservantInfo.bookStartTime : worker[0].timested.split('-')[0],
+                // bookEndTime: worker.length == 0 ? this.bookservantInfo.bookEndTime : worker[0].timested.split('-')[1],
+                workerInfoList: worker.length == 0 ? this.bookservantInfo.workers2 : worker
+            }
+            changeWorker(req).then(res => {
+                loading.close();
+                this.dislogFormVisible = false;
+                this.$notify.success({
+                    title: "成功",
+                    message: "修改成功",
+                });
+                this.$parent.getList();
+            }).catch(response => {
+                loading.close();
+                this.$notify.error({
+                    title: "失败",
+                    message: response.data.errmsg,
+                });
+            })
+
+        },
+        validChooseWorker() {
+            //如果条件任意一个没选,丢弃结果
+            //校验预约时间不能小于当天,且预约日期要统一
+            console.log(this.bookservantInfo.workers);
+            let validWorker = [];
+            let failworker = '';
+            let ss=this.bookservantInfo.workers.filter(e=>{
+                return e.bookDate!=null&&e.bookDate!=''&&e.bookStartTime!=null&&e.bookStartTime!='';
+            })
+            if(ss==null||ss.length==0){
+                 failworker = "至少选择一个预约日期;";
+                 return [];
+            }
+            this.bookservantInfo.workers.forEach(e => {
+                
+                if (e.workerId != null && e.workerId != '' && e.workerName != null && e.workerName != '' &&
+                    (e.type == null || e.workerSkillId == null || e.workerSkillId == '' || e.workerName == null || e.workerName == ''
+                    )
+                ) {
+                    failworker =  failworker + e.workerName + " 服务技能或人员类型未选;"
+                }
+
+                if(e.bookDate!=null&&e.bookDate!=''&&e.bookStartTime!=null&&e.bookStartTime!=''){
+                    validWorker.push(e);
+                }
+                // if (e.type != null && e.workerSkillId != null && e.workerSkillId != ''
+                //     && e.workerId != null && e.workerId != '' && e.workerName != null && e.workerName != ''
+                // ) {
+                //     validWorker.push(e);
+                //     // if (e.type == 0 && e.scheduleId != null && e.scheduleId != '') {
+                //     // } else {
+                //     //     validWorker.push(e);
+                //     // }
+                // }
+            })
+            this.failworker = failworker;
+            if (validWorker.length > 1) {
+                //同技能时,校验相同日期时间要一致
+                for (var i = 0; i < validWorker.length; i++) {
+                    let tm = validWorker[i].bookDate + validWorker[i].timested;
+                    let wk = validWorker[i].workerId;
+                    for (var k = 0; k < validWorker.length; k++) {
+                        let tm2 = validWorker[k].bookDate + validWorker[k].timested;
+                        let wk2 = validWorker[k].workerId;
+                        if (validWorker[i].bookDate != validWorker[k].bookDate) {
+                            this.failworker = this.failworker + '多人服务时,日期不可跨天;';
+                            return [];
+                        }
+                        if (validWorker[i].workerSkillId == validWorker[k].workerSkillId && tm != tm2) {
+                            this.failworker = this.failworker + '相同技能,服务时间必须一致;';
+                            return [];
+                        }
+                        // if (wk == wk2 && i != k) {
+                        //     this.$message({
+                        //         type: "warning",
+                        //         message: "多人服务时,人员不能重复"
+                        //     });
+                        //     return;
+                        // }
+                    }
+                }
+            }
+
+            validWorker.forEach(v => {
+                this.fraWorkers.forEach(e => {
+                    if (v.type == 1 && v.workerId == e.id) {
+                        v.workerName = e.name;
+                        v.workerTel = e.tel;
+                    }
+                })
+            })
+
+            return validWorker;
+        },
+        selectWorkerType(row, index) {
+            let tempWorker = this.bookservantInfo.workers[index];
+            //切换全职兼职类型,清空 技能,档期,人员姓名,人员id
+            if (row.type == 1) {
+                //变成了兼职
+                tempWorker.workerId = '';
+                tempWorker.workerName = '';
+                tempWorker.workerTel = '';
+                tempWorker.scheduleId = '';
+            } else {
+                tempWorker.workerId = '';
+                tempWorker.workerName = '';
+            }
+        },
+        changeFUllWorker(row) {
+            row.workerId = '';
+            row.workerName = '';
+            row.workerTel = '';
+            row.scheduleId = '';
+        },
+        changeTempWorker(row, index) {
+            if (row.workerId == null || row.workerId == '') {
+                row.workerName = null;
+                return;
+            }
+            //选兼职时,填充人员
+            this.fraWorkers.forEach(e => {
+                if (row.workerId == e.id) {
+                    row.workerName = e.name;
+                }
+            })
+        },
+
+        getbookServantInfo() {
+            getDetailWorker({ detailId: this.updateAddressForm.detailId }).then(res => {
+                if (res.data.errno == 0) {
+                    let tempData = res.data.data;
+                    tempData.workers2 = tempData.workers;//构造未修改信息
+
+                    this.updateAddressForm.bookName = tempData.bookName;
+                    this.updateAddressForm.bookTel = tempData.bookTel;
+                    this.updateAddressForm.bookAddress = tempData.bookAddress;
+                    this.updateAddressForm.lat = tempData.lat;
+                    this.updateAddressForm.lng = tempData.lng;
+
+
+                    res.data.data.workers.forEach(p => {
+                        if (p.bookStartTime != null && p.bookStartTime != '' && p.bookStartTime != 'null') {
+                            p.timested = p.bookStartTime + '-' + p.bookEndTime;
+                        }
+                    })
+                    this.bookservantInfo = tempData;
+                    console.log(this.bookservantInfo);
+                }
+            })
+        },
+        submit() {
+            if (this.updateAddressForm.lng == null || this.updateAddressForm.lat == '') {
                 this.$notify.warning({
                     title: "提醒",
                     message: "请点击地址框后的图标 定位客户地址",
@@ -225,66 +441,24 @@ export default {
                         spinner: "el-icon-loading",
                         background: "rgba(0, 0, 0, 0.5)",
                     });
-                    console.info(this.updateAddressForm.location)
-                    if (this.updateAddressForm.servantId) {
-                        let servnats = this.fraWorkers.filter(item => { return item.id == this.updateAddressForm.servantId });
-                        if (servnats.length > 0) {
-                            this.updateAddressForm.servantName = servnats[0].name;
-                            this.updateAddressForm.servantMobile = servnats[0].tel;
-                        }
-
-                    }
-                    updateOrderAddressV2({
-                        addressDto: {
-                            addressDetail: this.updateAddressForm.addressDetail,
-                            name: this.updateAddressForm.consignee,
-                            tel: this.updateAddressForm.mobile,
-                            lng: this.updateAddressForm.location[0],
-                            lat: this.updateAddressForm.location[1],
-                        },
-                        serviceId: this.updateAddressForm.serviceId,
-                        bookDate: this.updateAddressForm.bookDate,
-                        bookTime: this.updateAddressForm.bookTime,
-                        orderId: this.updateAddressForm.orderId,
-                        servantId: this.updateAddressForm.servantId,
-                        servantName: this.updateAddressForm.servantName,
-                        servantMobile: this.updateAddressForm.servantMobile,
-                        servantFee:this.updateAddressForm.servantFee,
-                        cancelBookOrderDetail: this.updateAddressForm.cancelBookOrderDetail,
-                        expect:this.updateAddressForm.expect
-                    })
-                        .then((response) => {
-                            loading.close();
-                            this.dislogFormVisible = false;
-                            this.$notify.success({
-                                title: "成功",
-                                message: "修改成功,请刷新查看",
-                            });
-                            this.$emit('success',
-                                {
-                                    serviceId: this.updateAddressForm.serviceId,
-                                    orderId: this.updateAddressForm.orderId,
-                                    address: this.updateAddressForm.addressDetail,
-                                    mobile: this.updateAddressForm.mobile,
-                                    consignee: this.updateAddressForm.consignee,
-                                    position: this.updateAddressForm.location.join(','),
-                                    workerId: this.updateAddressForm.servantId,
-                                    workerName: this.updateAddressForm.servantName,
-                                    workerTel: this.updateAddressForm.servantMobile,
-                                    bookTime: this.updateAddressForm.bookDate + " " + this.updateAddressForm.bookTime.split('-')[0],
-                                    bookStartTime: this.updateAddressForm.bookTime.split('-')[0],
-                                    bookEndTime: this.updateAddressForm.bookTime.split('-')[1]
-                                });
-                        })
-                        .catch((response) => {
-                            loading.close();
-                            this.$notify.error({
-                                title: "修改失败",
-                                message: response.data.errmsg,
-                            });
+                    modifyBookAddress(this.updateAddressForm).then((response) => {
+                        loading.close();
+                        this.dislogFormVisible = false;
+                        this.getbookServantInfo();
+                        this.$notify.success({
+                            title: "成功",
+                            message: "修改成功",
                         });
-                    // });
+                        this.$parent.getList();
+                    }).catch(response => {
+                        loading.close();
+                        this.$notify.error({
+                            title: "失败",
+                            message: response.data.errmsg,
+                        });
+                    })
                 }
+
             });
         },
         initMap() {
@@ -295,53 +469,87 @@ export default {
             });
             this.map.setDefaultCursor("pointer");
             this.map.on('click', function (e) {
-                that.updateAddressForm.location = [];
-                that.updateAddressForm.location.push(e.lnglat.getLng())
-                that.updateAddressForm.location.push(e.lnglat.getLat())
-                console.info(that.updateAddressForm.location)
+
+                that.updateAddressForm.lng = e.lnglat.getLng();
+                that.updateAddressForm.lat = e.lnglat.getLat();
                 that.makeMarker('');
             });
         },
-        getFraWorkers(fraId) {
-            getWorkerByFraId({ fraId: fraId }).then(res => {
+        getFraWorkers() {
+            getWorkerByFraId({ fraId: this.updateAddressForm.fraId }).then(res => {
                 this.fraWorkers = res.data.data
             })
         },
-        getGoodsTimeRange(orderId) {
-            getGoodsTimeRange({ orderId: orderId }).then(res => {
-                this.timerange = res.data.data;
+        getGoodsTimeRange() {
+            getGoodsTimeRange({ orderId: this.updateAddressForm.orderId }).then(res => {
+                this.skillTimerange = res.data.data;
             })
         },
+        setTimeStEd(row){ 
+            row.bookStartTime=row.timested.split('-')[0];
+            row.bookEndTime=row.timested.split('-')[1];
+            console.log(row);
+        },
+        getskillTimeRange(serviceLength) {
+            let arr = [];
+            this.skillTimerange.forEach(e => {
+                if (e.serviceLength == serviceLength) {
+                    arr = e.timeRange;
+                }
+            })
+            return arr;
+        },
         makeMarker(type) {
             console.info('makeMarker')
-            if (this.updateAddressForm.location == '' || this.updateAddressForm.location.length == 0) return;
+            if (this.updateAddressForm.lng == '' || this.updateAddressForm.lng == null) return;
             if (this.marker == '') {
                 this.marker = new AMap.Marker({
                     icon: "https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png",
-                    position: this.updateAddressForm.location,
+                    position: [this.updateAddressForm.lat, this.updateAddressForm.lng],
                     offset: new AMap.Pixel(-15, -15),
                     map: this.map
                 });
                 this.marker.setLabel({
                     offset: new AMap.Pixel(0, -10),  //设置文本标注偏移量
-                    content: "<div class='info'>" + this.updateAddressForm.addressDetail + "</div>", //设置文本标注内容
+                    content: "<div class='info'>" + this.updateAddressForm.bookAddress + "</div>", //设置文本标注内容
                     direction: 'right' //设置文本标注方位
                 });
             }
             else {
                 this.marker.setMap(this.map);
-                this.marker.setPosition(this.updateAddressForm.location);
+                this.marker.setPosition([this.updateAddressForm.lng, this.updateAddressForm.lat]);
                 this.marker.setLabel({
                     offset: new AMap.Pixel(0, -10),  //设置文本标注偏移量
-                    content: "<div class='info'>" + this.updateAddressForm.addressDetail + "</div>", //设置文本标注内容
+                    content: "<div class='info'>" + this.updateAddressForm.bookAddress + "</div>", //设置文本标注内容
                     direction: 'right' //设置文本标注方位
                 });
             }
 
-            this.map.setCenter(this.updateAddressForm.location);
+            this.map.setCenter([this.updateAddressForm.lng, this.updateAddressForm.lat]);
             if (type && type == "init")
                 this.map.setZoom(15);
-        }
+        },
+        btnSearchClick() {
+            if (!this.updateAddressForm.bookAddress || this.updateAddressForm.bookAddress == '' || this.updateAddressForm.bookAddress.length < 12) {
+                this.$notify.warning({
+                    title: "提醒",
+                    message: "请输入客户详细地址",
+                });
+                return;
+            }
+            getLngLat({ address: this.updateAddressForm.bookAddress }).then(res => {
+                if (res.data.errno == 0 && res.data.data.length == 2) {
+                    this.updateAddressForm.lng = res.data.data[0];
+                    this.updateAddressForm.lat = res.data.data[1];
+                    this.makeMarker();
+                }
+            }).catch(response => {
+                this.$notify.error({
+                    title: '失败',
+                    message: response.data.errmsg
+                })
+            })
+        },
     }
 }
 </script>
@@ -389,4 +597,23 @@ export default {
     padding-top: 10px;
     padding-bottom: 5px;
 }
+
+.titlename {
+    background-color: #f4f4f5;
+    margin-bottom: 10px;
+    text-indent: 20px;
+}
+
+.servicename {
+    font-size: 15px;
+    font-weight: bold;
+    line-height: 30px;
+    margin-left: 20px;
+}
+
+/* 隐藏清空按钮 */
+.el-date-editor .el-range-separator+.el-input__suffix .el-input__suffix-inner,
+.el-date-editor .el-input__suffix .el-input__suffix-inner {
+    display: none !important;
+}
 </style>

+ 85 - 37
src/views/order/order.vue

@@ -13,6 +13,9 @@
         placeholder="请选择订单状态">
         <el-option v-for="(key, value) in statusMap" :key="key" :label="key" :value="value" />
       </el-select>
+      <el-select  v-model="listQuery.bookStatus" style="width:180px" class="filter-item" placeholder="请选择预约状态" clearable>
+        <el-option v-for="(key, value) in bookStatusMap" :key="key" :label="key" :value="value" />
+      </el-select>
 
       <el-select v-model="listQuery.orderType" style="width: 120px" class="filter-item" placeholder="订单类型">
         <el-option v-for="(key, value) in orderTypeMap" :key="key" :label="key" :value="value" />
@@ -22,10 +25,13 @@
         <el-option v-for="item in city" :key="item.id" :label="item.cityName" :value="item.id" />
       </el-select>
 
-      <el-select v-model="listQuery.orderChannel" style="width: 160px" class="filter-item" placeholder="请选择渠道" clearable
+      <el-select v-model="listQuery.orderChannel" 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-select v-model="listQuery.couponChannel" style="width: 160px" class="filter-item" placeholder="优惠券渠道" clearable>
+        <el-option v-for="item in channels" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
 
       <el-select v-model="listQuery.isHandle" style="width: 130px" class="filter-item" placeholder="请选择处理状态" clearable>
         <el-option label="未处理" value="0" />
@@ -43,6 +49,7 @@
         <el-option v-for="item in fras" :key="item.id" :label="item.fraName" :value="item.id" />
       </el-select>
 
+
       <el-button v-permission="['GET /admin/order/list']" class="filter-item" type="primary" icon="el-icon-search"
         @click="handleFilter">查找
       </el-button>
@@ -71,7 +78,7 @@
             <el-tabs type="card" v-model="scope.row.activeName" @tab-click="handleTabClick($event, scope.row)">
               <el-tab-pane label="预约单" name="book">
                 <!-- 客户预约信息 -->
-                <el-table :data="scope.row.bookDetailList" style="width:1200px;max-height: 400px;overflow-y: auto"
+                <el-table :data="scope.row.bookDetailList" style="width:1300px;max-height: 400px;overflow-y: auto"
                   border fit highlight-current-row :row-class-name="tableRowClassName">
                   <el-table-column align="center" label="工单id" prop="id" />
                   <el-table-column align="center" label="加盟商" width="150" prop="fraName">
@@ -84,15 +91,23 @@
                   <!-- <el-table-column align="center" label="加盟商电话" width="120" prop="fraTel" />  -->
                   <el-table-column align="center" label="上门时段" prop="bookTime" width="180" />
                   <!-- <el-table-column align="center" label="加盟商企微" width="120" prop="fraWxAccount" /> -->
-                  <el-table-column align="center" label="服务者姓名" prop="servantName">
+                  <!-- <el-table-column align="center" label="服务者姓名" prop="servantName">
                     <template slot-scope="scope1">
                       {{ scope1.row.servantName }}{{
         scope1.row.servantName ? (scope1.row.servantType == 0 ? '(全职)' :
           '(兼职)') : ''
       }}
                     </template>
+                  </el-table-column> -->
+                  <el-table-column align="center" label="服务者信息"   width="200px">
+                    <template slot-scope="scope">
+                      <div style="text-align: left;">
+                          <template v-for="(item, idx) in scope.row.workerInfoList">
+                            <span :key="idx" style="font-weight: 600;">人员信息{{idx+1}}:</span>{{ item.workerName }}({{ item.servantType }}){{ item.workerTel }}<br />
+                          </template>
+                      </div>
+                    </template>
                   </el-table-column>
-                  <el-table-column align="center" label="服务者手机号" prop="servantMobile" />
                   <el-table-column align="center" label="服务单状态" prop="status" width="115">
                     <template slot-scope="scope1">
                       {{ bookStatusMap[scope1.row.status] }}
@@ -102,7 +117,7 @@
                   <el-table-column align="center" label="操作人" prop="updateUserName" />
                   <el-table-column align="center" label="操作" width="280">
                     <template slot-scope="scope1">
-                      <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" plain size="mini"
+                      <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" plain size="mini"
                         @click="handleReassign(scope1.row, scope.$index)"
                         v-if="(scope1.row.status == 1 || scope1.row.status == 0 || scope1.row.status == 7) && scope.row.orderChannel !== 104">
                         {{
@@ -186,6 +201,9 @@
       }}
               </el-tag>
               <br />
+              <span style="font-weight: 600;">优惠券渠道:</span>
+              <span>{{ scope.row.couponChannel |  channelsFilter  }}  </span>
+              <br />
               <span style="font-weight: 600;">下单时间:</span> {{ scope.row.createTime }}<br />
               <span style="font-weight: 600;">支付时间:</span> {{ scope.row.payTime }}<br />
               <span style="font-weight: 600;">订单类型:</span>
@@ -359,7 +377,7 @@
               @click="handleBook(scope.row)">服务详情
             </el-button>
             <el-button v-permission="['POST /admin/order/applyRefund']" style="color:red"
-              v-show="scope.row.orderStatus == 201 && scope.row.aftersaleStatus == 0 && scope.row.orderType == 0 && (scope.row.orderChannel == 26 || scope.row.orderChannel == 107 || scope.row.orderChannel == 110)"
+              v-show="scope.row.orderStatus == 201 && scope.row.aftersaleStatus == 0 && scope.row.orderType == 0 && (scope.row.orderChannel == 26 || scope.row.orderChannel == 107 || scope.row.orderChannel == 110||scope.row.orderChannel == 5||scope.row.orderChannel == 112)"
               type="text" icon="el-icon-edit-outline" size="mini" @click="handleApplyRefund(scope.row)">申请退款
             </el-button>
             <el-button v-permission="['GET /admin/order/cancelOrde']" style="color:red" icon="el-icon-stopwatch"
@@ -384,7 +402,7 @@
             </el-button>
 
             <el-button type="text" icon="el-icon-close" size="mini"
-              v-show="scope.row.orderStatus == 201 && (scope.row.orderType == 1 || scope.row.orderChannel == 38)"
+              v-show="scope.row.orderStatus == 201 && (scope.row.orderType == 1 || scope.row.orderChannel == 38|| scope.row.orderChannel == 113)"
               style="color:red" v-permission="['POST /admin/order/cancelOrder']"
               @click="handleCancelOrder(scope.row)">取消/作废订单
             </el-button>
@@ -584,7 +602,9 @@
               <!-- <el-input v-model="orderInputForm.goodsId" /> -->
               <el-select v-model="orderInputForm.goodsId" style="width:100%" placeholder="请选择" filterable
                 @change="goodsIdChange">
-                <el-option v-for="item in goodsList" :key="item.id" :label="item.name" :value="item.id" />
+                <template v-for="item in goodsList" >
+                <el-option  :key="item.id" v-if="item.deleted==false&&item.isOnSale==true" :label="item.name" :value="item.id" />
+              </template>
               </el-select>
             </el-form-item>
           </el-col>
@@ -945,21 +965,38 @@
       </div>
     </el-dialog>
 
-    <reassignOrder ref="reassignOrderRef" />
+<!--众安订单取消选择原因    -->
+    <el-dialog :visible.sync="cancelZhongAnOrderVisable" title="众安订单取消" width="300px">
+      <el-select value="cancelReason" v-model="cancelReason" placeholder="请选择取消原因" style="width:100%">
+        <el-option
+          v-for="item in zhonganCancelOption"
+          :key="item.value"
+          :label="item.label"
+          :value="item.label">
+        </el-option>
+      </el-select>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelZhongAnOrderVisable = false">取消</el-button>
+        <el-button type="primary" @click="confirmCancelZhongAnOrder">确定</el-button>
+      </div>
+    </el-dialog>
+ 
     <addressSelectRef ref="addressSelectRef" />
-
     <!-- 订单详情对话框 -->
     <orderInfoRef ref="orderInfoRef" />
 
+    <serviceBookRef ref="serviceBookRef" />
+
   </div>
 </template>
 
 <script>
 // import areaJson from "../../areaJson";
-import { regionData } from "element-china-area-data";
+import {regionData} from "element-china-area-data";
 import {
   addInterst,
-  addOrderRemind, addToUnlock,
+  addOrderRemind,
+  addToUnlock,
   applyRefundOrder,
   cancelBook,
   cancelOrde,
@@ -990,19 +1027,19 @@ import {
   shipOrder,
   updateOrderAddress
 } from "@/api/order";
-import { getAllGoods, } from "@/api/stat";
-import { allChannel } from "@/api/channel";
-import { getSmsLog, getSmsTemplate, send } from "@/api/sms";
-import { allRange } from "@/api/serviceTimeRange";
-import { bookStatusMap, cancelReasonList, ObjectToArray, statusMap, statusModifyMap } from "@/api/enumUtils";
+import {getAllGoods,} from "@/api/stat";
+import {allChannel} from "@/api/channel";
+import {getSmsLog, getSmsTemplate, send} from "@/api/sms";
+import {allRange} from "@/api/serviceTimeRange";
+import {bookStatusMap, cancelReasonList, ObjectToArray, statusMap, statusModifyMap} from "@/api/enumUtils";
 import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
-import { formatDate } from "@/utils/date";
-import { getUserCity } from "@/api/city";
+import {formatDate} from "@/utils/date";
+import {getUserCity} from "@/api/city";
 import checkPermission from "@/utils/permission"; // 权限判断函数
-import { cancelZhongAn, unlock } from "@/api/aftersale";
-import reassignOrder from '../order/components/reassignOrder';
+import {cancelZhongAn, unlock} from "@/api/aftersale"; 
 import addressSelectRef from '../order/components/addressSelectRef'
 import orderInfoRef from '@/views/order/components/orderInfoRef.vue'
+import serviceBookRef from "@/views/order/components/serviceBookRef";
 
 let vm;
 
@@ -1016,7 +1053,7 @@ const orderTypeMap = {
 
 export default {
   name: "Order",
-  components: { Pagination, reassignOrder, addressSelectRef, orderInfoRef },
+  components: { Pagination, addressSelectRef, orderInfoRef ,serviceBookRef},
   filters: {
     aftersaleStatusFilter(status) {
       if (status == 1) return "-退款申请中";
@@ -1120,12 +1157,13 @@ export default {
         tab: "5",
         timeArray: ['', ''],
         isHandle: "",
-        // bookStatus:[],
         orderStatusArray: [],
         sort: "create_time",
         order: "desc",
         orderType: "",
-        zhonganOrderNo: ''
+        zhonganOrderNo: '',
+        bookStatus: '',
+        couponChannel:''
       },
       rules: {
         bookDate: [
@@ -1442,7 +1480,18 @@ export default {
         id: '',
         orderType: ''
       },
-      mtOrderTypeFormVisible: false
+      mtOrderTypeFormVisible: false,
+      cancelZhongAnOrderVisable:false,
+      cancelOrderId:null,
+      cancelReason:'',
+      zhonganCancelOption: [
+        { value: '1', label: '改时间' },
+        { value: '2', label: '地址不在服务范围' },
+        { value: '3', label: '电器洗衣机,空调,油烟机等不在服务范围' },
+        { value: '4', label: '退保取消' },
+        { value: '5', label: '约错服务取消' },
+        { value: '6', label: '无法联系用户' },
+      ],
 
     };
   },
@@ -1890,16 +1939,16 @@ export default {
         }
       });
     },
-    cancelZhongAn(row) {
+    confirmCancelZhongAnOrder() {
       this.$confirm("确定要取消此众安预约单吗?", "提示", {
         confirmButtonText: "确定取消",
         cancelButtonText: "再等等",
         type: "warning",
       }).then(() => {
-        cancelZhongAn({ orderId: row.id, reason: '用户联系取消' }).then((response) => {
+        cancelZhongAn({ orderId:  this.cancelOrderId, reason: this.cancelReason }).then(() => {
           this.$message.success("订单已取消");
-          row.orderStatus = 104;
-          row.bookStatus = "已取消";
+          this.cancelZhongAnOrderVisable=false;
+          this.getList();
         })
           .catch((response) => {
             this.$notify.error({
@@ -1910,6 +1959,11 @@ export default {
       })
     },
 
+    cancelZhongAn(row) {
+      this.cancelZhongAnOrderVisable=true;
+      this.cancelOrderId =row.id;
+    },
+
     cancelMeituan(row) {
 
       this.$confirm("确定要取消此美团预约单吗?", "提示", {
@@ -1985,14 +2039,8 @@ export default {
       //   orderId: row.orderId,
       // };
       this.activeIndex = index;
-      let data = {
-        id: row.id,//内层服务工单id
-        // orderBookId: this.reassignId,//外层服务订单id
-        orderBookId: row.bookId,//
-        orderId: row.orderId,
-        assignOrderId: this.assignOrderId//外层服务订单orderId
-      }
-      this.$refs.reassignOrderRef.initDrawer(data);
+      let data={ id: row.id,orderId:row.orderId, fraId: row.fraId};
+      this.$refs.serviceBookRef.init(data);
     },
     orderBookDetail(id) {
       orderBookDetail(id).then((res) => {

+ 11 - 3
src/views/order/orderBookBoard.vue

@@ -102,12 +102,20 @@
             <el-table-column prop="address" label="服务地址"></el-table-column>
             <el-table-column prop="goodsName" label="服务项"></el-table-column>
             <el-table-column prop="bookTime" label="上门时段" width="180px"></el-table-column>
-            <el-table-column prop="fraName" label="服务商" width="180px"></el-table-column>
-            <el-table-column prop="servantName" label="服务人员" width="100px"></el-table-column>
+            <el-table-column prop="fraName" label="服务商" width="130px"></el-table-column>
+            <el-table-column prop="workerName" label="服务人员" width="280px">
+              <template slot-scope="scope">
+                <div style="text-align: left;">
+                  <span v-for="(item,index) in scope.row.servantList" :key="index" style="font-weight: 600;">
+                    服务者{{index+1}}:{{item.servantName }}{{ item.servantPhone }}<br/>
+                  </span>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column prop="status" label="工单状态" width="100px"></el-table-column>
             <el-table-column align="center" label="操作" class-name="small-padding fixed-width" width="100px" fixed="right">
               <template slot-scope="scope">
-                <el-button v-if="status!='取消 未付款'&&status!='退款'" type="text" size="mini" icon="el-icon-edit" @click="handleBook(scope.row)">去处理</el-button>
+                <el-button v-if="scope.row.status!='取消 未付款'&&scope.row.status!='退款'" type="text" size="mini" icon="el-icon-edit" @click="handleBook(scope.row)">去处理</el-button>
               </template>
             </el-table-column>
           </el-table>

+ 168 - 140
src/views/order/serviceBook.vue

@@ -48,7 +48,61 @@
 
     <div :style="{ height: tableHeight }">
       <el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" border fit highlight-current-row
-        :height="tableMaxHeight" :row-class-name="tableRowClassName">
+        :height="tableMaxHeight" :row-class-name="tableRowClassName" @expand-change="handleExpandChange">
+        <el-table-column type="expand">
+          <template slot-scope="scope">
+            <el-table :data="scope.row.workerInfoList" style="width:1200px;max-height: 400px;overflow-y: auto">
+              <el-table-column align="center" label="作业单号" prop="bookDetailServantId" />
+              <el-table-column align="center" label="服务者姓名" prop="workerName" />
+              <el-table-column align="center" label="服务者电话" prop="workerTel" />
+              <el-table-column align="center" label="服务者类型">
+                <template slot-scope="scope">
+                  {{ scope.row.servantType }}
+                </template>
+              </el-table-column>
+
+              <el-table-column align="center" label="服务费" prop="servantFee" />
+              <el-table-column align="center" label="预估技能退款" prop="refundAmount" />
+              <el-table-column align="center" label="服务技能" prop="skillName" />
+              <el-table-column align="center" label="服务时间" prop="bookTime">
+                <template slot-scope="scope">
+                  {{ scope.row.bookDate + " " }}{{ scope.row.bookStartTime }}-{{ scope.row.bookEndTime }}
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="上门打卡" prop="ondoorTime" width="200" >
+                <template slot-scope="scope">
+                   <span style="font-weight: bold;">打卡时间:</span>{{ scope.row.ondoorTime }}<br/>
+                   <template v-if="scope.row.ondoorImg!=null&&scope.row.ondoorImg!=''">
+                   <el-image  
+                    slot="reference"
+                    :preview-src-list="scope.row.ondoorImg.split(',')"
+                    v-for="item in scope.row.ondoorImg.split(',')"
+                    :key="item.index"
+                    :src="item"
+                    style="width: 50px; height: 50px"
+                  ></el-image>
+                  </template>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="完成打卡" prop="finishTime" width="200" >
+              <template slot-scope="scope">
+                   <span style="font-weight: bold;">完成时间:</span>{{ scope.row.finishTime }}<br/>
+                   <template v-if="scope.row.finishImg!=null&&scope.row.finishImg!=''">
+                   <el-image   
+                    slot="reference"
+                    :preview-src-list="scope.row.finishImg.split(',')"
+                    v-for="item in scope.row.finishImg.split(',')"
+                    :key="item.index"
+                    :src="item"
+                    style="width: 50px; height: 50px"
+                  ></el-image>
+                  </template>
+                </template>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-table-column>
+
         <el-table-column align="center" :key="Math.random()" label="服务单编号" width="160" prop="id">
           <template slot-scope="scope">
             <div style="text-align: left;">
@@ -113,7 +167,7 @@
               <br />
               <span style="font-weight: 600;">联系人:</span>
               {{ scope.row.consignee }}
-              <br />  
+              <br />
               <span style="font-weight: 600;">预约备注:</span>
               {{ scope.row.bookMsg }}
               <br />
@@ -140,15 +194,20 @@
         <el-table-column align="center" label="服务人员" prop="servantName" width="200px">
           <template slot-scope="scope">
             <div style="text-align: left;">
-              <span style="font-weight: 600;">服务人员:</span>
+              <div v-for="(item, idx) in scope.row.workerInfoList" :key="idx">
+                <span style="font-weight: 600;">人员信息{{ idx + 1 }}:</span>{{ item.workerName }}({{ item.servantType }}){{
+        item.workerTel }}<br />
+                <span style="font-weight: 600;">计提金额{{ idx + 1 }}:</span>{{ item.servantFee }} <br />
+              </div>
+              <!-- <span style="font-weight: 600;">服务计提:</span>
+              {{ scope.row.servantFee }}
+              <br /> -->
+              <!-- <span style="font-weight: 600;">服务人员:</span>
               {{ scope.row.servantName }}
               <br />
               <span style="font-weight: 600;">联系方式:</span>
               {{ scope.row.servantMobile }}
               <br />
-              <span style="font-weight: 600;">服务计提:</span>
-              {{ scope.row.servantFee }}
-              <br />
               <span style="font-weight: 600;">人员类型:</span>
               {{
         scope.row.servantName
@@ -157,7 +216,7 @@
             : "兼职"
           : ""
       }}
-              <br />
+              <br /> -->
             </div>
           </template>
         </el-table-column>
@@ -184,7 +243,7 @@
 
         <el-table-column align="center" label="操作" class-name="small-padding fixed-width" fixed="right" width="250">
           <template slot-scope="scope1">
-            <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" plain size="mini"
+            <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" plain size="mini"
               @click="handleReassign(scope1.row)" v-show="scope1.row.status == 1 ||
         scope1.row.status == 0 ||
         scope1.row.status == 8 ||
@@ -208,7 +267,7 @@
         ">
               调单
             </el-button>
-            <el-button v-permission="['GET /admin/orderbookdetail/tranBookToFra']" type="info" plain size="mini"
+            <el-button v-permission="['POST /admin/orderbookdetail/setWorkerFee']" type="info" plain size="mini"
               @click="handleChangeFee(scope1.row)" v-show="scope1.row.status == 1 ||
         scope1.row.status == 2 ||
         scope1.row.status == 3 ||
@@ -243,30 +302,7 @@
     <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
       @pagination="getList" />
 
-    <!-- 改派对话框 -->
-    <el-dialog :visible.sync="reassignDialogVisible" title="改派">
-      <el-form ref="reassignForm" :model="reassignForm" status-icon label-position="left" label-width="100px"
-        style="width: 400px; margin-left:50px;" :rules="rules">
-        <el-form-item label="日期" prop="bookDate">
-          <el-date-picker v-model="reassignForm.bookDate" type="date" placeholder="选择日期"
-            value-format="yyyy-MM-dd"></el-date-picker>
-        </el-form-item>
-        <el-form-item label="服务者" prop="servantId">
-          <el-select v-model="reassignForm.servantId" placeholder="请选择" @change="servantChange">
-            <el-option v-for="item in servantList" :key="item.code" :label="item.workerName" :value="item.workerId" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="时间段" prop="bookTime">
-          <el-select v-model="reassignForm.bookTime" placeholder="请选择" @focus="getAppointTime">
-            <el-option v-for="(item, index) in timeListAppoint" :key="index" :label="item" :value="item" />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="reassignDialogVisible = false">取消</el-button>
-        <el-button type="primary" @click="confirmReassign">确定</el-button>
-      </div>
-    </el-dialog>
+
 
     <!-- 添加备注 提醒到客户或服务者  -->
     <el-dialog :visible.sync="notifyFormVisible" title="追加订单备注" width="800px">
@@ -322,12 +358,15 @@
     </el-dialog>
 
     <!-- 修改计提 -->
-    <el-dialog :visible.sync="modifyServiceFeeFormVisible" title="修改工单计提" width="600px">
-      <el-form ref="modifyServiceFeeForm" :model="modifyServiceFeeForm" status-icon label-position="left"
-        label-width="100px" style="width: 400px; margin-left:50px;" :rules="modifyServiceFeerules">
-        <el-form-item label="加盟商" prop="servantFee">
-          <el-input v-model="modifyServiceFeeForm.servantFee" type="number" placeholder="请输入计提金额" />
-        </el-form-item>
+    <el-dialog :visible.sync="modifyServiceFeeFormVisible" title="修改工单计提" width="800px">
+      <el-form status-icon label-position="left" label-width="100px" style="width: 400px; margin-left:50px;">
+
+        <template v-for="item in tempRow.workerInfoList">
+          <el-form-item v-if="item.servantType == '兼职'" :key="item.id" :label="item.workerName + '(' + item.servantType + ')'">
+            <el-input v-model="item.servantFee" type="number" placeholder="请输入计提金额" />
+          </el-form-item>
+        </template>
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="modifyServiceFeeFormVisible = false">取消</el-button>
@@ -349,6 +388,8 @@
             <span v-show="scope.row.changeType == 7">客户预约</span>
             <span v-show="scope.row.changeType == 8">派单</span>
             <span v-show="scope.row.changeType == 11">流转</span>
+            <span v-show="scope.row.changeType == 15">修改客户信息(姓名、电话、地址)</span>
+            <span v-show="scope.row.changeType == 16">系统分配加盟商记录</span>
           </template>
         </el-table-column>
         <el-table-column prop="changeReason" width="200px" label="修改原因" />
@@ -362,7 +403,7 @@
       </div>
     </el-dialog>
 
-    <reassignOrder ref="reassignOrderRef" />
+
 
     <serviceBookRef ref="serviceBookRef" @success="reassignSuccess" />
 
@@ -374,12 +415,13 @@
     </el-dialog>
 
     <!-- 补差列表 -->
-    <el-dialog :visible.sync="diffListVisible" title="补差列表" center width="900px">
+    <el-dialog :visible.sync="diffListVisible" title="补差列表" center width="950px">
       <p>
         <el-button type="primary" @click="addDiffOrder">添加</el-button>
       </p>
       <el-table :data="diffList" style="width: 100%" border>
         <el-table-column prop="difName" width="200px" label="补差项" />
+        <el-table-column prop="skillName" label="工单技能" />
         <el-table-column prop="difTotalPrice" label="总计金额" />
         <el-table-column prop="state" label="支付状态">
           <template slot-scope="scope">
@@ -415,8 +457,15 @@
     <!-- 添加补差 -->
     <el-dialog :visible.sync="addDiffVisible" :title="(diffOrderType == 'edit' ? '修改' : '创建') + '补差订单'" center
       width="800px">
-      <el-form ref="modifyServiceFeeForm" :model="addDiffForm" status-icon label-position="right" label-width="120px"
+      <el-form :model="addDiffForm" status-icon label-position="right" label-width="120px"
         style="width: 700px; margin-left:50px;">
+        <el-row>
+          <el-form-item  label-width="230px" label="选择此工单对应技能创建补差"  >
+          <el-radio-group v-model="addDiffForm.skillId" @change="chooseSkill">
+            <el-radio v-for="item2 in orderSkillList"  :key="item2.id"  :label="item2.skillId">{{ item2.skillName }}</el-radio> 
+          </el-radio-group>
+          </el-form-item>
+        </el-row>
         <el-row v-for="(item, index) in addDiffForm.diffList" :key="index">
           <el-col :span="10">
             <el-form-item :label="item.itemName" :prop="'diffList.' + index + '.number'" :rules="{
@@ -522,7 +571,7 @@
 <script>
 import {
   getOrderBookDetailList,
-  modifyFee,
+  setWorkerFee,
   notify,
   tranBookToFra
 } from "@/api/orderBookDetail";
@@ -552,13 +601,12 @@ import {
   cancelReasonList,
   cancelReasonMapList
 } from "@/api/enumUtils";
-import reassignOrder from "../order/components/reassignOrder";
 import serviceBookRef from "../order/components/serviceBookRef";
 import { detail } from "@/api/commission";
 let vm;
 export default {
   name: "serviceBook",
-  components: { Pagination, reassignOrder, serviceBookRef },
+  components: { Pagination, serviceBookRef },
   filters: {
     orderStatusFilter(status) {
       return statusMap[status];
@@ -588,17 +636,17 @@ export default {
         id: "",
         fraId: ""
       },
-      modifyServiceFeeForm: {
-        //计提
-        id: "",
-        servantFee: ""
-      },
+      // modifyServiceFeeForm: {
+      //   //计提
+      //   id: "",
+      //   servantFee: ""
+      // },
       modifyServiceFeeFormVisible: false,
-      modifyServiceFeerules: {
-        servantFee: [
-          { required: true, message: "请输入计提金额", trigger: "blur" }
-        ]
-      },
+      // modifyServiceFeerules: {
+      //   servantFee: [
+      //     { required: true, message: "请输入计提金额", trigger: "blur" }
+      //   ]
+      // },
       notifyFormVisible: false,
       notifyForm: {
         id: "",
@@ -672,7 +720,6 @@ export default {
       },
       statusMap: bookStatusMap,
       orderDialogVisible: false,
-      reassignDialogVisible: false,
       orderDetail: [],
       reassignForm: {
         id: "",
@@ -688,6 +735,7 @@ export default {
       diffListVisible: false,
       diffList: [],
       diffTypeList: [],
+      orderSkillList: [],
       addDiffVisible: false,
       addDiffForm: {
         diffList: [
@@ -698,7 +746,9 @@ export default {
           }
         ],
         diffId: 0,
-        bookDetailId: ""
+        bookDetailId: "",
+        skillId: '',
+        skillName: ''
       },
       totalDiffAmount: 0,
       diffDetailVisible: false,
@@ -711,7 +761,10 @@ export default {
       cusAppointLink: "",
       cusAppointType: 1,
       rollBackVisible: false,
-      detailId: ""
+      detailId: "",
+      tempRow: {
+        workerInfoList: []
+      }
     };
   },
   computed: {
@@ -864,33 +917,44 @@ export default {
     handleChangeFee(row) {
       //修改计提
       this.modifyServiceFeeFormVisible = true;
-      this.modifyServiceFeeForm = {
-        id: row.id,
-        servantFee: row.servantFee
-      };
+      this.tempRow = row;
+      // this.modifyServiceFeeForm = {
+      //   id: row.id,
+      //   servantFee: row.servantFee
+      // };
     },
     saveServiceFee() {
-      this.$refs["modifyServiceFeeForm"].validate(valid => {
-        if (valid) {
-          modifyFee(this.modifyServiceFeeForm)
-            .then(res => {
-              for (const v of this.list) {
-                if (v.id === this.modifyServiceFeeForm.id) {
-                  v.servantFee = this.modifyServiceFeeForm.servantFee;
-                  break;
-                }
-              }
-              this.$message.success("计提修改成功");
-              this.modifyServiceFeeFormVisible = false;
-            })
-            .catch(res => {
-              this.$notify.error({
-                title: "失败",
-                message: res.data.errmsg
-              });
-            });
+      let feeList = [];
+      this.tempRow.workerInfoList.forEach(e => {
+        if (e.servantType == '兼职') {
+          feeList.push({ workerId: e.workerId, workerFee: e.servantFee });
         }
-      });
+      })
+
+
+      let req = {
+        detailId: this.tempRow.id,
+        workerServiceFeeList: feeList
+      };
+      setWorkerFee(req)
+        .then(res => {
+          // for (const v of this.list) {
+          //   if (v.id === this.modifyServiceFeeForm.id) {
+          //     v.servantFee = this.modifyServiceFeeForm.servantFee;
+          //     break;
+          //   }
+          // }
+          this.$message.success("计提修改成功");
+          this.modifyServiceFeeFormVisible = false;
+        })
+        .catch(res => {
+          this.$notify.error({
+            title: "失败",
+            message: res.data.errmsg
+          });
+        });
+
+
     },
     formatTime(time) {
       if (time == null || time === "") {
@@ -930,37 +994,8 @@ export default {
       });
     },
     handleReassign(row) {
-      // if (row.fraId && row.fraId == 293) {
-      //if (row.orderChannel === 104) {
-      //  this.$refs.serviceBookRef.init(row);
-      // return;
-      //}
-
-      this.$confirm("请选择派到全职还是兼职?", "提示", {
-        confirmButtonText: "全职",
-        cancelButtonText: "兼职",
-        type: "warning"
-      })
-        .then(res => {
-          console.log("res--->" + res);
-          let data = {
-            id: row.id, //内层服务工单id
-            orderBookId: row.bookId, //
-            orderId: row.orderId,
-            assignOrderId: this.assignOrderId, //外层服务订单orderId
-            fraId: row.fraId
-          };
-          this.$refs.reassignOrderRef.initDrawer(data);
-        })
-        .catch(res => {
-          console.log("catch res--->" + res);
-          this.$refs.serviceBookRef.init(row);
-        });
-      // }
-      // else {//加盟商改约
-      //     // console.info(row)
-      //     this.$refs.serviceBookRef.init(row);
-      // }
+      let data = { id: row.id, orderId: row.orderId, fraId: row.fraId };
+      this.$refs.serviceBookRef.init(data);
     },
     reassignSuccess(data) {
       this.getList();
@@ -1029,32 +1064,6 @@ export default {
       this.timeListAppoint = [];
       this.reassignForm.bookTime = "";
     },
-    confirmReassign() {
-      this.$refs["reassignForm"].validate(valid => {
-        if (valid) {
-          let params = {
-            id: this.reassignForm.id,
-            bookDate: this.reassignForm.bookDate,
-            bookStartTime: this.reassignForm.bookTime.split("-")[0],
-            bookEndTime: this.reassignForm.bookTime.split("-")[1],
-            servantId: this.reassignForm.servantId
-          };
-          orderBookReassign(params)
-            .then(response => {
-              this.$message.success("改派成功");
-              console.log(response);
-              this.reassignDialogVisible = false;
-              this.orderBookDetail(this.reassignForm.orderId);
-            })
-            .catch(response => {
-              this.$notify.error({
-                title: "失败",
-                message: response.data.errmsg
-              });
-            });
-        }
-      });
-    },
     wholeModify() {
       this.$confirm("若工单预约时间为空需要单独修改预约!", "提示", {
         confirmButtonText: "确定",
@@ -1195,10 +1204,12 @@ export default {
       this.diffOrderType = "create";
       this.addDiffVisible = true;
       this.addDiffForm.diffId = 0;
+      this.addDiffForm.skillId = '';
       this.totalDiffAmount = 0;
       getDiffTypeList({ bookDetailId: this.addDiffForm.bookDetailId })
         .then(res => {
-          this.addDiffForm.diffList = res.data.data;
+          this.addDiffForm.diffList = res.data.data.diffList;
+          this.orderSkillList = res.data.data.orderSkillList; 
           this.addDiffForm.diffList.forEach(item => {
             item.price2 = item.price;
           });
@@ -1213,10 +1224,13 @@ export default {
     handleEditDiff(row) {
       this.diffOrderType = "edit";
       this.addDiffForm.diffId = row.id;
+      this.addDiffForm.skillId = row.skillId+'';
+      this.addDiffForm.skillName = row.skillName;
       getDiffDetail({ diffOrderId: row.id })
         .then(res => {
           this.totalDiffAmount = res.data.data.difTotalPrice;
           this.addDiffForm.diffList = res.data.data.itemList;
+          this.orderSkillList=res.data.data.orderSkillList;
           this.addDiffVisible = true;
         })
         .catch(response => {
@@ -1226,12 +1240,23 @@ export default {
           });
         });
     },
+    chooseSkill(skid){
+      let nm='';
+      this.orderSkillList.forEach(e=>{
+        if(e.skillId==skid){
+          nm=e.skillName;
+        }
+      })
+      this.addDiffForm.skillName=nm;
+    },
     confAddDiff() {
       //  let list=this.addDiffForm.diffList.filter(item=>{return item.number>0});
       let list = this.addDiffForm.diffList;
       createDiffOrder({
         bookDetailId: this.addDiffForm.bookDetailId,
         diffId: this.addDiffForm.diffId,
+        skillId:this.addDiffForm.skillId,
+        skillName:this.addDiffForm.skillName,
         diffList: list
       })
         .then(res => {
@@ -1298,6 +1323,9 @@ export default {
             message: res.data.errmsg
           })
         })
+    },
+    handleExpandChange(row, expandRows) {
+
     }
   }
 };

+ 14 - 35
src/views/order/serviceorder.vue

@@ -3,8 +3,8 @@
     <!-- 查询和其他操作 -->
     <div class="filter-container">
       <el-input v-model="listQuery.mobile" clearable class="filter-item" style="width: 160px;" placeholder="请输入用户手机" />
-      <el-input v-model="listQuery.orderId" clearable class="filter-item" style="width: 160px;" placeholder="请输入服务订单编号" />
-      <el-input v-model="listQuery.orderSn" clearable class="filter-item" style="width: 160px;" placeholder="请输入支付订单编号" />
+<!--      <el-input v-model="listQuery.orderId" clearable class="filter-item" style="width: 160px;" placeholder="请输入服务订单编号" />-->
+      <el-input v-model="listQuery.orderSn" clearable class="filter-item" style="width: 160px;" placeholder="请输入订单编号" />
 
       <el-select v-model="listQuery.cityId" clearable  filterable style="width: 150px" class="filter-item" placeholder="请选择城市">
         <el-option v-for="item in city" :key="item.id" :label="item.cityName" :value="item.id" />
@@ -80,8 +80,7 @@
         <template slot-scope="scope">
           <el-button v-permission="['GET /admin/orderbook/detail']" type="primary" size="mini"
             @click="handleDetail(scope.row)">详情</el-button>
-       <!--             <el-button v-permission="['GET /admin/orderbook/sendOrdersCheck']" type="primary" size="mini"
-            @click="handleDispatch(scope.row, scope.$index)" v-if="(scope.row.serviceTimes - scope.row.servicedTimes>1)&&(scope.row.status==0||scope.row.status==1||scope.row.status==2)">一键派单</el-button> -->
+      
         </template>
       </el-table-column>
     </el-table>
@@ -128,7 +127,7 @@
 
         <el-table-column align="center" label="操作" fixed="right" width="300">
           <template slot-scope="scope">
-            <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" plain size="mini"
+            <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" plain size="mini"
               @click="handleReassign(scope.row, scope.$index)"
               v-if="(scope.row.status == 1 || scope.row.status == 0 || scope.row.status == 7 )&&scope.row.orderChannel!=104">修改预约</el-button>
             <el-button v-permission="['GET /admin/orderbook/cancelBook']" type="danger" plain size="mini"
@@ -206,9 +205,8 @@
       </div>
     </el-dialog>
 
-
-    <reassignOrder ref="reassignOrderRef" />
-    <dispatchCycleOrder ref="dispatchCycleOrderRef" />
+ 
+    <serviceBookRef ref="serviceBookRef" /> 
   </div>
 </template>
 
@@ -233,18 +231,17 @@ import { getToken } from "@/utils/auth";
 import { getUserCity } from "@/api/city";
 import {
   bookStatusMap,
-  cancelReasonList 
+  cancelReasonList
 } from "@/api/enumUtils";
 import {
   allRange
-} from "@/api/serviceTimeRange";
-import reassignOrder from '@/views/order/components/reassignOrder';
-import dispatchCycleOrder from '@/views/order/components/dispatchCycleOrder';
+} from "@/api/serviceTimeRange";  
+import serviceBookRef from "@/views/order/components/serviceBookRef";
 let vm;
 
 export default {
   name: "serviceorder",
-  components: { Pagination, reassignOrder,dispatchCycleOrder },
+  components: { Pagination,serviceBookRef },
   filters: {
     orderStatusFilter(status) {
       return statusMap[status];
@@ -632,29 +629,11 @@ export default {
     },
 
     handleReassign(row, index) {
-      // this.reassignDialogVisible = true;
-      //  this.timeList = this.getTimeList(row.serviceDuration);
 
-      // this.getServantList(row.id);
-      // this.reassignForm = {
-      //   id: row.id,
-      //   bookDate: "",
-      //   bookTime: "",
-      //   servantId: "",
-      //   orderId: row.orderId,
-      // };
-      let data = {
-        id: row.id,//内层服务工单id
-        // orderBookId: this.reassignId,//外层服务订单id
-        orderBookId: row.bookId,//
-        orderId: row.orderId,
-        assignOrderId: this.assignOrderId//外层服务订单orderId
-      }
-      this.$refs.reassignOrderRef.initDrawer(data);
-    },
-    handleDispatch(row, index){
-      this.$refs.dispatchCycleOrderRef.initDrawer(row);
-    },
+      let data={ id: row.id,orderId:row.orderId, fraId: row.fraId};
+      this.$refs.serviceBookRef.init(data); 
+      
+    }, 
     handleFinish(row) {
       this.$confirm("确定要手动核销完成此服务单吗!", "提示", {
         confirmButtonText: "确定",

+ 10 - 27
src/views/order/serviceordercategory.vue

@@ -66,7 +66,7 @@
     <el-dialog :visible.sync="orderDialogVisible" title="服务订单详情" width="1000px">
 
       <p>
-        <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="wholeAppoint" v-if="orderItem.status == 0">一键预约</el-button>
+        <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="wholeAppoint" v-if="orderItem.status == 0">一键预约</el-button>
       </p>
       <div style="padding:20px 40px; width:800px">
         <el-calendar>
@@ -77,7 +77,7 @@
               <!-- {{ data.day }} -->
               {{ appointmentList.indexOf(data.day)>-1 ? '已预约' : ''}}
 
-              <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="handleCalendarReassign(data.day)" v-if="appointmentList.indexOf(data.day)>-1">修改预约</el-button>
+              <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="handleCalendarReassign(data.day)" v-if="appointmentList.indexOf(data.day)>-1">修改预约</el-button>
             </p>
           </template>
         </el-calendar>
@@ -108,7 +108,7 @@
 
         <el-table-column align="center" label="操作" fixed="right" width="200">
           <template slot-scope="scope">
-            <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="handleReassign(scope.row)" v-if="scope.row.status == 1||scope.row.status == 0||scope.row.status == 7">修改预约</el-button>
+            <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="handleReassign(scope.row)" v-if="scope.row.status == 1||scope.row.status == 0||scope.row.status == 7">修改预约</el-button>
             <el-button v-permission="['GET /admin/orderbook/cancelBook']" type="danger" plain size="mini" @click="handleCancel(scope.row)" v-if="scope.row.status == 1||scope.row.status == 7">取消预约</el-button>
           </template>
         </el-table-column>
@@ -197,8 +197,7 @@
         <el-button type="primary" @click="cancelBook">确定</el-button>
       </div>
     </el-dialog>
-
-     <reassignOrder ref="reassignOrderRef"/>
+    <serviceBookRef ref="serviceBookRef" />
   </div>
 </template>
 
@@ -219,14 +218,14 @@ import checkPermission from "@/utils/permission"; // 权限判断函数
 import { getToken } from "@/utils/auth";
 import { getUserCity } from "@/api/city";
 import { bookStatusMap, cancelReasonList,
-  changeReasonMap } from "@/api/enumUtils";
-import reassignOrder from '@/views/order/components/reassignOrder';
+  changeReasonMap } from "@/api/enumUtils"; 
 
+  import serviceBookRef from "@/views/order/components/serviceBookRef";
 let vm;
 
 export default {
   name: "Order",
-  components: { Pagination,reassignOrder },
+  components: { Pagination,serviceBookRef },
   filters: {
     orderStatusFilter(status) {
       return statusMap[status];
@@ -686,25 +685,9 @@ export default {
         }
       });
     },
-    handleReassign(row) {
-      // this.reassignDialogVisible = true;
-      // this.timeList = this.getTimeList(row.serviceDuration);
-      // this.getServantList(row.id);
-      // this.reassignForm = {
-      //   id: row.id,
-      //   bookDate: "",
-      //   bookTime: "",
-      //   servantId: "",
-      //   orderId: row.orderId,
-      // };
- let data={
-          id:row.id,//内层服务工单id
-          // orderBookId: this.reassignId,//外层服务订单id
-          orderBookId: row.bookId,//
-          orderId: row.orderId,
-          assignOrderId:this.assignOrderId//外层服务订单orderId
-        }
-       this.$refs.reassignOrderRef.initDrawer(data);
+    handleReassign(row) { 
+      let data={ id: row.id,orderId:row.orderId, fraId: row.fraId};
+      this.$refs.serviceBookRef.init(data);
     },
     getServantList(id) {
       getAssignmentPerson(id).then((res) => {

+ 13 - 27
src/views/order/serviceordercycle.vue

@@ -65,7 +65,7 @@
     <!-- 订单详情对话框 -->
     <el-dialog :visible.sync="orderDialogVisible" title="服务订单详情" width="1000px">
       <p>
-        <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="wholeAppoint" v-if="orderItem.status == 0">一键预约</el-button>
+        <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="wholeAppoint" v-if="orderItem.status == 0">一键预约</el-button>
       </p>
       <div style="padding:20px 40px; width:800px">
         <el-calendar>
@@ -76,7 +76,7 @@
               <!-- {{ data.day }} -->
               {{ appointmentList.indexOf(data.day)>-1 ? '已预约' : ''}}
 
-              <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="handleCalendarReassign(data.day)" v-if="appointmentList.indexOf(data.day)>-1">修改预约</el-button>
+              <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="handleCalendarReassign(data.day)" v-if="appointmentList.indexOf(data.day)>-1">修改预约</el-button>
             </p>
           </template>
         </el-calendar>
@@ -106,7 +106,7 @@
 
         <el-table-column align="center" label="操作" fixed="right" width="200">
           <template slot-scope="scope">
-            <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="handleReassign(scope.row)" v-if="scope.row.status == 1||scope.row.status == 0||scope.row.status == 7">修改预约</el-button>
+            <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="handleReassign(scope.row)" v-if="scope.row.status == 1||scope.row.status == 0||scope.row.status == 7">修改预约</el-button>
             <el-button v-permission="['GET /admin/orderbook/cancelBook']" type="danger" plain size="mini" @click="handleCancel(scope.row)" v-if="scope.row.status == 1||scope.row.status == 7">取消预约</el-button>
           </template>
         </el-table-column>
@@ -194,8 +194,10 @@
         <el-button @click="cancelAppointVisible = false">取消</el-button>
         <el-button type="primary" @click="cancelBook">确定</el-button>
       </div>
-    </el-dialog>
- <reassignOrder ref="reassignOrderRef"/>
+    </el-dialog> 
+
+    
+    <serviceBookRef ref="serviceBookRef" />
   </div>
 </template>
 
@@ -217,13 +219,13 @@ import checkPermission from "@/utils/permission"; // 权限判断函数
 import { getToken } from "@/utils/auth";
 import { getUserCity } from "@/api/city";
 import { bookStatusMap,cancelReasonList,
-  changeReasonMap } from "@/api/enumUtils";
-import reassignOrder from '@/views/order/components/reassignOrder';
+  changeReasonMap } from "@/api/enumUtils";  
+import serviceBookRef from "@/views/order/components/serviceBookRef";
 let vm;
 
 export default {
   name: "Order",
-  components: { Pagination ,reassignOrder},
+  components: { Pagination,serviceBookRef },
   filters: {
     orderStatusFilter(status) {
       return statusMap[status];
@@ -630,25 +632,9 @@ export default {
       console.log(row);
       this.handleReassign(row[0]);
     },
-    handleReassign(row) {
-      // this.reassignDialogVisible = true;
-      // this.timeList = this.getTimeList(row.serviceDuration);
-      // this.getServantList(row.id);
-      // this.reassignForm = {
-      //   id: row.id,
-      //   bookDate: "",
-      //   bookTime: "",
-      //   servantId: "",
-      //   orderId: row.orderId,
-      // };
-       let data={
-          id:row.id,//内层服务工单id
-          // orderBookId: this.reassignId,//外层服务订单id
-          orderBookId: row.bookId,//
-          orderId: row.orderId,
-          assignOrderId:this.assignOrderId//外层服务订单orderId
-        }
-       this.$refs.reassignOrderRef.initDrawer(data);
+    handleReassign(row) { 
+      let data={ id: row.id,orderId:row.orderId, fraId: row.fraId};
+      this.$refs.serviceBookRef.init(data);
     },
     getServantList(id) {
       getAssignmentPerson(id).then((res) => {

+ 12 - 26
src/views/order/serviceorderonce.vue

@@ -66,7 +66,7 @@
     <el-dialog :visible.sync="orderDialogVisible" title="服务订单详情" width="1000px">
 
       <p>
-        <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="wholeAppoint" v-if="orderItem.status == 0">一键预约</el-button>
+        <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="wholeAppoint" v-if="orderItem.status == 0">一键预约</el-button>
       </p>
       <div style="padding:20px 40px; width:800px">
         <el-calendar>
@@ -77,7 +77,7 @@
               <!-- {{ data.day }} -->
               {{ appointmentList.indexOf(data.day)>-1 ? '已预约' : ''}}
 
-              <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="handleCalendarReassign(data.day)" v-if="appointmentList.indexOf(data.day)>-1">修改预约</el-button>
+              <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="handleCalendarReassign(data.day)" v-if="appointmentList.indexOf(data.day)>-1">修改预约</el-button>
             </p>
           </template>
         </el-calendar>
@@ -108,7 +108,7 @@
 
         <el-table-column align="center" label="操作" fixed="right" width="200">
           <template slot-scope="scope">
-            <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" size="mini" @click="handleReassign(scope.row)" v-if="(scope.row.status == 1||scope.row.status == 0||scope.row.status == 7)&&scope.row.orderChannel!==104">修改预约</el-button>
+            <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" size="mini" @click="handleReassign(scope.row)" v-if="(scope.row.status == 1||scope.row.status == 0||scope.row.status == 7)&&scope.row.orderChannel!==104">修改预约</el-button>
             <el-button v-permission="['GET /admin/orderbook/cancelBook']" type="danger" plain size="mini" @click="handleCancel(scope.row)" v-if="scope.row.status == 1||scope.row.status == 7">取消预约</el-button>
           </template>
         </el-table-column>
@@ -196,8 +196,9 @@
         <el-button type="primary" @click="cancelBook">确定</el-button>
       </div>
     </el-dialog>
-
-     <reassignOrder ref="reassignOrderRef"/>
+ 
+     
+    <serviceBookRef ref="serviceBookRef" />
 
   </div>
 </template>
@@ -219,13 +220,13 @@ import checkPermission from "@/utils/permission"; // 权限判断函数
 import { getToken } from "@/utils/auth";
 import { getUserCity } from "@/api/city";
 import { bookStatusMap,   cancelReasonList,
-  changeReasonMap} from "@/api/enumUtils";
-import reassignOrder from '@/views/order/components/reassignOrder';
+  changeReasonMap} from "@/api/enumUtils"; 
+import serviceBookRef from "../order/components/serviceBookRef";
 let vm;
 
 export default {
   name: "Order",
-  components: { Pagination ,reassignOrder },
+  components: { Pagination  ,serviceBookRef},
   filters: {
     orderStatusFilter(status) {
       return statusMap[status];
@@ -689,24 +690,9 @@ export default {
       });
     },
     handleReassign(row) {
-      // this.reassignDialogVisible = true;
-      // this.timeList = this.getTimeList(row.serviceDuration);
-      // this.getServantList(row.id);
-      // this.reassignForm = {
-      //   id: row.id,
-      //   bookDate: "",
-      //   bookTime: "",
-      //   servantId: "",
-      //   orderId: row.orderId,
-      // };
-       let data={
-          id:row.id,//内层服务工单id
-          // orderBookId: this.reassignId,//外层服务订单id
-          orderBookId: row.bookId,//
-          orderId: row.orderId,
-          assignOrderId:this.assignOrderId//外层服务订单orderId
-        }
-       this.$refs.reassignOrderRef.initDrawer(data);
+      let data={ id: row.id,orderId:row.orderId, fraId: row.fraId};
+      this.$refs.serviceBookRef.init(data);
+ 
     },
     getServantList(id) {
       getAssignmentPerson(id).then((res) => {

+ 7 - 19
src/views/order/storage/storageBookList.vue

@@ -92,7 +92,7 @@
 
                 <el-table-column align="center" label="操作" class-name="small-padding fixed-width" fixed="right" width="250">
                     <template slot-scope="scope1">
-                        <el-button v-permission="['POST /admin/orderbook/reassign']" type="primary" plain size="mini"
+                        <el-button v-permission="['POST /admin/orderbookdetail/changeWorker']" type="primary" plain size="mini"
                             @click="handleReassign(scope1.row)"
                             v-if="scope1.row.status == 1 || scope1.row.status == 0 || scope1.row.status == 7">{{
                                 scope1.row.status ==
@@ -197,8 +197,7 @@
                 <el-button type="primary" @click="logDiaVisible = false">确定</el-button>
             </div>
         </el-dialog>
-
-        <reassignOrder ref="reassignOrderRef" />
+ 
 
         <serviceBookRef ref="serviceBookRef" @success="reassignSuccess" />
     </div>
@@ -220,14 +219,13 @@ import {
     bookStatusMap,
     cancelReasonList,
     changeReasonMap
-} from "@/api/enumUtils";
-import reassignOrder from '@/views/order/components/reassignOrder';
+} from "@/api/enumUtils"; 
 import serviceBookRef from '@/views/order/components/serviceBookRef';
 let vm;
 
 export default {
     name: "storageBookList",
-    components: { Pagination, reassignOrder, serviceBookRef },
+    components: { Pagination, serviceBookRef },
     filters: {
         orderStatusFilter(status) {
             return statusMap[status];
@@ -464,19 +462,9 @@ export default {
             });
         },
         handleReassign(row, index) {
-            if (row.fraId && row.fraId == 293) {
-                let data = {
-                    id: row.id,//内层服务工单id 
-                    orderBookId: row.bookId,//
-                    orderId: row.orderId,
-                    assignOrderId: this.assignOrderId//外层服务订单orderId
-                }
-                this.$refs.reassignOrderRef.initDrawer(data);
-            }
-            else {//加盟商改约 
-                // console.info(row)
-                this.$refs.serviceBookRef.init(row);
-            }
+            let data={ id: row.id,orderId:row.orderId, fraId: row.fraId};
+            this.$refs.serviceBookRef.init(data);
+            
         },
         reassignSuccess(data) {
             this.getList();

+ 3 - 5
src/views/order/storage/storageOrderList.vue

@@ -168,8 +168,7 @@
         </el-dialog>
 
 
-
-        <reassignOrder ref="reassignOrderRef" />
+ 
         <addressSelectRef ref="addressSelectRef" />
 
         <!-- 订单详情对话框 -->
@@ -204,8 +203,7 @@ import { formatDate } from "@/utils/date";
 import { getUserCity } from "@/api/city";
 import checkPermission from "@/utils/permission"; // 权限判断函数
 import { getSmsLog } from "@/api/sms";
-import { getToken } from "@/utils/auth";
-import reassignOrder from '@/views/order/components/reassignOrder';
+import { getToken } from "@/utils/auth"; 
 import addressSelectRef from '@/views/order/components/addressSelectRef'
 import orderInfoRef from '@/views/order/components/orderInfoRef.vue'
 
@@ -220,7 +218,7 @@ const orderTypeMap = {
 
 export default {
     name: "Order",
-    components: { Pagination, reassignOrder, addressSelectRef, orderInfoRef },
+    components: { Pagination,  addressSelectRef, orderInfoRef },
     filters: {
         aftersaleStatusFilter(status) {
             if (status == 1) return "-退款申请中";

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1630 - 0
src/views/order/telecomCard/broadbandService.vue


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1329 - 0
src/views/order/telecomCard/numberCardService.vue


+ 88 - 30
src/views/promotion/coupon.vue

@@ -16,7 +16,7 @@
       <el-select v-model="listQuery.status" clearable style="width: 200px" class="filter-item" placeholder="请选择优惠券状态">
         <el-option v-for="type in statusOptions" :key="type.value" :label="type.label" :value="type.value" />
       </el-select>
-      <el-select v-model="listQuery.channelId" clearable style="width: 200px" class="filter-item" placeholder="请选择优惠券渠道">
+      <el-select v-model="listQuery.channelId" filterable clearable style="width: 200px" class="filter-item" placeholder="择优惠券使用渠道">
         <el-option v-for="type in channels" :key="type.id" :label="type.name" :value="type.id" />
       </el-select>
       <el-select v-model="listQuery.isFraUsable" clearable style="width: 200px" class="filter-item" placeholder="请选择加盟商可用状态">
@@ -64,6 +64,9 @@
       <el-table-column align="center" label="优惠券类型" prop="type">
         <template slot-scope="scope">{{ scope.row.type | formatType }}</template>
       </el-table-column>
+      <el-table-column align="center" label="使用渠道" prop="channelId">
+        <template slot-scope="scope">{{ formateChannel(scope.row.channelId)   }}</template>
+      </el-table-column>
 
       <el-table-column align="center" label="优惠券数量" prop="total">
         <template slot-scope="scope">{{ scope.row.total != 0 ? scope.row.total : "不限" }}</template>
@@ -97,6 +100,25 @@
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width='800px'>
       <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left" label-width="100px"
         style="margin-left:20px;">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="抵用类型" prop="type">
+              <el-select v-model="dataForm.voucherType" style="width:100%">
+                <el-option v-for="type in voucherTypeData" :key="type.value" :label="type.label" :value="type.value" />
+              </el-select>
+              <span v-if="dataForm.voucherType==3" style="color: red;display: inline-block">说明:用户领券后可0元兑换指定商品</span>
+            </el-form-item>
+
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="使用渠道" prop="channelId">
+              <el-select v-model="dataForm.channelId" style="width:100%">
+                <el-option v-for="type in channels" :key="type.id" :label="type.name" :value="type.id" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
         <el-form-item label="优惠券名称" prop="name">
           <el-input v-model="dataForm.name" />
         </el-form-item>
@@ -114,29 +136,29 @@
         <el-form-item label="标签" prop="tag">
           <el-input v-model="dataForm.tag" />
         </el-form-item>
-        <el-form-item label="最低消费" prop="min">
+        <el-form-item label="最低消费" prop="min" v-if="dataForm.voucherType!=3">
           <el-input v-model="dataForm.min">
             <template slot="append">元</template>
           </el-input>
         </el-form-item>
+
         <el-row>
           <el-col :span="12">
-            <el-form-item label="每人限领" prop="limit">
-              <el-input v-model="dataForm.limit">
-                <template slot="append"></template>
+            <el-form-item v-if="dataForm.voucherType==3" label="兑换商品数" prop="goodsNum">
+              <el-input disabled v-model="dataForm.goodsNum">
+                <template slot="append"></template>
               </el-input>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="12">
-            <el-form-item label="使用渠道" prop="channelId">
-              <el-select v-model="dataForm.channelId" style="width:100%">
-                <el-option v-for="type in channels" :key="type.id" :label="type.name" :value="type.id" />
-              </el-select>
+            <el-form-item label="每人限领" prop="limit">
+              <el-input v-model="dataForm.limit">
+                <template slot="append">张</template>
+              </el-input>
             </el-form-item>
           </el-col>
-        </el-row>
-
-        <el-row>
           <el-col :span="12">
             <el-form-item label="分发类型" prop="type">
               <el-select v-model="dataForm.type" style="width:100%">
@@ -144,16 +166,8 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="抵用类型" prop="type">
-              <el-select v-model="dataForm.voucherType" style="width:100%">
-                <el-option v-for="type in voucherTypeData" :key="type.value" :label="type.label" :value="type.value" />
-              </el-select>
-            </el-form-item>
-          </el-col>
         </el-row>
-
-        <el-form-item :label="dataForm.voucherType == 1 ? '满减金额' : '折扣率'" prop="discount">
+        <el-form-item v-if="dataForm.voucherType!=3" :label="dataForm.voucherType == 1 ? '满减金额' : '折扣率'" prop="discount">
           <el-input v-model="dataForm.discount">
             <template slot="append">元(或折扣率1-100%)</template>
           </el-input>
@@ -190,8 +204,8 @@
         </el-form-item>
         <el-form-item label="商品限制范围">
           <el-radio-group v-model="dataForm.goodsType">
-            <el-radio-button :label="0">全场通用</el-radio-button>
-            <el-radio-button :label="1">指定分类</el-radio-button>
+            <el-radio-button :label="0" v-if="dataForm.voucherType!=3">全场通用</el-radio-button>
+            <el-radio-button :label="1" v-if="dataForm.voucherType!=3">指定分类</el-radio-button>
             <el-radio-button :label="2">指定商品</el-radio-button>
           </el-radio-group>
         </el-form-item>
@@ -225,6 +239,7 @@ import { createStorage, uploadPath } from "@/api/storage";
 import { defaultCouponTypeOptions, ArrayToObject } from "@/api/enumUtils"
 import { getToken } from "@/utils/auth";
 
+
 const voucherTypeData = [
   {
     label: "立减券",
@@ -234,6 +249,10 @@ const voucherTypeData = [
     label: "折扣券",
     value: 2,
   },
+  {
+    label: "商品兑换券",
+    value: 3,
+  },
 ];
 
 
@@ -326,7 +345,8 @@ export default {
         goodsId: null, // 指定商品控件 绑定值
         goodsCate: null, // 指定分类
         voucherType: 1, //默认1立减券
-        priceType: 0//结算类型
+        priceType: 0,//结算类型
+        goodsNum:1 //兑换商品数
       },
       dialogFormVisible: false,
       dialogStatus: "",
@@ -338,22 +358,22 @@ export default {
         name: [
           { required: true, message: "优惠券标题不能为空", trigger: "blur" },
         ],
-        min: [{ required: true, message: "最低消费不能为空", trigger: "blur" }],
+        //min: [{ required: true, message: "最低消费不能为空", trigger: "blur" }],
         limit: [
           { required: true, message: "每人限领不能为空", trigger: "blur" },
         ],
-        discount: [
+        /*discount: [
           { required: true, message: "折扣或立减不能为空", trigger: "blur" },
-        ],
+        ],*/
       },
       downloadLoading: false,
     };
   },
   created() {
-    this.getList();
     allChannel().then((res) => {
       this.channels = res.data.data;
     });
+    this.getList();
     console.info(this.typeOptions)
   },
   computed: {
@@ -444,6 +464,7 @@ export default {
       this.$nextTick(() => {
         this.$refs["dataForm"].clearValidate();
       });
+      this.dataForm.goodsNum=1
     },
     createData() {
       if (this.dataForm.type == 2 && this.dataForm.total == 0) {
@@ -455,7 +476,24 @@ export default {
         return;
       }
 
+      if (this.dataForm.voucherType == 1) {
+        //最低消费
+        if (this.dataForm.min=='') {
+          this.$notify.error({
+            title: "失败",
+            message: "最低消费不能为空!",
+          });
+          return;
+        }
+      }
       if (this.dataForm.voucherType == 2) {
+        if (this.dataForm.discount=='') {
+          this.$notify.error({
+            title: "失败",
+            message: "折扣券不能为空!",
+          });
+          return;
+        }
         //折扣券
         if (this.dataForm.discount > 100 || this.dataForm.discount < 1) {
           this.$notify.error({
@@ -465,7 +503,15 @@ export default {
           return;
         }
       }
-
+      if (this.dataForm.voucherType == 3) {
+        if (this.dataForm.goodsId==null) {
+          this.$notify.error({
+            title: "失败",
+            message: "请选择指定商品!",
+          });
+          return;
+        }
+      }
       this.$refs["dataForm"].validate((valid) => {
         if (valid) {
           createCoupon(this.dataForm)
@@ -598,6 +644,18 @@ export default {
         this.downloadLoading = false;
       });
     },
+    formateChannel(channelId){
+      if(channelId==null||channelId==''){
+        return;
+      }
+      let nm='';
+      this.channels.forEach(f=>{
+        if(f.id==channelId){
+          nm=f.name;
+        }
+      })
+      return nm;
+    },
   },
 };
 </script>
@@ -634,4 +692,4 @@ export default {
 
 .el-form--label-left .el-form-item__label {
   text-align: center;
-}</style>
+}</style>

+ 61 - 22
src/views/promotion/couponDetail.vue

@@ -14,11 +14,12 @@
         <el-col :span="4" class="table-cell">{{ coupon.name }}</el-col>
         <el-col :span="4" class="table-cell">{{ coupon.desc }}</el-col>
         <el-col :span="4" class="table-cell">{{ coupon.tag }}</el-col>
-        <el-col :span="4" class="table-cell">{{ coupon.type | formatType }}</el-col>
+        <el-col :span="4" class="table-cell" style="line-height:20px">{{ coupon.type | formatType }} 使用渠道:{{ formateChannel(coupon.channelId)
+          }}</el-col>
         <el-col :span="4" class="table-cell">满{{ coupon.min }}元可用</el-col>
         <el-col :span="4" class="table-cell">
-          <span v-if="coupon.voucherType==1">减免{{ coupon.discount }}元</span>
-          <span v-if="coupon.voucherType==2">折扣率{{ coupon.discount }}%</span>
+          <span v-if="coupon.voucherType == 1">减免{{ coupon.discount }}元</span>
+          <span v-if="coupon.voucherType == 2">折扣率{{ coupon.discount }}%</span>
         </el-col>
       </el-row>
       <el-row>
@@ -52,9 +53,12 @@
       <el-select v-model="listQuery.status" clearable style="width: 200px" class="filter-item" placeholder="请选择使用状态">
         <el-option v-for="type in useStatusOptions" :key="type.value" :label="type.label" :value="type.value" />
       </el-select>
-      <el-button v-permission="['GET /admin/coupon/listuser']" class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查找</el-button>
-      <el-button v-permission="['POST /admin/coupon/export']" class="filter-item" type="primary" icon="el-icon-download" @click="handleExport">导出</el-button>
-      <el-button v-permission="['POST /admin/coupon/batchCollection']" class="filter-item" type="primary" icon="el-icon-thumb" @click="handleAssignMember">领取</el-button>
+      <el-button v-permission="['GET /admin/coupon/listuser']" class="filter-item" type="primary" icon="el-icon-search"
+        @click="handleFilter">查找</el-button>
+      <el-button v-permission="['POST /admin/coupon/export']" class="filter-item" type="primary" icon="el-icon-download"
+        @click="handleExport">导出</el-button>
+      <el-button v-permission="['POST /admin/coupon/batchCollection']" class="filter-item" type="primary"
+        icon="el-icon-thumb" @click="handleAssignMember">领取</el-button>
     </div>
 
     <!-- 查询结果 -->
@@ -67,10 +71,12 @@
       <el-table-column align="center" label="订单号" prop="order.orderSn" />
       <el-table-column align="center" label="用户手机" prop="customer.tel" />
       <el-table-column align="center" label="券包兑换码" prop="couponPackage.pkCode">
-        <template slot-scope="scope"><span style="color:red" v-if="scope.row.couponPackage">{{scope.row.couponPackage.pkCode}}</span></template>
+        <template slot-scope="scope"><span style="color:red" v-if="scope.row.couponPackage">{{
+          scope.row.couponPackage.pkCode }}</span></template>
       </el-table-column>
       <el-table-column align="center" label="券包名称" prop="couponPackage.pkName">
-        <template slot-scope="scope"><span style="color:red" v-if="scope.row.couponPackage">{{scope.row.couponPackage.pkName}}</span></template>
+        <template slot-scope="scope"><span style="color:red" v-if="scope.row.couponPackage">{{
+          scope.row.couponPackage.pkName }}</span></template>
       </el-table-column>
       <el-table-column align="center" label="兑换码" prop="couponCode" />
 
@@ -79,7 +85,7 @@
 
       <el-table-column align="center" label="领取时间" prop="addTime" />
       <el-table-column align="center" label="领取状态" prop="id">
-        <template slot-scope="scope">{{ scope.row.referenceId?'已领取':'未领取' }}</template>
+        <template slot-scope="scope">{{ scope.row.referenceId ? '已领取' : '未领取' }}</template>
       </el-table-column>
       <el-table-column align="center" label="使用状态" prop="status">
         <template slot-scope="scope">{{ scope.row.status | formatUseStatus }}</template>
@@ -88,30 +94,39 @@
       <el-table-column align="center" label="订单ID" prop="orderId" />
       <el-table-column align="center" label="订单状态" prop="orderStatus">
         <template slot-scope="scope">
-          <el-tag>{{ orderStatusFilter(scope.row.order==null?null:scope.row.order.orderStatus)}}</el-tag>
+          <el-tag>{{ orderStatusFilter(scope.row.order == null ? null : scope.row.order.orderStatus) }}</el-tag>
         </template>
       </el-table-column>
 
       <el-table-column align="center" label="使用时间" prop="usedTime" />
       <el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope" v-if="!scope.row.couponPackage">
-          <el-button v-if="scope.row.deleted==false&&scope.row.status!=1&&scope.row.status!=3&&scope.row.mobile == null" v-permission="['GET /admin/coupon/send']" style="width:100px" icon="el-icon-chat-dot-round" type="text" size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
-          <el-button v-if="scope.row.deleted==false&&scope.row.status!=1&&scope.row.status!=3&&scope.row.mobile != null" v-permission="['GET /admin/coupon/rsend']" style="width:100px" icon="el-icon-refresh-left" type="text" size="mini" @click="handleRSend(scope.row)">补发预售短信</el-button>
+          <el-button
+            v-if="scope.row.deleted == false && scope.row.status != 1 && scope.row.status != 3 && scope.row.mobile == null"
+            v-permission="['GET /admin/coupon/send']" style="width:100px" icon="el-icon-chat-dot-round" type="text"
+            size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
+          <el-button
+            v-if="scope.row.deleted == false && scope.row.status != 1 && scope.row.status != 3 && scope.row.mobile != null"
+            v-permission="['GET /admin/coupon/rsend']" style="width:100px" icon="el-icon-refresh-left" type="text"
+            size="mini" @click="handleRSend(scope.row)">补发预售短信</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" />
+    <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
+      @pagination="getList" />
 
     <!-- 发送预售短信 -->
     <el-dialog title="发送预售短信" :visible.sync="dialogSendFormVisible" width="600px">
-      <el-form ref="sendForm" :rules="rules" :model="sendForm" status-icon label-position="left" label-width="100px" style="margin-left:20px;">
+      <el-form ref="sendForm" :rules="rules" :model="sendForm" status-icon label-position="left" label-width="100px"
+        style="margin-left:20px;">
         <el-form-item label="客户手机号" prop="mobile">
           <el-input v-model="sendForm.mobile" maxlength="11" type="number" />
         </el-form-item>
 
         <el-form-item label="短信内容" prop="name">
-          <el-input type="textarea" rows="5" disabled="disabled" value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-921-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
+          <el-input type="textarea" rows="5" disabled="disabled"
+            value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-921-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -121,11 +136,15 @@
     </el-dialog>
 
     <!---领取会员卡--->
-    <el-dialog :visible.sync="showAssign" title="批量领取优惠券" width="700px" :show-close="false" :close-on-click-modal="false" center>
-      <el-form ref="assignForm" :model="assignForm" :rules="assignFormRule" status-icon label-position="left" style="width:600px" label-width="100px">
+    <el-dialog :visible.sync="showAssign" title="批量领取优惠券" width="700px" :show-close="false"
+      :close-on-click-modal="false" center>
+      <el-form ref="assignForm" :model="assignForm" :rules="assignFormRule" status-icon label-position="left"
+        style="width:600px" label-width="100px">
         <el-form-item label="引荐人" prop="refereeId">
-          <el-select v-model="assignForm.refereeId" clearable style="width: 100%" class="filter-item" placeholder="请选择引荐人">
-            <el-option v-for="item in refereeList" :key="item.refereeId" :label="item.refereeName" :value="item.refereeId" />
+          <el-select v-model="assignForm.refereeId" clearable style="width: 100%" class="filter-item"
+            placeholder="请选择引荐人">
+            <el-option v-for="item in refereeList" :key="item.refereeId" :label="item.refereeName"
+              :value="item.refereeId" />
           </el-select>
         </el-form-item>
         <el-row :gutter="60">
@@ -138,13 +157,13 @@
             <el-form-item label="截至编号" prop="end">
               <el-input v-model="assignForm.end" type="number" placeholder="请输入截至编号" clearable />
             </el-form-item>
-            <span>共预计{{assignForm.end==null?0:(assignForm.end-assignForm.start+1)}}个优惠券</span>
+            <span>共预计{{ assignForm.end == null ? 0 : (assignForm.end - assignForm.start + 1) }}个优惠券</span>
           </el-col>
         </el-row>
       </el-form>
 
       <div slot="footer" class="dialog-footer">
-        <el-button @click="showAssign=false">取消</el-button>
+        <el-button @click="showAssign = false">取消</el-button>
         <el-button type="primary" @click="saveAssign('assignForm')">保存</el-button>
       </div>
     </el-dialog>
@@ -167,6 +186,7 @@ import {
 } from "@/api/enumUtils";
 import { refereeSelfList } from "@/api/referee";
 import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
+import { allChannel } from "@/api/channel";
 
 export default {
   name: "CouponDetail",
@@ -220,6 +240,7 @@ export default {
       useStatusOptions: Object.assign({}, defaultUseStatusOptions),
       coupon: {},
       list: [],
+      channels: [],
       total: 0,
       listLoading: true,
       listQuery: {
@@ -262,6 +283,10 @@ export default {
     };
   },
   created() {
+    allChannel().then((res) => {
+      this.channels = res.data.data;
+    });
+
     this.init();
     refereeSelfList().then((res) => {
       this.refereeList = res.data.data.list;
@@ -385,7 +410,7 @@ export default {
         return "未知";
       }
     },
-    getGoodsScope() {},
+    getGoodsScope() { },
     orderStatusFilter(status) {
       if (status == null) return "";
       return statusMap[status];
@@ -429,6 +454,18 @@ export default {
         }
       });
     },
+    formateChannel(channelId) {
+      if (channelId == null || channelId == '') {
+        return;
+      }
+      let nm = '';
+      this.channels.forEach(f => {
+        if (f.id == channelId) {
+          nm = f.name;
+        }
+      })
+      return nm;
+    },
   },
 };
 </script>
@@ -442,6 +479,7 @@ export default {
   border-left: 1px solid #dcdfe6;
   border-top: 1px solid #dcdfe6;
 }
+
 .table-cell {
   height: 60px;
   line-height: 40px;
@@ -453,6 +491,7 @@ export default {
   text-align: center;
   overflow: hidden;
 }
+
 .table-cell-title {
   border-right: 1px solid #dcdfe6;
   border-bottom: 1px solid #dcdfe6;

+ 95 - 21
src/views/promotion/couponPackage.vue

@@ -172,57 +172,71 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="每人限领" prop="limit">
+              <el-input disabled v-model="pkForm.limit">
+                <template slot="append">张</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
         <fieldset style="border-color: #d1c7b7; background: #fffef9">
           <legend style="color: #1890ff">优惠券分类</legend>
           <el-row :gutter="60">
             <el-col :span="12">
+              <el-form-item label="抵用类型" prop="coupondata.voucherType">
+                <el-select v-model="pkForm.coupondata.voucherType" style="width: 100%">
+                  <el-option v-for="type in voucherTypeData" :key="type.value" :label="type.label" :value="type.value" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
               <el-form-item label="优惠券名称" prop="coupondata.name">
                 <el-input v-model="pkForm.coupondata.name" clearable />
               </el-form-item>
             </el-col>
+          </el-row>
+          <el-row :gutter="60">
+
             <el-col :span="12">
               <el-form-item label="优惠券介绍" prop="coupondata.desc">
                 <el-input v-model="pkForm.coupondata.desc" clearable />
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row :gutter="60">
+
             <el-col :span="12">
               <el-form-item label="标签" prop="coupondata.tag">
                 <el-input v-model="pkForm.coupondata.tag" readonly />
               </el-form-item>
             </el-col>
+
+          </el-row>
+          <el-row :gutter="60">
+
             <el-col :span="12">
-              <el-form-item label="最低消费" prop="coupondata.min">
+              <el-form-item v-if="pkForm.coupondata.voucherType!=3" label="最低消费" prop="coupondata.min">
                 <el-input v-model.number="pkForm.coupondata.min">
                   <template slot="append">元</template>
                 </el-input>
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row :gutter="60">
-            <el-col :span="12">
-              <el-form-item label="抵用类型" prop="coupondata.voucherType">
-                <el-select v-model="pkForm.coupondata.voucherType" style="width: 100%">
-                  <el-option v-for="type in voucherTypeData" :key="type.value" :label="type.label" :value="type.value" />
-                </el-select>
-              </el-form-item>
-            </el-col>
+
             <el-col :span="12">
-              <el-form-item label="满减金额或折扣" prop="coupondata.discount">
+              <el-form-item  v-if="pkForm.coupondata.voucherType!=3"  label="满减金额或折扣" prop="coupondata.discount">
                 <el-input v-model.number="pkForm.coupondata.discount">
                   <template slot="append">元(折扣率1-100%)</template>
                 </el-input>
               </el-form-item>
             </el-col>
           </el-row>
-
           <el-row :gutter="60">
             <el-col :span="12">
               <el-form-item label="商品限制范围">
                 <el-radio-group v-model="pkForm.coupondata.goodsType" @change="chooseGOodsType" prop="coupondata.goodsType">
-                  <el-radio-button :label="0">全场通用</el-radio-button>
-                  <el-radio-button :label="1">指定分类</el-radio-button>
+                  <el-radio-button v-if="pkForm.coupondata.voucherType!=3"  :label="0">全场通用</el-radio-button>
+                  <el-radio-button v-if="pkForm.coupondata.voucherType!=3"  :label="1">指定分类</el-radio-button>
                   <el-radio-button :label="2">指定商品</el-radio-button>
                 </el-radio-group>
               </el-form-item>
@@ -231,8 +245,12 @@
               <el-form-item v-show="pkForm.coupondata.goodsType === 1" label="选择商品分类">
                 <el-cascader ref="mycascader" :options="categoryList" expand-trigger="hover" style="width: 300px" clearable @change="handleTypeChange" />
               </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="60">
+            <el-col :span="24">
               <el-form-item v-show="pkForm.coupondata.goodsType === 2" label="选择商品">
-                <el-cascader ref="mycascader2" :options="goodsList" expand-trigger="hover" style="width: 300px" clearable @change="handleTypeChange2" />
+                <el-cascader ref="mycascader2" v-model="pkForm.coupondata.goodsId" :options="goodsList" expand-trigger="hover" style="width: 900px" :props="{ expandTrigger: 'hover', value: 'value', label: 'label', multiple: true }" clearable @change="handleTypeChange3" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -304,6 +322,10 @@ const voucherTypeData = [
     label: "折扣券",
     value: 2,
   },
+  {
+    label: "商品兑换券",
+    value: 3,
+  },
 ];
 
 const defaultStatusOptions = [
@@ -345,7 +367,7 @@ export default {
         channel: undefined,
         startTime: null,
         endTime: null,
-
+        limit:1,
         coupondata: {
           type: 2, //兑换券
           goodsType: "", //商品限制范围
@@ -364,7 +386,7 @@ export default {
           goodsStr: "", //选择的商品或分类中文
           // status: 0,
           // days: 0,
-          // goodsId: null, // 指定商品控件 绑定值
+          goodsId: null, // 指定商品控件 绑定值
           // goodsCate: null, // 指定分类
         },
       },
@@ -376,12 +398,19 @@ export default {
             trigger: "blur",
           },
         ],
-        pkMoney: [
+        limit:[
           {
             required: true,
-            message: "卡券包金额不能为空",
+            message: "每人限领不能为空",
             trigger: "blur",
           },
+        ],
+        pkMoney: [
+        /*  {
+            required: true,
+            message: "卡券包金额不能为空",
+            trigger: "blur",
+          },*/
           { type: "number", message: "必须为数字值" },
         ],
         allPkNumber: [
@@ -523,6 +552,7 @@ export default {
         sort: "create_time",
         order: "desc",
       },
+      goods:[]
     };
   },
   created() {
@@ -622,6 +652,7 @@ export default {
         startTime: this.pkForm.startTime,
         endTime: this.pkForm.endTime,
         couponList: this.couponList, //子优惠券
+        limit: this.pkForm.limit
       };
 
       const loading = this.$loading({
@@ -657,6 +688,7 @@ export default {
       this.isShowAddDialogPk = true;
       //清空数据
       this.clearForm();
+      this.pkForm.limit=1
       //获取所有引荐人
       this.getReferee();
     },
@@ -786,6 +818,41 @@ export default {
         this.pkForm.coupondata.goodsStr = "";
       }
     },
+    handleTypeChange3(value) {
+      //选择商品
+      this.pkForm.coupondata.goodsValue = []; //只允许一个
+      if (value.length > 0) {
+        if (this.pkForm.coupondata.goodsType == "1") {
+          this.pkForm.coupondata.goodsId = [];
+          this.pkForm.coupondata.goodsValue.push(value[value.length - 1]);
+        }
+        else {
+          this.pkForm.coupondata.goodsId.forEach((item) => {
+            this.pkForm.coupondata.goodsValue.push(item[2]);
+          });
+
+        }
+        let goods=this.goods;
+        let goodsText="";
+        let selectEd=this.pkForm.coupondata.goodsValue
+        for (let k = 0; k < selectEd.length; k++) {
+          console.log(selectEd[k] )
+          for (let l = 0; l < goods.length; l++) {
+            console.log(goods[l].value)
+            if (selectEd[k] == goods[l].value) {
+              console.log(goods[l].label)
+              goodsText=goodsText.concat(goods[l].label).concat(" / ");
+
+              break;
+            }
+          }
+        }
+        goodsText = goodsText.substring(0,goodsText.length-3);
+        this.pkForm.coupondata.goodsStr = goodsText;
+      }else {
+        this.pkForm.coupondata.goodsStr = "";
+      }
+    },
     handleFilter() {
       this.listQuery.page = 1;
       this.getList();
@@ -824,6 +891,13 @@ export default {
           console.info(res);
           this.goodsList = res.data.data.goodsList;
           this.categoryList = res.data.data.categoryList;
+          for (let i = 0; i < this.goodsList.length; i++) {
+            for (let j = 0; j < this.goodsList[i].children.length; j++) {
+              for (let k = 0; k < this.goodsList[i].children[j].children.length; k++) {
+                this.goods.push(this.goodsList[i].children[j].children[k])
+              }
+            }
+          }
         })
         .catch(() => {});
     },

+ 293 - 36
src/views/promotion/couponPackageDetail.vue

@@ -1,31 +1,109 @@
 <template>
   <div class="app-container">
+    <div class="table-layout">
+      <div style="margin-top: 20px">
+        <svg-icon icon-class="shopping" style="color: #606266" />
+        <span class="font-small">卡券包</span>
+      </div>
+      <el-row>
+        <el-col :span="4" class="table-cell-title">卡券包名称</el-col>
+        <el-col :span="4" class="table-cell-title">卡券包金额</el-col>
+        <el-col :span="4" class="table-cell-title">卡券包数量</el-col>
+        <el-col :span="4" class="table-cell-title">所属渠道</el-col>
+        <el-col :span="4" class="table-cell-title">所属引荐人</el-col>
+        <el-col :span="4" class="table-cell-title">卡券包开始时间</el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="4" class="table-cell">{{ couponPackage.pkName }}</el-col>
+        <el-col :span="4" class="table-cell">{{ couponPackage.pkMoney }}</el-col>
+        <el-col :span="4" class="table-cell">{{ total }}</el-col>
+        <el-col :span="4" class="table-cell" style="line-height:20px">{{formateChannel(couponPackage.channel)}}</el-col>
+        <el-col :span="4" class="table-cell">{{ couponPackage.refereeName }}</el-col>
+        <el-col :span="4" class="table-cell">
+          {{ couponPackage.startTime }}
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="4" class="table-cell-title">卡券包到期时间</el-col>
+        <el-col :span="4" class="table-cell-title">每人限领</el-col>
+        <el-col :span="4" class="table-cell-title">分享二维码</el-col>
+        <!-- <el-col :span="4" class="table-cell-title">优惠兑换码</el-col> -->
+        <el-col :span="4" class="table-cell-title">分享短链</el-col>
+        <el-col :span="4" class="table-cell-title">发送短信</el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="4" class="table-cell" style="height: 120px">{{ couponPackage.endTime }}</el-col>
+        <el-col :span="4" class="table-cell" style="height: 120px">{{ couponPackage.limit}}</el-col>
+        <el-col :span="4" class="table-cell" style="text-align:center;padding-top: 5px;height: 120px">
+          <el-image :preview-src-list="[couponPackage.qrUrl]" :lazy="true" :src="couponPackage.qrUrl" style="width:100px"></el-image>
+        </el-col>
+        <el-col :span="4" class="table-cell"  style="word-wrap:break-word; height: 120px">{{couponPackage.shortChain}}</el-col>
+        <!-- <el-col :span="4" class="table-cell">{{ coupon.code }}</el-col> -->
+
+        <el-col :span="4" class="table-cell" style="height: 120px" >
+          <el-button
+                     v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
+                     type="text" size="mini" @click="handleSendNew()">发送短信</el-button>
+        </el-col>
+      </el-row>
+
+
+      <div style="margin-top: 20px">
+        <svg-icon icon-class="order-return" />
+        <span class="font-small">卷包内优惠卷</span>
+      </div>
+      <el-table :data="couponPackage.couponList" height="200px" :header-cell-style="{ background: '#f2f6fc' }"
+                style="width: 100%;margin-top: 20px;overflow-y: auto !important;" border>
+        <el-table-column label="优惠卷名称" align="center" prop="name" :key="Math.random()" >
+        </el-table-column>
+        <el-table-column label="优惠卷介绍" align="center" prop="desc">
+        </el-table-column>
+        <el-table-column label="最低消费" align="center" prop="min" />
+        <el-table-column label="满减金额/折扣率" align="center" prop="discount" >
+          <template slot-scope="scope1">
+            <span v-if="scope1.row.voucherType == 1">减免{{ scope1.row.discount }}元</span>
+            <span v-if="scope1.row.voucherType == 2">折扣率{{ scope1.row.discount }}%</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="商品范围限制" align="center" prop="goodsType" >
+          <template slot-scope="scope1">
+            {{ scope1.row.goodsType | formatGoodsType }}
+          </template>
+        </el-table-column>
+        <el-table-column label="所限商品、类型" align="center" prop="couponGoodsName" width="320px">
+          <template slot-scope="scope1">
+            <span style="color:red;font-size:12px;" v-html="scope1.row.couponGoodsName"> </span>
+          </template>
+
+        </el-table-column>
+      </el-table>
+    </div>
     <!-- 查询操作 -->
     <div class="filter-container">
-      <el-input v-model="listQuery.pkSn" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包编号" />
+<!--      <el-input v-model="listQuery.pkSn" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包编号" />-->
       <el-input v-model="listQuery.mobile" clearable class="filter-item" style="width: 160px;" placeholder="请输入用户手机" />
       <el-input v-model="listQuery.pkCode" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包码" />
       <el-select v-model="listQuery.isExchange" clearable style="width: 150px" class="filter-item" placeholder="请选择使用状态">
         <el-option key="0" label="未兑换" value="0" />
         <el-option key="1" label="已兑换" value="1" />
       </el-select>
-      <el-date-picker v-model="exchangeTimeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"
-        range-separator="至" start-placeholder="兑换开始日期" end-placeholder="兑换结束日期" :picker-options="{}" />
+<!--      <el-date-picker v-model="exchangeTimeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"-->
+<!--                      range-separator="至" start-placeholder="兑换开始日期" end-placeholder="兑换结束日期" :picker-options="{}" />-->
 
       <el-select v-model="listQuery.isPre" clearable style="width: 150px" class="filter-item" placeholder="请选择预售状态">
         <el-option key="0" label="未预售" value="0" />
         <el-option key="1" label="已预售" value="1" />
       </el-select>
       <el-input v-model="listQuery.preMobile" clearable class="filter-item" style="width: 150px;" placeholder="请输入预售手机" />
-      <el-date-picker v-model="timeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"
-        range-separator="至" start-placeholder="预售开始日期" end-placeholder="预售结束日期" :picker-options="{}" />
+<!--      <el-date-picker v-model="timeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"-->
+<!--                      range-separator="至" start-placeholder="预售开始日期" end-placeholder="预售结束日期" :picker-options="{}" />-->
 
       <el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
-        icon="el-icon-search" @click="handleFilter(false)">查找</el-button>
+                 icon="el-icon-search" @click="handleFilter(false)">查找</el-button>
       <el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
-        icon="el-icon-download" @click="handleFilter(true)">导出</el-button>
+                 icon="el-icon-download" @click="handleFilter(true)">导出</el-button>
       <el-button v-permission="['POST /admin/couponPackageDetail/import']" class="filter-item" type="primary"
-        icon="el-icon-upload2" @click="handleImport()">导入预售手机号</el-button>
+                 icon="el-icon-upload2" @click="handleImport()">导入预售手机号</el-button>
       <div style="display:inline;color:#09afff;font-size:12px">导入格式:券包名、券包编码、团长手机号、客户手机号;excel第一个sheet的第一行的表头</div>
     </div>
 
@@ -41,10 +119,10 @@
             ? 'success'
             : ''
             ">{{
-    scope.row.preMobile != null && scope.row.preMobile.length > 0
-    ? "已预售"
-    : "未预售"
-  }}</el-tag>
+              scope.row.preMobile != null && scope.row.preMobile.length > 0
+                ? "已预售"
+                : "未预售"
+            }}</el-tag>
         </template>
       </el-table-column>
 
@@ -66,8 +144,8 @@
       <el-table-column align="center" label="有效时间" prop="startTime">
         <template slot-scope="scope">
           <span>{{ scope.row.startTime | formatTime }}到{{
-            scope.row.endTime | formatTime
-          }}</span>
+              scope.row.endTime | formatTime
+            }}</span>
         </template>
       </el-table-column>
 
@@ -83,22 +161,22 @@
       <el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile == null"
-            v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
-            type="text" size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
+                     v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
+                     type="text" size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
           <el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile != null"
-            v-permission="['GET /admin/couponPackageDetail/rsend']" style="width:100px" icon="el-icon-refresh-left"
-            type="text" size="mini" @click="handleRSend(scope.row)">补发预售短信</el-button>
+                     v-permission="['GET /admin/couponPackageDetail/rsend']" style="width:100px" icon="el-icon-refresh-left"
+                     type="text" size="mini" @click="handleRSend(scope.row)">补发预售短信</el-button>
           <el-button v-if="scope.row.deleted == false" v-permission="['GET /admin/couponPackageDetail/delete']"
-            style="width:100px" icon="el-icon-delete" type="text" size="mini"
-            @click="handleDelete(scope.row)">券码作废</el-button>
+                     style="width:100px" icon="el-icon-delete" type="text" size="mini"
+                     @click="handleDelete(scope.row)">券码作废</el-button>
           <el-button v-permission="['GET /admin/couponPackageDetail/read']" type="text" size="mini" icon="el-icon-view"
-            @click="handleDetail(scope.row)">详情</el-button>
+                     @click="handleDetail(scope.row)">详情</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" />
+                @pagination="getList" />
 
     <el-dialog :visible.sync="detailFormVisible" title="详情" width="1000px" center>
       <el-table :data="detail" border>
@@ -135,10 +213,10 @@
         <el-table-column align="center" label="订单状态" prop="orderStatus">
           <template slot-scope="scope">
             <el-tag>{{
-              orderStatusFilter(
-                scope.row.order == null ? null : scope.row.order.orderStatus
-              )
-            }}</el-tag>
+                orderStatusFilter(
+                  scope.row.order == null ? null : scope.row.order.orderStatus
+                )
+              }}</el-tag>
           </template>
         </el-table-column>
 
@@ -157,8 +235,8 @@
 
         <el-table-column align="center" label="优惠券类型" prop="coupon.type">
           <template>兑换券 </template>
-        </el-table-column> 
-         <el-table-column align="center" label="有效期" prop="coupon.startTime"> 
+        </el-table-column>
+         <el-table-column align="center" label="有效期" prop="coupon.startTime">
           <template slot-scope="scope">{{scope.row.coupon.startTime}}至{{scope.row.coupon.endTime}}</template>
          </el-table-column>
         <el-table-column align="center" label="状态" prop="coupon.status">
@@ -175,7 +253,7 @@
 
     <el-dialog title="发送预售短信" :visible.sync="dialogSendFormVisible" width="600px">
       <el-form ref="sendForm" :rules="rules" :model="sendForm" status-icon label-position="left" label-width="100px"
-        style="margin-left:20px;">
+               style="margin-left:20px;">
         <el-form-item label="客户手机号" prop="mobile">
           <el-input v-model="sendForm.mobile" maxlength="11" type="number" placeholder="请输入接收短信的手机号码" />
         </el-form-item>
@@ -193,7 +271,7 @@
 
         <el-form-item label="短信内容" prop="name">
           <el-input type="textarea" rows="5" disabled="disabled"
-            value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-920-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
+                    value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-920-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -205,11 +283,11 @@
     <!-- 导入预售 -->
     <el-dialog title="预售信息导入" :visible.sync="dialogImportVisible">
       <el-form ref="dataForm" :rules="rules" :model="dataImportForm" status-icon label-position="left" label-width="100px"
-        style="width: 400px; margin-left:50px;">
+               style="width: 400px; margin-left:50px;">
 
         <el-form-item label="团长" prop="rid">
           <el-select v-model="dataImportForm.rid" style="width: 100%" class="filter-item" placeholder="请选择团长"
-            filterable="">
+                     filterable="">
             <el-option v-for="item in referees" :key="item.refereeId" :label="item.refereeName" :value="item.refereeId" />
           </el-select>
         </el-form-item>
@@ -236,6 +314,35 @@
         <el-button icon="el-icon-upload2" type="primary" @click="importConfirm">导入</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="发送预售短信" :visible.sync="dialogImportPhoneVisible">
+      <el-form ref="dataForm" :rules="rules" :model="dataImportPhoneForm" status-icon label-position="left" label-width="100px"
+               style="width: 600px; margin-left:50px;">
+        <el-button v-permission="['POST /admin/couponPackageDetail/import']" @click="importPhoneConfirm" class="filter-item" type="primary"
+                   icon="el-icon-upload2" >导入手机号</el-button>
+        <span style="margin-left: 30px;color: #0eaefc">导入格式(表头):客户手机号:第一个sheet的第一列</span>
+        <el-form-item label="手机号文件">
+          <input type="file" @change="getImportPhoneFile($event)" ref="fileupload" />
+          <span style="color: black">导入成功手机号<span style="color: red">{{importPhoneCount}}</span>个</span>
+        </el-form-item>
+        <el-form-item label="领取短链">
+          <span style="color: #0b0b0b">{{couponPackage.shortChain}}</span>
+        </el-form-item>
+         <el-form-item label="短信模板" prop="rid">
+          <el-select @change="selectTemplage" v-model="dataImportPhoneForm.smsTemplateId" style="width: 100%" class="filter-item" placeholder="请选择短信模板" filterable="">
+            <el-option v-for="item in smsTemplateList" :key="item.id" :label="item.templateName" :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="短信内容">
+          <el-input  type="textarea" disabled
+                 :rows="5"  v-model="dataImportPhoneForm.content" />
+        </el-form-item>
+     </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogImportPhoneVisible = false">取消</el-button>
+        <el-button icon="el-icon-upload2" type="primary" @click="sendPhoneMsg" >发送</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -248,7 +355,7 @@ import {
   packageDetailSend,
   listPackageDetailExport,
   packageImport,
-  packageDetailDelete,
+  packageDetailDelete, importPhone, sendSmsInPhone, getSmsTemplateByType,
 } from "@/api/couponpackage";
 import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
 import {
@@ -257,6 +364,7 @@ import {
   statusMap,
   defaultTypeOptions,
 } from "@/api/enumUtils";
+import {allChannel} from "@/api/channel";
 
 export default {
   name: "CouponPackageDetail",
@@ -359,11 +467,27 @@ export default {
       dataImportForm: {
         file: undefined,
       },
-      importResult: [], //导入结果
+      importResult: [], //导入结果,
+      couponPackage:{},
+      channels:[],
+      couponList:[],
+      dialogImportPhoneVisible: false,
+      dataImportPhoneForm: {
+        file: undefined,
+        smsTemplateId:'',
+        content:''
+      },
+      importPhoneCount:0,
+      importMarkers:'',
+      smsTemplateList:[]
+
     };
   },
   created() {
     this.init();
+    allChannel().then((res) => {
+      this.channels = res.data.data;
+    });
   },
   methods: {
     init: function () {
@@ -381,6 +505,7 @@ export default {
       if (this.listQuery.isExport == false) {
         listPackageDetail(this.listQuery).then((response) => {
           this.list = response.data.data.list;
+          this.couponPackage=this.list[0]
           this.total = response.data.data.total;
           this.listLoading = false;
         });
@@ -527,8 +652,8 @@ export default {
                 message: "短信补发成功",
               });
             }
-            else  
-              this.$message.warning(res.data.errmsg); 
+            else
+              this.$message.warning(res.data.errmsg);
           }
         )
           .catch((response) => {
@@ -606,6 +731,138 @@ export default {
         this.downloadLoading = false;
       });
     },
+    formateChannel(channelId) {
+      if (channelId == null || channelId == '') {
+        return;
+      }
+      let nm = '';
+      this.channels.forEach(f => {
+        if (f.id == channelId) {
+          nm = f.name;
+        }
+      })
+      return nm;
+    },
+    formatGoodsType(goodsType) {
+      if (goodsType === 0) {
+        return "全场通用";
+      } else if (goodsType === 1) {
+        return "指定分类";
+      } else {
+        return "指定商品";
+      }
+    },
+    handleSendNew(){
+      this.dialogImportPhoneVisible=true
+      this.importPhoneCount=0;
+      this.importMarkers='';
+      this.getSmsTemplate();
+    },
+    importPhoneConfirm() {
+      if (this.dataImportPhoneForm.file == "" || this.dataImportPhoneForm.file == undefined) {
+        this.$message.warning("请选择文件!");
+        return;
+      }
+      // console.info(this.dataImportForm.file.name)
+      if (this.dataImportPhoneForm.file.name.lastIndexOf("xlsx") < 0) {
+        this.$message.warning("请选择excel文件!");
+        return;
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: "文件导入中,请耐心等待...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      var formData = new window.FormData(); // vue 中使用 window.FormData(),否则会报 'FormData isn't definded'
+      formData.append("file", this.dataImportPhoneForm.file);
+      formData.append("pkSn", this.couponPackage.pkSn);
+
+      importPhone(formData)
+        .then((res) => {
+          console.log("导入返回数据", res);
+          loading.close();
+          if (res.data.errno == 0) {
+            if (res.data.data.count >= 1) {
+              this.importPhoneCount = res.data.data.count;
+              this.importMarkers = res.data.data.importMarkers;
+              console.log(2000)
+              console.log(this.importPhoneCount)
+              this.$message.success("导入"+this.importPhoneCount+"个手机号成功!")
+            }else {
+              this.$message.error("导入0个手机号,请联系管理员!")
+            }
+          } else {
+            this.$message.warning(res.data.errmsg);
+          }
+        })
+        .catch((err) => {
+          loading.close();
+          this.$message.warning(err.data.errmsg);
+        });
+    },
+    getImportPhoneFile: function (event) {
+      this.dataImportPhoneForm.file = event.target.files[0];
+      console.log(this.file);
+    },
+    sendPhoneMsg(){
+      if(this.importPhoneCount==0){
+        this.$message.error("请先导入手机号!");
+        return;
+      }
+      if(this.dataImportPhoneForm.smsTemplateId==''){
+        this.$message.error("请先选择短信模板!");
+        return;
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: "发送短信中,请耐心等待...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      var formData = new window.FormData(); // vue 中使用 window.FormData(),否则会报 'FormData isn't definded'
+      formData.append("importMarkers", this.importMarkers);
+      formData.append("content", this.dataImportPhoneForm.content);
+      sendSmsInPhone(formData)
+        .then((res) => {
+          console.log("发送短信数据", res);
+          loading.close();
+          if (res.data.errno == 0) {
+              console.log(2000)
+              this.$message.success("发送成功!")
+              this.dialogImportPhoneVisible=false;
+          } else {
+            this.$message.warning(res.data.errmsg);
+          }
+        })
+        .catch((err) => {
+          loading.close();
+          this.$message.warning(err.data.errmsg);
+        });
+
+    },
+    getSmsTemplate(){
+      getSmsTemplateByType({type:1})
+        .then((res) => {
+          if (res.data.errno == 0) {
+            console.log(res.data.data)
+            this.smsTemplateList=res.data.data;
+          } else {
+            this.$message.warning(res.data.errmsg);
+          }
+        })
+        .catch((err) => {
+          this.$message.warning(err.data.errmsg);
+        });
+    },
+    selectTemplage(){
+      let smsTemplateId=this.dataImportPhoneForm.smsTemplateId
+      let smsTemplate=this.smsTemplateList.find(item=>item.id==smsTemplateId);
+
+      this.dataImportPhoneForm.content=smsTemplate.content.replace("#changeable",this.couponPackage.shortChain);
+      console.log(smsTemplate)
+
+    }
   },
 };
 </script>

+ 644 - 0
src/views/promotion/couponPackageDetailOld.vue

@@ -0,0 +1,644 @@
+<template>
+  <div class="app-container">
+    <!-- 查询操作 -->
+    <div class="filter-container">
+      <el-input v-model="listQuery.pkSn" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包编号" />
+      <el-input v-model="listQuery.mobile" clearable class="filter-item" style="width: 160px;" placeholder="请输入用户手机" />
+      <el-input v-model="listQuery.pkCode" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包码" />
+      <el-select v-model="listQuery.isExchange" clearable style="width: 150px" class="filter-item" placeholder="请选择使用状态">
+        <el-option key="0" label="未兑换" value="0" />
+        <el-option key="1" label="已兑换" value="1" />
+      </el-select>
+      <el-date-picker v-model="exchangeTimeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"
+                      range-separator="至" start-placeholder="兑换开始日期" end-placeholder="兑换结束日期" :picker-options="{}" />
+
+      <el-select v-model="listQuery.isPre" clearable style="width: 150px" class="filter-item" placeholder="请选择预售状态">
+        <el-option key="0" label="未预售" value="0" />
+        <el-option key="1" label="已预售" value="1" />
+      </el-select>
+      <el-input v-model="listQuery.preMobile" clearable class="filter-item" style="width: 150px;" placeholder="请输入预售手机" />
+      <el-date-picker v-model="timeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"
+                      range-separator="至" start-placeholder="预售开始日期" end-placeholder="预售结束日期" :picker-options="{}" />
+
+      <el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
+                 icon="el-icon-search" @click="handleFilter(false)">查找</el-button>
+      <el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
+                 icon="el-icon-download" @click="handleFilter(true)">导出</el-button>
+      <el-button v-permission="['POST /admin/couponPackageDetail/import']" class="filter-item" type="primary"
+                 icon="el-icon-upload2" @click="handleImport()">导入预售手机号</el-button>
+      <div style="display:inline;color:#09afff;font-size:12px">导入格式:券包名、券包编码、团长手机号、客户手机号;excel第一个sheet的第一行的表头</div>
+    </div>
+
+    <!-- 查询结果 -->
+    <el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" border fit highlight-current-row>
+      <el-table-column align="center" label="客户手机" prop="customer.tel" />
+      <el-table-column align="center" label="客户名称" prop="customer.customerName" />
+      <el-table-column align="center" label="卡券包" prop="pkName" />
+      <el-table-column align="center" label="卡券包兑换码" prop="pkCode" />
+      <el-table-column align="center" label="是否已预售" prop="preMobile">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.preMobile != null && scope.row.preMobile.length
+            ? 'success'
+            : ''
+            ">{{
+              scope.row.preMobile != null && scope.row.preMobile.length > 0
+                ? "已预售"
+                : "未预售"
+            }}</el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column align="center" label="预售手机" prop="preMobile" />
+      <el-table-column align="center" label="预售时间" prop="preTime" />
+      <el-table-column align="center" label="抖音券号" prop="douyinCode" />
+
+      <el-table-column align="center" label="是否已兑换" prop="isExchange">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.isExchange == 0 ? 'success' : 'warning'">
+            <span v-if="scope.row.isExchange == 0">否</span>
+            <span v-if="scope.row.isExchange == 1">是</span>
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column align="center" label="兑换时间" prop="exchangeTime" />
+
+      <el-table-column align="center" label="有效时间" prop="startTime">
+        <template slot-scope="scope">
+          <span>{{ scope.row.startTime | formatTime }}到{{
+              scope.row.endTime | formatTime
+            }}</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column align="center" label="是否已作废" prop="deleted">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.deleted ? 'success' : 'warning'">
+            <span v-if="scope.row.deleted == false">有效</span>
+            <span v-if="scope.row.deleted">作废</span>
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile == null"
+                     v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
+                     type="text" size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
+          <el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile != null"
+                     v-permission="['GET /admin/couponPackageDetail/rsend']" style="width:100px" icon="el-icon-refresh-left"
+                     type="text" size="mini" @click="handleRSend(scope.row)">补发预售短信</el-button>
+          <el-button v-if="scope.row.deleted == false" v-permission="['GET /admin/couponPackageDetail/delete']"
+                     style="width:100px" icon="el-icon-delete" type="text" size="mini"
+                     @click="handleDelete(scope.row)">券码作废</el-button>
+          <el-button v-permission="['GET /admin/couponPackageDetail/read']" type="text" size="mini" icon="el-icon-view"
+                     @click="handleDetail(scope.row)">详情</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" />
+
+    <el-dialog :visible.sync="detailFormVisible" title="详情" width="1000px" center>
+      <el-table :data="detail" border>
+        <el-table-column align="center" label="优惠券码id" prop="id" />
+        <el-table-column align="center" label="优惠券名称" prop="coupon.name" />
+
+        <!-- <el-table-column align="center" label="最低消费" prop="coupon.min">
+          <template slot-scope="scope">满{{ scope.row.coupon.min }}元可用</template>
+        </el-table-column> -->
+
+        <el-table-column align="center" label="满减金额" prop="coupon.discount">
+          <template slot-scope="scope">
+            <span v-if="scope.row.coupon.voucherType == 1">减免{{ scope.row.coupon.discount }}元</span>
+            <span v-if="scope.row.coupon.voucherType == 2">折扣率{{ scope.row.coupon.discount }}%</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="领取时间" prop="exchangeTime" />
+
+        <el-table-column align="center" label="使用状态" prop="status">
+          <template slot-scope="scope">
+            {{ scope.row.status | formatUseStatus }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否已作废" prop="deleted">
+          <template slot-scope="scope">
+            <el-tag :type="scope.row.deleted ? 'success' : 'warning'">
+              <span v-if="scope.row.deleted == false">有效</span>
+              <span v-if="scope.row.deleted">作废</span>
+            </el-tag>
+          </template>
+        </el-table-column>
+
+        <el-table-column align="center" label="订单ID" prop="orderId" />
+        <el-table-column align="center" label="订单状态" prop="orderStatus">
+          <template slot-scope="scope">
+            <el-tag>{{
+                orderStatusFilter(
+                  scope.row.order == null ? null : scope.row.order.orderStatus
+                )
+              }}</el-tag>
+          </template>
+        </el-table-column>
+
+        <el-table-column align="center" label="使用时间" prop="usedTime" />
+        <!-- <el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button v-if="scope.row.status==0" v-permission="['GET /admin/couponPackageDetail/delete']" style="width:100px" icon="el-icon-delete" type="text" size="mini" @click="handleDelete(scope.row)">券码作废</el-button>
+          </template>
+        </el-table-column> -->
+
+        <!--  <el-table-column align="center" label="商品使用范围" prop="coupon.goodsType">
+          <template slot-scope="scope">{{
+            scope.row.coupon.goodsType | formatGoodsType
+          }}</template>
+        </el-table-column>
+
+        <el-table-column align="center" label="优惠券类型" prop="coupon.type">
+          <template>兑换券 </template>
+        </el-table-column>
+         <el-table-column align="center" label="有效期" prop="coupon.startTime">
+          <template slot-scope="scope">{{scope.row.coupon.startTime}}至{{scope.row.coupon.endTime}}</template>
+         </el-table-column>
+        <el-table-column align="center" label="状态" prop="coupon.status">
+          <template slot-scope="scope">{{
+            scope.row.coupon.status | formatStatus
+          }}</template>
+        </el-table-column>  -->
+      </el-table>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="detailFormVisible = false">确定</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="发送预售短信" :visible.sync="dialogSendFormVisible" width="600px">
+      <el-form ref="sendForm" :rules="rules" :model="sendForm" status-icon label-position="left" label-width="100px"
+               style="margin-left:20px;">
+        <el-form-item label="客户手机号" prop="mobile">
+          <el-input v-model="sendForm.mobile" maxlength="11" type="number" placeholder="请输入接收短信的手机号码" />
+        </el-form-item>
+
+        <el-form-item label="抖音券号" prop="douyinCode">
+          <el-input v-model="sendForm.douyinCode" type="text" placeholder="请输入抖音原生核销券号" />
+        </el-form-item>
+
+        <!-- <el-form-item label="团长" prop="rid">
+          <el-select v-model="sendForm.rid" style="width: 100%" class="filter-item" placeholder="请选择团长" filterable="">
+            <el-option v-for="item in referees" :key="item.refereeId" :label="item.refereeName" :value="item.refereeId" />
+          </el-select>
+        </el-form-item> -->
+
+
+        <el-form-item label="短信内容" prop="name">
+          <el-input type="textarea" rows="5" disabled="disabled"
+                    value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-920-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogSendFormVisible = false">取消</el-button>
+        <el-button type="primary" @click="sendSms">立即发送</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 导入预售 -->
+    <el-dialog title="预售信息导入" :visible.sync="dialogImportVisible">
+      <el-form ref="dataForm" :rules="rules" :model="dataImportForm" status-icon label-position="left" label-width="100px"
+               style="width: 400px; margin-left:50px;">
+
+        <el-form-item label="团长" prop="rid">
+          <el-select v-model="dataImportForm.rid" style="width: 100%" class="filter-item" placeholder="请选择团长"
+                     filterable="">
+            <el-option v-for="item in referees" :key="item.refereeId" :label="item.refereeName" :value="item.refereeId" />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="excel文件">
+          <input type="file" @change="getFile($event)" ref="fileupload" />
+        </el-form-item>
+      </el-form>
+
+      <el-table :data="importResult" fit highlight-current-row>
+        <el-table-column align="center" label="券包名" prop="pkName" />
+        <el-table-column align="center" label="团长" prop="rName" />
+        <el-table-column align="center" label="团长手机号" prop="rmobile" />
+        <el-table-column align="center" label="客户手机号" prop="mobile" />
+        <el-table-column align="center" label="分配预售码" prop="coupon" />
+        <el-table-column align="center" label="导入结果" prop="remark" />
+      </el-table>
+      <div style="text-align:right">
+        <el-button type="text" icon="el-icon-download" @click="handleDownload()">结果导出</el-button>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogImportVisible = false">取消</el-button>
+        <el-button icon="el-icon-upload2" type="primary" @click="importConfirm">导入</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listRoots } from "@/api/referee";
+import {
+  listPackageDetail,
+  packageDetailRead,
+  packageDetailRSend,
+  packageDetailSend,
+  listPackageDetailExport,
+  packageImport,
+  packageDetailDelete,
+} from "@/api/couponpackage";
+import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
+import {
+  defaultCouponTypeOptions,
+  defaultUseStatusOptions,
+  statusMap,
+  defaultTypeOptions,
+} from "@/api/enumUtils";
+
+export default {
+  name: "CouponPackageDetail",
+  components: { Pagination },
+  filters: {
+    formatType(type) {
+      for (let i = 0; i < defaultCouponTypeOptions.length; i++) {
+        if (type === defaultCouponTypeOptions[i].value) {
+          return defaultCouponTypeOptions[i].label;
+        }
+      }
+      return "";
+    },
+    formatGoodsType(goodsType) {
+      if (goodsType === 0) {
+        return "全场通用";
+      } else if (goodsType === 1) {
+        return "指定分类";
+      } else {
+        return "指定商品";
+      }
+    },
+    formatStatus(status) {
+      if (status === 0) {
+        return "正常";
+      } else if (status === 1) {
+        return "已过期";
+      } else {
+        return "已下架";
+      }
+    },
+    formatUseStatus(status) {
+      if (status === 0) {
+        return "未使用";
+      } else if (status === 1) {
+        return "已使用";
+      } else if (status === 3) {
+        return "已过期";
+      } else if (status === 4) {
+        return "已占用";
+      } else if (status === 5) {
+        return "已注销";
+      } else {
+        return "已下架";
+      }
+    },
+
+    formatTime(value) {
+      if (value == null) return "";
+      return value.substring(0, 10);
+    },
+  },
+  data() {
+    return {
+      typeOptions: Object.assign({}, defaultTypeOptions),
+      useStatusOptions: Object.assign({}, defaultUseStatusOptions),
+      referees: [],
+      timeArray: [],
+      exchangeTimeArray: [],
+      coupon: {},
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        limit: 20,
+        pkCode: null,
+        isExchange: null,
+        pkSn: null,
+        isPre: "",
+        mobile: "",
+        status: "",
+        isExport: false, //是否导出
+        preMobile: "",
+        preStart: "",
+        preEnd: "",
+        exchangeStart: "",
+        exchangeEnd: "",
+        sort: "create_time",
+        order: "desc",
+      },
+      detailFormVisible: false,
+      detail: [],
+      downloadLoading: false,
+      statusMap: statusMap,
+      dialogSendFormVisible: false,
+      sendForm: {
+        mobile: "",
+        packageId: "",
+      },
+      rules: {
+        mobile: [
+          { required: true, message: "请输入发送的手机号", trigger: "blur" },
+        ],
+        douyinCode: [
+          { required: true, message: "请输入抖音核销券号", trigger: "blur" },
+        ],
+      },
+      dialogImportVisible: false,
+      dataImportForm: {
+        file: undefined,
+      },
+      importResult: [], //导入结果
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    init: function () {
+      if (this.$route.query.pkSn != null)
+        this.listQuery.pkSn = this.$route.query.pkSn;
+      this.getList();
+    },
+    getReferee() {
+      listRoots().then((res) => {
+        this.referees = res.data.data;
+      });
+    },
+    getList() {
+      this.listLoading = true;
+      if (this.listQuery.isExport == false) {
+        listPackageDetail(this.listQuery).then((response) => {
+          this.list = response.data.data.list;
+          this.total = response.data.data.total;
+          this.listLoading = false;
+        });
+      } else {
+        console.info("listPackageDetailExport");
+        listPackageDetailExport(this.listQuery)
+          .then((response) => {
+            let blob = new Blob([response.data], {
+              type: "application/vnd.ms-excel",
+            });
+            console.log(blob);
+            let fileName = Date.parse(new Date()) + ".xlsx";
+            if (window.navigator.msSaveOrOpenBlob) {
+              console.log(2);
+              navigator.msSaveBlob(blob, fileName);
+            } else {
+              console.log(3);
+              var link = document.createElement("a");
+              link.href = window.URL.createObjectURL(blob);
+              link.download = fileName;
+              link.click();
+              //释放内存
+              window.URL.revokeObjectURL(link.href);
+            }
+            this.listLoading = false;
+          })
+          .catch(() => {
+            this.list = [];
+            this.total = 0;
+            this.listLoading = false;
+          });
+      }
+    },
+    handleImport() {
+      this.dialogImportVisible = true;
+      if (this.referees.length == 0) {
+        this.getReferee();
+      }
+      this.dataImportForm = {
+        couponId: undefined,
+        file: undefined,
+        rid: "",
+      };
+      this.importResult = [];
+    },
+    getFile: function (event) {
+      this.dataImportForm.file = event.target.files[0];
+      console.log(this.file);
+    },
+    importConfirm() {
+      if (this.dataImportForm.file == "") {
+        this.$message.warning("请选择文件!");
+        return;
+      }
+      // console.info(this.dataImportForm.file.name)
+      if (this.dataImportForm.file.name.lastIndexOf("xlsx") < 0) {
+        this.$message.warning("请选择excel文件!");
+        return;
+      }
+      this.$refs["dataForm"].validate((valid) => {
+        if (!valid) {
+          return;
+        }
+      });
+
+      const loading = this.$loading({
+        lock: true,
+        text: "文件导入中,请耐心等待...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      var formData = new window.FormData(); // vue 中使用 window.FormData(),否则会报 'FormData isn't definded'
+      formData.append("file", this.dataImportForm.file);
+      formData.append("rid", this.dataImportForm.rid);
+
+      packageImport(formData)
+        .then((res) => {
+          console.log("导入返回数据", res);
+          loading.close();
+          if (res.data.errno == 0) {
+            this.$message.success(res.data.errmsg);
+            if (res.data.data.length >= 1) {
+              this.importResult = res.data.data;
+            }
+          } else {
+            this.$message.warning(res.data.errmsg);
+          }
+        })
+        .catch((err) => {
+          loading.close();
+          this.$message.warning(err.data.errmsg);
+        });
+    },
+    handleDelete(row) {
+      //券码作废
+      this.$confirm("确定将此码作废?已兑换未使用也将作废").then((res) => {
+        packageDetailDelete({ packageId: row.id })
+          .then((response) => {
+            this.$message.success("作废成功");
+            this.getList();
+          })
+          .catch((response) => {
+            this.$message.warning(response.data.errmsg);
+          });
+      });
+    },
+    handleSend(row) {
+      this.dialogSendFormVisible = true;
+      this.sendForm = {
+        mobile: "",
+        packageId: row.id,
+      };
+      if (this.referees.length == 0) this.getReferee();
+    },
+    sendSms() {
+      this.$refs["sendForm"].validate((valid) => {
+        if (valid) {
+          packageDetailSend(this.sendForm).then((res) => {
+            if (res.errno == 0) {
+              this.dialogSendFormVisible = false;
+              this.getList();
+              this.$notify.success({
+                title: "成功",
+                message: "短信发送成功",
+              });
+            } else {
+              this.$message.warning(res.data.errmsg);
+            }
+          })
+            .catch((response) => {
+              this.$message.warning(response.data.errmsg);
+            });
+        }
+      });
+    },
+    handleRSend(row) {
+      this.$confirm("确定补发此短信吗?").then((res) => {
+        packageDetailRSend({ mobile: row.preMobile, packageId: row.id }).then(
+          (res) => {
+            if (res.errno == 0) {
+              this.getList();
+              this.$notify.success({
+                title: "成功",
+                message: "短信补发成功",
+              });
+            }
+            else
+              this.$message.warning(res.data.errmsg);
+          }
+        )
+          .catch((response) => {
+            this.$message.warning(response.data.errmsg);
+          });;
+      });
+    },
+    handleFilter(isExport) {
+      this.listQuery.preStart = "";
+      this.listQuery.preEnd = "";
+      this.listQuery.exchangeStart = "";
+      this.listQuery.exchangeEnd = "";
+      if (this.timeArray && this.timeArray.length === 2) {
+        this.listQuery.preStart = this.timeArray[0];
+        this.listQuery.preEnd = this.timeArray[1];
+      }
+      if (this.exchangeTimeArray && this.exchangeTimeArray.length === 2) {
+        this.listQuery.exchangeStart = this.exchangeTimeArray[0];
+        this.listQuery.exchangeEnd = this.exchangeTimeArray[1];
+      }
+      // console.info(this.timeArray)
+      // console.info(this.exchangeTimeArray)
+      // console.info(this.listQuery)
+      this.listQuery.page = 1;
+      this.listQuery.isExport = isExport;
+      this.getList();
+    },
+    getTimeScope() {
+      if (this.coupon.timeType === 0) {
+        return "领取" + this.coupon.days + "天有效";
+      } else if (this.coupon.timeType === 1) {
+        return (
+          "自" + this.coupon.startTime + "至" + this.coupon.endTime + "有效"
+        );
+      } else {
+        return "未知";
+      }
+    },
+    handleDetail(row) {
+      packageDetailRead({ packageId: row.id }).then((res) => {
+        this.detail = res.data.data;
+        this.detailFormVisible = true;
+      });
+    },
+    orderStatusFilter(status) {
+      if (status == null) return "";
+      return statusMap[status];
+    },
+    handleDownload() {
+      import("@/vendor/Export2Excel").then((excel) => {
+        const tHeader = [
+          "券包名称",
+          "券编号",
+          "团长",
+          "团长手机",
+          "客户手机号",
+          "分配的券码",
+          "导入结果",
+        ];
+        const filterVal = [
+          "pkName",
+          "pkSn",
+          "rName",
+          "rmobile",
+          "mobile",
+          "coupon",
+          "remark",
+        ];
+        excel.export_json_to_excel2(
+          tHeader,
+          this.importResult,
+          filterVal,
+          "券包导入"
+        );
+        this.downloadLoading = false;
+      });
+    },
+  },
+};
+</script>
+<style scoped>
+.filter-container {
+  margin-top: 20px;
+}
+
+.table-layout {
+  margin-top: 20px;
+  border-left: 1px solid #dcdfe6;
+  border-top: 1px solid #dcdfe6;
+}
+
+.table-cell {
+  height: 60px;
+  line-height: 40px;
+  border-right: 1px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+  padding: 10px;
+  font-size: 14px;
+  color: #606266;
+  text-align: center;
+  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;
+}
+</style>