Bläddra i källkod

2023-11-08修改侧边栏、大礼包,导出活动拆单新指定行标红

zhiquz 1 år sedan
förälder
incheckning
80b10fff3a

+ 1 - 1
.env.production

@@ -2,7 +2,7 @@
 ENV = 'production'
 
 # 正式
-VUE_APP_BASE_API = 'https://adminnew.jiuweiyun.work/api'
+VUE_APP_BASE_API = 'https://ht.cliu.cc/api'
 #测试
 #VUE_APP_BASE_API = '//api.appadmin.woaidakele.cn/api'
 

BIN
dist.zip


+ 1 - 0
package.json

@@ -84,6 +84,7 @@
     "vuedraggable": "2.20.0",
     "vuex": "3.1.0",
     "xlsx": "^0.14.1",
+    "xlsx-js-style": "^1.2.0",
     "xlsx-style": "^0.8.13"
   },
   "devDependencies": {

+ 17 - 0
src/api/giftA_b.js

@@ -9,6 +9,23 @@
 
 // 大礼包A-b
 import request from '@/utils/request'
+// 标记
+export function addSign(data) {
+  return request({
+    url: '/orders/add_list_tag',
+    method: 'post',
+    data
+  })
+}
+
+// 多个标记
+export function BatchAddTag(data) {
+  return request({
+    url: '/orders/BatchAddTag',
+    method: 'post',
+    data
+  })
+}
 
 // 获取所有活动
 export function activityList() {

+ 5 - 3
src/api/giftB.js

@@ -1,14 +1,16 @@
 /*
  * @Author: your name
  * @Date: 2021-08-09 14:58:40
- * @LastEditTime: 2021-08-23 14:30:25
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2023-11-06 16:05:07
+ * @LastEditors: zhiquz zhiquz@163.com
  * @Description: In User Settings Edit
  * @FilePath: \appadmin\src\api\giftB.js
  */
 import request from '@/utils/request'
 
-// list
+// 大礼包A、大礼包C
+
+// 大礼包C列表
 export function list(params) {
   return request({
     url: '/orders/get_agent_gift_bag',

+ 2 - 2
src/api/giftB_e.js

@@ -1,8 +1,8 @@
 /*
  * @Author: your name
  * @Date: 2021-08-09 14:58:40
- * @LastEditTime: 2021-08-23 14:30:25
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2023-11-06 15:43:45
+ * @LastEditors: zhiquz zhiquz@163.com
  * @Description: In User Settings Edit
  * @FilePath: \appadmin\src\api\giftB.js
  */

+ 281 - 0
src/api/gift_A_C.js

@@ -0,0 +1,281 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-09 14:58:40
+ * @LastEditTime: 2023-11-06 15:58:45
+ * @LastEditors: zhiquz zhiquz@163.com
+ * @Description: In User Settings Edit
+ * @FilePath: \appadmin\src\api\giftB.js
+ */
+import request from '@/utils/request'
+
+// 大礼包A、大礼包C
+
+// 大礼包C列表
+export function list(params) {
+  return request({
+    url: '/orders/get_agent_gift_bag',
+    method: 'get',
+    params
+  })
+}
+
+// 标记
+export function addSign(data) {
+  return request({
+    url: '/orders/add_list_tag',
+    method: 'post',
+    data
+  })
+}
+
+// 多个标记
+export function BatchAddTag(data) {
+  return request({
+    url: '/orders/BatchAddTag',
+    method: 'post',
+    data
+  })
+}
+
+// 导出
+export function toExport(params) {
+  return request({
+    url: '/orders/export_list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取所有活动
+export function activityList() {
+  return request({
+    url: '/activity/getactivityinfo',
+    method: 'get'
+  })
+}
+
+// 获取大礼包
+export function GetActivityLimit(params) {
+  return request({
+    url: '/orders/GetActivityLimit',
+    method: 'get',
+    params
+  })
+}
+
+// 获取手机号信息A
+export function GetUserInfo(params) {
+  return request({
+    url: '/UserImg/GetUserInfo',
+    method: 'get',
+    params
+  })
+}
+// 新增客户A
+export function AddUserImgInfo(data) {
+  return request({
+    url: '/UserImg/AddUserImgInfo',
+    method: 'post',
+    data
+  })
+}
+// 上传照片A
+export function uploadImage(data) {
+  return request({
+    url: '/UserImg/uploadImage',
+    method: 'post',
+    data
+  })
+}
+
+// 上传模板图A
+export function AddUpdateImg(params) {
+  return request({
+    url: '/UserImg/AddUpdateImg',
+    method: 'get',
+    params
+  })
+}
+// 上传模板图B
+export function AddUpdateImgB(params) {
+  return request({
+    url: '/UserImg/AddUpdateImgB',
+    method: 'get',
+    params
+  })
+}
+// 获取模板图A
+export function GetImgStatus(params) {
+  return request({
+    url: '/UserImg/GetImgStatus',
+    method: 'get',
+    params
+  })
+}
+
+// 获取模板图B
+export function GetImgStatusB(params) {
+  return request({
+    url: '/UserImg/GetImgStatusB',
+    method: 'get',
+    params
+  })
+}
+
+// 获取A礼包列表A
+export function GetUserList(params) {
+  return request({
+    url: '/UserImg/GetUserList',
+    method: 'get',
+    params
+  })
+}
+
+// 修改B
+export function UpdateUserImgInfoB(data) {
+  return request({
+    url: '/UserImg/UpdateUserImgInfoB ',
+    method: 'post',
+    data
+  })
+}
+
+// 修改A
+export function UpdateUserImgInfo(data) {
+  return request({
+    url: '/UserImg/UpdateUserImgInfo',
+    method: 'post',
+    data
+  })
+}
+
+// 重新生成A
+export function AgainCreateImg(params) {
+  return request({
+    url: '/UserImg/AgainCreateImg',
+    method: 'get',
+    params
+  })
+}
+// 重新生成B
+export function AgainCreateImgB(params) {
+  return request({
+    url: '/UserImg/AgainCreateImgB',
+    method: 'get',
+    params
+  })
+}
+
+// 批发商图 列表
+export function GetCrownInfo(params) {
+  return request({
+    url: '/UserImg/GetCrownInfo',
+    method: 'get',
+    params
+  })
+}
+// 批发商图 上传
+export function UpdateCrownImgInfo(data) {
+  return request({
+    url: '/UserImg/UpdateCrownImgInfo',
+    method: 'post',
+    data
+  })
+}
+// 删除A大礼包
+export function DeleteUserImg(params) {
+  return request({
+    url: '/UserImg/DeleteUserImg',
+    method: 'get',
+    params
+  })
+}
+// 修改时获取信息
+export function GetUserInfos(params) {
+  return request({
+    url: '/UserImg/GetUserInfos',
+    method: 'get',
+    params
+  })
+}
+// 导出地址信息
+export function ExportAddress(params) {
+  return request({
+    url: '/UserImg/ExportAddress',
+    method: 'get',
+    params
+  })
+}
+// 大礼包A-b上传模板状态
+export function GetImgStatus_b(params) {
+  return request({
+    url: '/UserImg/GetImgStatus_b',
+    method: 'get',
+    params
+  })
+}
+// 批发商服务获取礼包统计
+export function CrownBigGiftInfo(params) {
+  return request({
+    url: '/CrownBigGiftInfo',
+    method: 'get',
+    params
+  })
+}
+// 服务获取礼包统计
+export function BigGiftInfo(params) {
+  return request({
+    url: '/BigGiftInfo',
+    method: 'get',
+    params
+  })
+}
+// 获取礼包申请
+export function GetApplyList(params) {
+  return request({
+    url: '/BigGift/GetApplyList',
+    method: 'get',
+    params
+  })
+}
+// 获取下级经销商
+// export function GetNextInfo(data) {
+//   return request({
+//     url: '/user/GetNextInfo',
+//     method: 'get',
+//     params: data
+//   })
+// }
+
+// 获取下级经销商
+export function GetNextInfo(data) {
+  return request({
+    url: '/BigGift/GetUserInfo',
+    method: 'get',
+    params: data
+  })
+}
+// 修改客户信息
+export function editBelongToUser(data) {
+  return request({
+    url: '/BigGift/editBelongToUser',
+    method: 'post',
+    data
+  })
+}
+// 通过大礼包请求
+export function ApplySuccess(data) {
+  return request({
+    url: '/BigGift/ApplySuccess',
+    method: 'post',
+    data
+  })
+}
+// 修改大礼包
+export function UpdateApply(data) {
+  return request({
+    url: '/BigGift/UpdateApply',
+    method: 'post',
+    data
+  })
+}

+ 138 - 0
src/api/gift_B.js

@@ -0,0 +1,138 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-09 14:58:40
+ * @LastEditTime: 2023-11-06 16:19:51
+ * @LastEditors: zhiquz zhiquz@163.com
+ * @Description: In User Settings Edit
+ * @FilePath: \appadmin\src\api\giftB.js
+ */
+
+// 大礼包b
+import request from '@/utils/request'
+
+// 标记
+export function addSign(data) {
+  return request({
+    url: '/orders/add_list_tag',
+    method: 'post',
+    data
+  })
+}
+
+// 多个标记
+export function BatchAddTag(data) {
+  return request({
+    url: '/orders/BatchAddTag',
+    method: 'post',
+    data
+  })
+}
+
+// 获取所有活动
+export function activityList() {
+  return request({
+    url: '/activity/getactivityinfo',
+    method: 'get'
+  })
+}
+
+// 获取大礼包
+export function GetActivityLimit(params) {
+  return request({
+    url: '/orders/GetActivityLimit',
+    method: 'get',
+    params
+  })
+}
+
+// 获取手机号信息
+export function GetUserInfo(params) {
+  return request({
+    url: '/UserImg/GetUserInfo_b',
+    method: 'get',
+    params
+  })
+}
+// 新增客户
+export function AddUserImgInfo(data) {
+  return request({
+    url: '/UserImg/AddUserImgInfo_b',
+    method: 'post',
+    data
+  })
+}
+// 上传照片
+export function uploadImage(data) {
+  return request({
+    url: '/UserImg/uploadImage',
+    method: 'post',
+    data
+  })
+}
+// 上传模板图
+export function AddUpdateImgB(params) {
+  return request({
+    url: '/UserImg/AddUpdateImg_b',
+    method: 'get',
+    params
+  })
+}
+
+// 获取A礼包列表A
+export function list(params) {
+  return request({
+    url: '/UserImg/GetUserList_b',
+    method: 'get',
+    params
+  })
+}
+
+// 修改A
+export function UpdateUserImgInfoB(data) {
+  return request({
+    url: '/UserImg/UpdateUserImgInfo',
+    method: 'post',
+    data
+  })
+}
+
+// 重新生成A
+export function AgainCreateImgB(params) {
+  return request({
+    url: '/UserImg/AgainCreateImg_b',
+    method: 'get',
+    params
+  })
+}
+// 删除A大礼包
+export function DeleteUserImg(params) {
+  return request({
+    url: '/UserImg/DeleteUserImg',
+    method: 'get',
+    params
+  })
+}
+// 修改时获取信息
+export function GetUserInfos(params) {
+  return request({
+    url: '/UserImg/GetUserInfos',
+    method: 'get',
+    params
+  })
+}
+// 导出地址信息
+export function ExportAddress(params) {
+  return request({
+    url: '/UserImg/ExportAddress_b',
+    method: 'get',
+    params
+  })
+}
+// 大礼包A-b上传模板状态
+export function GetImgStatusB(params) {
+  return request({
+    url: '/UserImg/GetImgStatus_b',
+    method: 'get',
+    params
+  })
+}

+ 141 - 0
src/api/gift_D.js

@@ -0,0 +1,141 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-09 14:58:40
+ * @LastEditTime: 2023-11-06 16:25:06
+ * @LastEditors: zhiquz zhiquz@163.com
+ * @Description: In User Settings Edit
+ * @FilePath: \appadmin\src\api\giftB.js
+ */
+import request from '@/utils/request'
+
+// 大礼包D
+
+// list
+export function list(params) {
+  return request({
+    url: '/orders/get_agent_gift_bag_d',
+    method: 'get',
+    params
+  })
+}
+
+// 标记
+export function addSign(data) {
+  return request({
+    url: '/orders/add_list_tag',
+    method: 'post',
+    data
+  })
+}
+
+// 多个标记
+export function BatchAddTag(data) {
+  return request({
+    url: '/orders/BatchAddTag',
+    method: 'post',
+    data
+  })
+}
+
+// 导出
+export function toExport(params) {
+  return request({
+    url: '/orders/export_list_d',
+    method: 'get',
+    params
+  })
+}
+
+// 获取所有活动
+export function activityList() {
+  return request({
+    url: '/activity/getactivityinfo',
+    method: 'get'
+  })
+}
+
+// 获取大礼包
+export function GetActivityLimit(params) {
+  return request({
+    url: '/orders/GetActivityLimit',
+    method: 'get',
+    params
+  })
+}
+
+// 获取手机号信息B
+export function GetUserInfo(params) {
+  return request({
+    url: '/UserImg/GetUserInfo',
+    method: 'get',
+    params
+  })
+}
+// 上传照片
+export function uploadImage(data) {
+  return request({
+    url: '/UserImg/uploadImage',
+    method: 'post',
+    data
+  })
+}
+// 上传模板图B
+export function AddUpdateImgB(params) {
+  return request({
+    url: '/UserImg/AddUpdateImgB_d',
+    method: 'get',
+    params
+  })
+}
+
+// 获取模板图B
+export function GetImgStatusB(params) {
+  return request({
+    url: '/UserImg/GetImgStatusB_d',
+    method: 'get',
+    params
+  })
+}
+
+// 修改B
+export function UpdateUserImgInfoB(data) {
+  return request({
+    url: '/UserImg/UpdateUserImgInfoB ',
+    method: 'post',
+    data
+  })
+}
+
+// 重新生成B
+export function AgainCreateImgB(params) {
+  return request({
+    url: '/UserImg/AgainCreateImgB_d',
+    method: 'get',
+    params
+  })
+}
+
+// 批发商图 列表
+export function GetCrownInfo(params) {
+  return request({
+    url: '/UserImg/GetCrownInfo',
+    method: 'get',
+    params
+  })
+}
+// 批发商图 上传
+export function UpdateCrownImgInfo(data) {
+  return request({
+    url: '/UserImg/UpdateCrownImgInfo',
+    method: 'post',
+    data
+  })
+}
+// 修改时获取信息
+export function GetUserInfos(params) {
+  return request({
+    url: '/UserImg/GetUserInfos',
+    method: 'get',
+    params
+  })
+}

+ 2 - 2
src/pages/giftA/copy.vue

@@ -13,7 +13,7 @@
     <el-input v-model="listQuery.search_name" placeholder="客户昵称/姓名/手机号" style="width:300px" clearable />
     <el-button type="primary" @click="listQuery.page_index = 1;getList()">搜索</el-button>
     <!-- <el-button type="primary" style="margin-bottom: 15px" @click="toExport">导出</el-button> -->
-    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包A-b上传模板</el-button>
+    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包B上传模板</el-button>
     <span :class="imgStatus? 'green' : 'red'">{{ imgStatus? '(已上传)': '(未上传)' }}</span>
     <div style="margin: 10px 0;">
       <el-button type="primary" @click="getDia">新增</el-button>
@@ -418,7 +418,7 @@ export default {
           excel.export_json_to_excel({
             header,
             data: exportD,
-            filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包A-b`,
+            filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包B`,
             autoWidth: true,
             bookType: 'xlsx'
           })

+ 1 - 1
src/pages/giftA/index.vue

@@ -287,7 +287,7 @@ import { GetUserList, addSign, toExport, activityList, GetActivityLimit, BatchAd
   DeleteUserImg,
   GetUserInfos,
   ExportAddress
-} from '@/api/giftB'
+} from '@/api/gift_A_C'
 import { parseMoney } from '@/utils/index'
 import { formatter } from '@/filters/index'
 import { levelStatus } from '@/filters/common'

+ 5 - 5
src/pages/giftB/Cpfs.vue

@@ -10,7 +10,7 @@
     <el-select v-model="listQuery.tag" style="width: 200px" placeholder="请选择是否标记" @change="getindex()">
       <el-option v-for="(item,ix) in tagList" :key="ix" :label="item.title" :value="item.id" />
     </el-select>
-    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包C(批发商)上传模板</el-button>
+    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包D上传模板</el-button>
     <span :class="imgStatus? 'green' : 'red'">{{ imgStatus? '(已上传)': '(未上传)' }}</span>
     <div style="margin-top: 10px;">
       <el-input v-model="listQuery.search_name" placeholder="客户昵称/姓名/手机号" style="width:300px" clearable />
@@ -75,7 +75,7 @@
         label="礼包类型"
         align="center"
       >
-        <span>大礼包C(批发商)</span>
+        <span>大礼包D</span>
       </el-table-column>
       <el-table-column
         label="是否标记"
@@ -231,7 +231,7 @@ import { list, addSign, toExport, activityList, GetActivityLimit, BatchAddTag,
   UpdateUserImgInfoB,
   GetImgStatusB,
   AgainCreateImgB
-} from '@/api/giftB_e'
+} from '@/api/gift_D'
 import { parseMoney } from '@/utils/index'
 import { formatter } from '@/filters/index'
 export default {
@@ -711,14 +711,14 @@ export default {
         if (res.code === 200) {
           if (res.data && res.data.length > 0) {
             res.data.forEach(v => {
-              v.礼包类型 = '大礼包C(批发商)'
+              v.礼包类型 = '大礼包D'
             })
             import('@/vendor/Export2Excel').then(excel => {
               excel.export_json_to_excel({
                 header: Object.keys(res.data[0]),
                 data: res.data.map(listItem => Object.keys(res.data[0]).map(j => listItem[j])),
                 // filename: `${formatter(new Date(), 'yyyy-MM-dd')}${this.giftList[this.indexe].title}名单`,
-                filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包C(批发商)`,
+                filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包D`,
                 bookType: 'xlsx'
               })
             })

+ 5 - 5
src/pages/giftB/copy.vue

@@ -10,7 +10,7 @@
     <el-select v-model="listQuery.tag" style="width: 200px" placeholder="请选择是否标记" @change="getindex()">
       <el-option v-for="(item,ix) in tagList" :key="ix" :label="item.title" :value="item.id" />
     </el-select>
-    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包B(批发商)上传模板</el-button>
+    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包C上传模板</el-button>
     <span :class="imgStatus? 'green' : 'red'">{{ imgStatus? '(已上传)': '(未上传)' }}</span>
     <div style="margin-top: 10px;">
       <el-input v-model="listQuery.search_name" placeholder="客户昵称/姓名/手机号" style="width:300px" clearable />
@@ -75,7 +75,7 @@
         label="礼包类型"
         align="center"
       >
-        <span>大礼包B(批发商)</span>
+        <span>大礼包C</span>
       </el-table-column>
       <el-table-column
         label="是否标记"
@@ -231,7 +231,7 @@ import { list, addSign, toExport, activityList, GetActivityLimit, BatchAddTag,
   UpdateUserImgInfoB,
   GetImgStatusB,
   AgainCreateImgB
-} from '@/api/giftB_d'
+} from '@/api/gift_A_C'
 import { parseMoney } from '@/utils/index'
 import { formatter } from '@/filters/index'
 export default {
@@ -711,14 +711,14 @@ export default {
         if (res.code === 200) {
           if (res.data && res.data.length > 0) {
             res.data.forEach(v => {
-              v.礼包类型 = '大礼包B(批发商)'
+              v.礼包类型 = '大礼包C'
             })
             import('@/vendor/Export2Excel').then(excel => {
               excel.export_json_to_excel({
                 header: Object.keys(res.data[0]),
                 data: res.data.map(listItem => Object.keys(res.data[0]).map(j => listItem[j])),
                 // filename: `${formatter(new Date(), 'yyyy-MM-dd')}${this.giftList[this.indexe].title}名单`,
-                filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包B(批发商)`,
+                filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包C`,
                 bookType: 'xlsx'
               })
             })

+ 8 - 8
src/pages/giftB/index.vue

@@ -10,12 +10,12 @@
     <el-select v-model="listQuery.tag" style="width: 200px" placeholder="请选择是否标记" @change="getindex()">
       <el-option v-for="(item,ix) in tagList" :key="ix" :label="item.title" :value="item.id" />
     </el-select>
-    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包A(批发商)上传模板</el-button>
+    <el-button type="primary" style="margin-left:20px" @click="getImg">大礼包B上传模板</el-button>
     <span :class="imgStatus? 'green' : 'red'">{{ imgStatus? '(已上传)': '(未上传)' }}</span>
     <div style="margin-top: 10px;">
       <el-input v-model="listQuery.search_name" placeholder="客户昵称/姓名/手机号" style="width:300px" clearable />
       <el-button type="primary" @click="listQuery.page_index = 1;getList()">搜索</el-button>
-      <el-button type="primary" style="margin-bottom: 15px" @click="toExport">导出</el-button>
+      <el-button type="primary" style="margin-bottom: 15px" @click="toExport">导出地址信息</el-button>
     </div>
     <div v-if="tablelist" style="margin: 10px 0;"><el-button type="primary" @click="batch">批量标记</el-button></div>
     <el-table
@@ -75,7 +75,7 @@
         label="礼包类型"
         align="center"
       >
-        <span>大礼包A(批发商)</span>
+        <span>大礼包B</span>
       </el-table-column>
       <el-table-column
         label="是否标记"
@@ -226,12 +226,12 @@
 </template>
 <script>
 // api
-import { list, addSign, toExport, activityList, GetActivityLimit, BatchAddTag,
+import { list, addSign, ExportAddress, activityList, GetActivityLimit, BatchAddTag,
   uploadImage, AddUpdateImgB,
   UpdateUserImgInfoB,
   GetImgStatusB,
   AgainCreateImgB
-} from '@/api/giftB'
+} from '@/api/gift_B'
 import { parseMoney } from '@/utils/index'
 import { formatter } from '@/filters/index'
 export default {
@@ -700,7 +700,7 @@ export default {
     },
     async toExport() {
       this.loadingFull = true
-      await toExport({
+      await ExportAddress({
         type: 1,
         activity_id: this.listQuery.activity_id,
         // gift_id: this.listQuery.gift_id,
@@ -712,14 +712,14 @@ export default {
         if (res.code === 200) {
           if (res.data && res.data.length > 0) {
             res.data.forEach(v => {
-              v.礼包类型 = '大礼包A(批发商)'
+              v.礼包类型 = '大礼包B'
             })
             import('@/vendor/Export2Excel').then(excel => {
               excel.export_json_to_excel({
                 header: Object.keys(res.data[0]),
                 data: res.data.map(listItem => Object.keys(res.data[0]).map(j => listItem[j])),
                 // filename: `${formatter(new Date(), 'yyyy-MM-dd')}${this.giftList[this.indexe].title}名单`,
-                filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包A(批发商)`,
+                filename: `${formatter(new Date(), 'yyyy-MM-dd')}大礼包B`,
                 bookType: 'xlsx'
               })
             })

+ 1 - 1
src/pages/order/addOrder.vue

@@ -11,7 +11,7 @@
       <el-form label-width="80px" class="form">
         <el-form-item label="查询客户:">
           <el-select v-model="selectMemberTel" filterable placeholder="请输入客户手机号">
-            <el-option v-for="item in crownList" :key="item.id" :label="item.name" :value="item.mobile.match(/\d{11}/)" />
+            <el-option v-for="item in crownList" :key="item.id" :label="item.name" :value="item.mobile" />
           </el-select>
           <!-- <el-input v-model="selectMemberTel" placeholder="请输入客户手机号" maxlength="11" minlength="11" show-word-limit style="width: 300px" /> -->
         </el-form-item>

+ 85 - 25
src/pages/order/list.vue

@@ -902,6 +902,7 @@ import { accountBalance, addRecharge } from '@/api/order/examine'
 import { parseMoney } from '@/utils/index'
 import VDistpicker from 'v-distpicker'
 import examine from './examine2'
+import XLSX from 'xlsx-js-style'
 const giftList = {
   '订单编号': '',
   '快递公司': '',
@@ -2264,20 +2265,23 @@ export default {
     // 活动拆单新
     exporOrderthuodongNew() {
       if (this.chooseList.length) {
-        this.$request(chaidans({ id: this.chooseList.map(e => e.id) }), (res) => {
-          this.expressData = res
-          const exportData = this.getExportModuleNew()
-          import('@/vendor/Export2Excel').then(excel => {
-            excel.export_json_to_excel({
-              header: Object.keys(moduleList),
-              data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
-              filename: `${new Date().toLocaleDateString()}活动快递单导出`,
-              bookType: 'xlsx',
-              isCSV: true
-            })
-            this.dialog.export_order = false
-          })
+        this.$request(chaidan({ id: this.chooseList.map(e => e.id) }), (res) => {
+          this.changeExcelStyle(res)
         })
+        // this.$request(chaidans({ id: this.chooseList.map(e => e.id) }), (res) => {
+        //   this.expressData = res
+        //   const exportData = this.getExportModuleNew()
+        //   import('@/vendor/Export2Excel').then(excel => {
+        //     excel.export_json_to_excel({
+        //       header: Object.keys(moduleList),
+        //       data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
+        //       filename: `${new Date().toLocaleDateString()}活动快递单导出`,
+        //       bookType: 'xlsx',
+        //       isCSV: true
+        //     })
+        //     this.dialog.export_order = false
+        //   })
+        // })
       } else {
         let query = {}
         if (!this.highSearchFlag) {
@@ -2320,21 +2324,73 @@ export default {
           }
         }
         this.$request(chaidans(query), (res) => {
-          this.expressData = res
-          const exportData = this.getExportModuleNew()
-          import('@/vendor/Export2Excel').then(excel => {
-            excel.export_json_to_excel({
-              header: Object.keys(moduleList),
-              data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
-              filename: `${new Date().toLocaleDateString()}活动快递单导出`,
-              bookType: 'xlsx',
-              isCSV: true
-            })
-            this.dialog.export_order = false
-          })
+          this.changeExcelStyle(res)
         })
       }
     },
+    // 活动拆单新 改变导出表格 某一行文字颜色
+    changeExcelStyle(res) {
+      this.expressData = res
+      const exportData = this.getExportModuleNew()
+      const data = exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j]))
+      const header = Object.keys(moduleList)
+      header.push('是否满箱')
+
+      data.unshift(header) // 表头和表格内容拼在一起
+
+      const aoa = data
+      const date = new Date().toLocaleDateString().replace(/\//g, '-') // 名称不能包含以下任何字符:\ / ? * [
+      const filename = `${date}活动快递单导出.xlsx`
+      const ws_name = `${date}活动快递单`
+      const wb = XLSX.utils.book_new()
+      const ws = XLSX.utils.aoa_to_sheet(aoa)
+      var style = {
+        font: {
+          // bold: true,
+          color: { rgb: 'FFFF0000' }
+        }
+        // alignment: { horizontal: "center" },
+        // fill: { fgColor: { rgb: "FFFF0000" } },
+      }
+      // 获取列名
+      function getColumnName(num) {
+        var columnName = ''
+        while (num) {
+          const remainder = num % 26
+          if (remainder === 0) {
+            columnName = 'Z' + columnName
+            num = Math.floor(num / 26) - 1
+          } else {
+            columnName = String.fromCharCode(64 + remainder) + columnName
+            num = Math.floor(num / 26)
+          }
+        }
+        return columnName
+      }
+      const rowsToColor = {} // 保存需要上色的行
+
+      for (const cell in ws) {
+        if (cell[0] === '!') continue
+        const cell_position = XLSX.utils.decode_cell(cell)
+        const colName = getColumnName(cell_position.c + 1)
+
+        if (colName === 'AM' && ws[cell].v) {
+          rowsToColor[cell_position.r] = true // 保存需要上色的行
+        }
+      }
+      // 遍历所有单元格,为需要上色的行上色
+      for (const cell in ws) {
+        if (cell[0] === '!') continue
+        const cell_position = XLSX.utils.decode_cell(cell)
+        if (rowsToColor[cell_position.r] && cell_position.r !== 0) { // 不为第一行上色
+          if (!ws[cell].s) ws[cell].s = {}
+          Object.assign(ws[cell].s, style)
+        }
+      }
+      XLSX.utils.book_append_sheet(wb, ws, ws_name) // 将数据添加到工作薄
+      XLSX.writeFile(wb, filename) // 导出Excel
+      this.dialog.export_order = false
+    },
     // 非活动拆单
     async exporOrdertOrder() {
       if (this.chooseList.length) {
@@ -2684,6 +2740,7 @@ export default {
           obj['订单状态'] = info.status
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
+          obj['是否满箱'] = '精装满箱'
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['精装'][a].sec_attr === '男女款') {
@@ -2733,6 +2790,7 @@ export default {
           obj['订单状态'] = info.status
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
+          obj['是否满箱'] = `${item['普通'][b].main_attr === '高' ? '高腰' : '青春'}满箱`
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['普通'][b].sec_attr === '男女款') {
@@ -2782,6 +2840,7 @@ export default {
           obj['订单状态'] = info.status
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
+          obj['是否满箱'] = ''
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['精装混合'][c].sec_attr === '男女款') {
@@ -2831,6 +2890,7 @@ export default {
           obj['订单状态'] = info.status
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
+          obj['是否满箱'] = ''
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['普通混合'][d].sec_attr === '男女款') {

+ 19 - 19
src/router/auth.js

@@ -1427,39 +1427,39 @@ export const asyncRoutes = [
           noCache: true
         }
       },
+      {
+        path: 'giftCopy',
+        component: '/giftA/copy',
+        name: 'giftACopy',
+        meta: {
+          title: '大礼包B',
+          noCache: true
+        }
+      },
       // {
-      //   path: 'giftCopy',
-      //   component: '/giftA/copy',
-      //   name: 'giftACopy',
+      //   path: 'test',
+      //   component: '/giftB/test',
+      //   name: 'test',
       //   meta: {
-      //     title: '大礼包A-b',
+      //     title: '测试',
       //     noCache: true
       //   }
       // },
       // {
-      //   path: 'test',
-      //   component: '/giftB/test',
-      //   name: 'test',
+      //   path: 'giftB',
+      //   component: '/giftB/index',
+      //   name: 'giftBIndex',
       //   meta: {
-      //     title: '测试',
+      //     title: '大礼包B',
       //     noCache: true
       //   }
       // },
       {
-        path: 'giftB',
-        component: '/giftB/index',
-        name: 'giftBIndex',
-        meta: {
-          title: '大礼包A(批发商)',
-          noCache: true
-        }
-      },
-      {
         path: 'giftBCopy',
         component: '/giftB/copy',
         name: 'giftBCopy',
         meta: {
-          title: '大礼包B(批发商)',
+          title: '大礼包C',
           noCache: true
         }
       },
@@ -1468,7 +1468,7 @@ export const asyncRoutes = [
         component: '/giftB/Cpfs',
         name: 'giftBCpfs',
         meta: {
-          title: '大礼包C(批发商)',
+          title: '大礼包D',
           noCache: true
         }
       },

+ 2 - 4
vue.config.js

@@ -38,10 +38,8 @@ module.exports = {
     },
     proxy: {
       [process.env.VUE_APP_BASE_API]: {
-        target: `https://adminnew.jiuweiyun.work/`,
-        // target: `http://api.admin.app.jiuweiyun.cn`, // 正式
-        // target: `http://api.appadmin.woaidakele.cn`, // 测试
-        // target: `http://192.168.2.75:8082`, // 测试
+        // target: `https://ht.cliu.cc`, // 正式
+        target: `https://adfasdfa.cliu.cc/`, // 测试
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: '/api'