yuhongqi 5 giorni fa
parent
commit
47e74c3f8a

+ 3 - 3
package.json

@@ -5,9 +5,9 @@
   "author": "FS",
   "license": "MIT",
   "scripts": {
-    "dev": "vue-cli-service serve",
-    "build:prod": "vue-cli-service build",
-    "build:stage": "vue-cli-service build --mode staging",
+    "dev": "set NODE_OPTIONS=--openssl-legacy-provider&& vue-cli-service serve",
+    "build:prod": "set NODE_OPTIONS=--openssl-legacy-provider&& vue-cli-service build",
+    "build:stage": "set NODE_OPTIONS=--openssl-legacy-provider&& vue-cli-service build --mode staging",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",

+ 9 - 0
src/api/live/liveRedConf.js

@@ -62,3 +62,12 @@ export function listLiveRedConfOn(query) {
   })
 }
 
+// 查询红包领取记录
+export function listLiveRedClaimRecords(query) {
+  return request({
+    url: '/live/liveUserRedRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+

+ 15 - 14
src/views/live/components/productOrder.vue

@@ -440,8 +440,13 @@
           <el-button size="mini" @click="updateErpOrder" >同步物流单号信息</el-button>
         </div>
         <el-form-item label="物流公司" prop="deliverySn" >
-          <el-select style="width:220px" v-model="editDyForm.deliverSn" placeholder="请选择" clearable size="small">
-            <el-option v-for="item in deliveryOptions" :key="item.key" :label="item.label" :value="item.value" />
+          <el-select style="width:220px" v-model="editDyForm.deliverSn" placeholder="请选择" clearable size="small" filterable>
+            <el-option
+              v-for="dict in deliveryOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="物流单号" prop="deliveryId"  >
@@ -593,14 +598,7 @@ export default {
         deliverName: null,
         deliverId: null,
       },
-      deliveryOptions: [
-        {key: "SF", label: "顺丰", value: "SF"},
-        {key: "EMS", label: "邮政", value: "EMS"},
-        {key: "ZTO", label: "中通", value: "ZTO"},
-        {key: "JD", label: "京东", value: "JD"},
-        {key: "DBL", label: "德邦", value: "DBL"},
-        {key: "YD", label: "韵达", value: "YD"}
-      ],
+      deliveryOptions: [],
       editForm: {
         orderType: null,
         status: null,
@@ -661,6 +659,9 @@ export default {
     this.getDicts("store_order_create_type").then((response) => {
       this.createTypeOptions = response.data;
     });
+    this.getDicts("sys_express_company").then((response) => {
+      this.deliveryOptions = response.data || [];
+    });
     getTcmScheduleList().then(response => {
       this.scheduleOptions = response.data;
     });
@@ -669,9 +670,9 @@ export default {
     'editDyForm.deliverSn': {
       handler(newValue) {
         // 找到对应的选项
-        const selectedOption = this.deliveryOptions.find(option => option.value === newValue);
+        const selectedOption = this.deliveryOptions.find(option => option.dictValue === newValue);
         // 如果找到了,就设置 deliverName;否则清空 deliverName
-        this.editDyForm.deliverName = selectedOption ? selectedOption.label : '';
+        this.editDyForm.deliverName = selectedOption ? selectedOption.dictLabel : '';
       },
       immediate: true // 立即执行一次,处理初始值
     }
@@ -798,8 +799,8 @@ export default {
         if (valid) {
           const payload = { ...this.editDyForm };
           if (!payload.deliverName) {
-            const selectedOption = this.deliveryOptions.find(option => option.value === payload.deliverSn);
-            payload.deliverName = selectedOption ? selectedOption.label : null;
+            const selectedOption = this.deliveryOptions.find(option => option.dictValue === payload.deliverSn);
+            payload.deliverName = selectedOption ? selectedOption.dictLabel : null;
           }
           updateDeliveryId(payload).then(response => {
             if (response.code === 200) {

+ 60 - 1
src/views/live/liveConfig/liveRedConf.vue

@@ -144,6 +144,13 @@
             v-hasPermi="['live:liveRedConf:edit']"
           >结算</el-button>
 
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleClaimRecords(scope.row)"
+            v-hasPermi="['live:liveRedConf:list']"
+          >领取记录</el-button>
           <el-button
             size="mini"
             type="text"
@@ -163,6 +170,28 @@
       @pagination="getList"
     />
 
+    <!-- 领取记录 -->
+    <el-dialog :title="claimDialog.title" :visible.sync="claimDialog.open" width="800px" append-to-body>
+      <el-table v-loading="claimDialog.loading" :data="claimDialog.list" border>
+        <el-table-column label="用户ID" align="center" prop="userId" width="100" />
+        <el-table-column label="昵称" align="center" prop="nickname" min-width="120" />
+        <el-table-column label="手机号" align="center" prop="phone" min-width="120" />
+        <el-table-column label="芳华币" align="center" prop="integral" width="100" />
+        <el-table-column label="领取时间" align="center" prop="createTime" width="170">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createTime) }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="claimDialog.total>0"
+        :total="claimDialog.total"
+        :page.sync="claimDialog.query.pageNum"
+        :limit.sync="claimDialog.query.pageSize"
+        @pagination="getClaimRecords"
+      />
+    </el-dialog>
+
     <!-- 添加或修改直播红包记录配置对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -196,7 +225,7 @@
 </template>
 
 <script>
-import { listLiveRedConf, getLiveRedConf, delLiveRedConf, addLiveRedConf, updateLiveRedConf, exportLiveRedConf } from "@/api/live/liveRedConf";
+import { listLiveRedConf, getLiveRedConf, delLiveRedConf, addLiveRedConf, updateLiveRedConf, exportLiveRedConf, listLiveRedClaimRecords } from "@/api/live/liveRedConf";
 
 export default {
   name: "LiveRedConf",
@@ -207,6 +236,18 @@ export default {
       redTypeOptions: [],
       canLiveId:false,
       //parentLiveId
+      claimDialog: {
+        open: false,
+        title: "领取记录",
+        loading: false,
+        list: [],
+        total: 0,
+        query: {
+          pageNum: 1,
+          pageSize: 10,
+          redId: null
+        }
+      },
       parentLiveId : null,
       // 遮罩层
       loading: true,
@@ -466,6 +507,24 @@ export default {
         }
       });
     },
+    /** 查看领取记录 */
+    handleClaimRecords(row) {
+      this.claimDialog.title = `领取记录(红包ID: ${row.redId})`;
+      this.claimDialog.query.redId = row.redId;
+      this.claimDialog.query.pageNum = 1;
+      this.claimDialog.open = true;
+      this.getClaimRecords();
+    },
+    getClaimRecords() {
+      this.claimDialog.loading = true;
+      listLiveRedClaimRecords(this.claimDialog.query).then(response => {
+        this.claimDialog.list = response.rows || [];
+        this.claimDialog.total = response.total || 0;
+        this.claimDialog.loading = false;
+      }).catch(() => {
+        this.claimDialog.loading = false;
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       //如果状态不为0,则不能删除

+ 13 - 17
src/views/live/liveOrder/liveOrderDetails.vue

@@ -372,13 +372,13 @@
           <el-button size="mini" @click="updateErpOrder" >同步物流单号信息</el-button>
         </div>
         <el-form-item label="物流公司" prop="deliveryCode" >
-          <el-select style="width:220px" v-model="editDyForm.deliveryCode" placeholder="请选择" clearable size="small">
-            <el-option key="SF"  label="顺丰" value="SF" />
-            <el-option key="EMS"  label="邮政" value="EMS" />
-            <el-option key="ZTO"  label="中通" value="ZTO" />
-            <el-option key="JD"  label="京东" value="JD" />
-            <el-option key="DBL"  label="德邦" value="DBL" />
-            <el-option key="YD"  label="韵达" value="YD" />
+          <el-select style="width:220px" v-model="editDyForm.deliveryCode" placeholder="请选择" clearable size="small" filterable>
+            <el-option
+              v-for="dict in deliveryOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="物流单号" prop="deliveryId"  >
@@ -466,14 +466,7 @@ export default {
         userId:null,
         followDoctorId:null,
       },
-      deliveryOptions: [
-        {key: "SF", label: "顺丰", value: "SF"},
-        {key: "EMS", label: "邮政", value: "EMS"},
-        {key: "ZTO", label: "中通", value: "ZTO"},
-        {key: "JD", label: "京东", value: "JD"},
-        {key: "DBL", label: "德邦", value: "DBL"},
-        {key: "YD", label: "韵达", value: "YD"}
-      ],
+      deliveryOptions: [],
       editDyForm:{
         id: null,
         orderId: null,
@@ -636,6 +629,9 @@ export default {
     this.getDicts("logistics_status").then(response => {
       this.deliveryTypeOptions = response.data;
     });
+    this.getDicts("sys_express_company").then(response => {
+      this.deliveryOptions = response.data || [];
+    });
 
   },
   methods: {
@@ -1072,8 +1068,8 @@ export default {
             params.id = this.editDyForm.id;
           }
           if (!params.deliverName) {
-            const selectedOption = this.deliveryOptions.find(option => option.value === params.deliverSn);
-            params.deliverName = selectedOption ? selectedOption.label : null;
+            const selectedOption = this.deliveryOptions.find(option => option.dictValue === params.deliverSn);
+            params.deliverName = selectedOption ? selectedOption.dictLabel : null;
           }
           editDeliveryId(params).then(response => {
             if (response.code === 200) {

+ 13 - 12
src/views/store/components/productOrder.vue

@@ -436,8 +436,13 @@
         <el-button size="mini" @click="updateErpOrder" >同步物流单号信息</el-button>
       </div>
         <el-form-item label="物流公司" prop="deliverySn" >
-          <el-select style="width:220px" v-model="editDyForm.deliverSn" placeholder="请选择" clearable size="small">
-            <el-option v-for="item in deliveryOptions" :key="item.key" :label="item.label" :value="item.value" />
+          <el-select style="width:220px" v-model="editDyForm.deliverSn" placeholder="请选择" clearable size="small" filterable>
+            <el-option
+              v-for="dict in deliveryOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="物流单号" prop="deliveryId"  >
@@ -588,14 +593,7 @@ export default {
         deliverName:null,
         deliverId:null,
       },
-      deliveryOptions: [
-        { key: "SF", label: "顺丰", value: "SF" },
-        { key: "EMS", label: "邮政", value: "EMS" },
-        { key: "ZTO", label: "中通", value: "ZTO" },
-        { key: "JD", label: "京东", value: "JD" },
-        { key: "DBL", label: "德邦", value: "DBL" },
-        {key: "YD", label: "韵达", value: "YD"}
-      ],
+      deliveryOptions: [],
       editForm:{
         orderType:null,
         status:null,
@@ -656,6 +654,9 @@ export default {
     this.getDicts("store_order_create_type").then((response) => {
       this.createTypeOptions = response.data;
     });
+    this.getDicts("sys_express_company").then((response) => {
+      this.deliveryOptions = response.data || [];
+    });
     getTcmScheduleList().then(response => {
       this.scheduleOptions = response.data;
     });
@@ -697,9 +698,9 @@ export default {
     'editDyForm.deliverSn': {
       handler(newValue) {
         // 找到对应的选项
-        const selectedOption = this.deliveryOptions.find(option => option.value === newValue);
+        const selectedOption = this.deliveryOptions.find(option => option.dictValue === newValue);
         // 如果找到了,就设置 deliverName;否则清空 deliverName
-        this.editDyForm.deliverName = selectedOption ? selectedOption.label : '';
+        this.editDyForm.deliverName = selectedOption ? selectedOption.dictLabel : '';
       },
       immediate: true // 立即执行一次,处理初始值
     }