Prechádzať zdrojové kódy

订单新增订单来源信息

yfh 2 týždňov pred
rodič
commit
89bc8678cb

+ 52 - 1
src/views/store/storeOrder/healthStoreList.vue

@@ -12,6 +12,23 @@
         />
       </el-form-item>
 
+      <el-form-item label="订单来源" prop="appid">
+        <el-select
+          v-model="queryParams.orderSource"
+          placeholder="请选择订单来源"
+          clearable
+          size="small"
+          style="width: 100%"
+        >
+          <el-option
+            v-for="item in miniAppList"
+            :key="item.appId"
+            :label="item.appName"
+            :value="item.appId"
+          />
+        </el-select>
+      </el-form-item>
+
        <el-form-item label="运单号" prop="deliveryId">
         <el-input
           v-model="queryParams.deliveryId"
@@ -246,6 +263,15 @@
               <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
           </template>
       </el-table-column>
+      <el-table-column label="订单来源" align="center" prop="orderSource">
+        <template slot-scope="scope">
+          <!-- 先找出匹配的项 -->
+          <template v-if="getAppName(scope.row.orderSource)">
+            <el-tag>{{ getAppName(scope.row.orderSource) }}</el-tag>
+          </template>
+          <span v-else>{{ scope.row.orderSource || '' }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="物流结算状态" align="center" prop="deliveryPayStatus" >
           <template slot-scope="scope">
               <el-tag prop="status" v-for="(item, index) in deliveryPayStatusOptions"    v-if="scope.row.deliveryPayStatus==item.dictValue">{{item.dictLabel}}</el-tag>
@@ -456,6 +482,7 @@ import { getCompanyList } from "@/api/company/company";
 import { treeselect } from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {listAll} from "@/api/system/coursePlaySourceConfig";
 
 export default {
   components: { productOrder,productSelect,addUser,addUserAddress,Treeselect },
@@ -466,6 +493,7 @@ export default {
   },
   data() {
     return {
+      miniAppList: [],
       importMsgOpen:false,
       importMsg:"",
       deliveryPayStatusOptions:[],
@@ -495,7 +523,6 @@ export default {
         open:false,
         title:"商品选择"
       },
-      userStatusOptions:[],
       phone:null,
       address:[],
       addressloading: false,
@@ -613,6 +640,7 @@ export default {
     };
   },
   created() {
+    this.getAppList()
     getCompanyList().then(response => {
         this.companys = response.data;
          if(this.companys!=null&&this.companys.length>0){
@@ -745,6 +773,29 @@ export default {
       console.log(this.queryParams.status)
       this.getList();
     },
+    getAppName(orderSource) {
+      if (!orderSource || !this.miniAppList) return '';
+
+      const app = this.miniAppList.find(item => {
+        return String(item.appId) === String(orderSource);
+      });
+
+      console.log('匹配结果:', app);
+      return app ? app.appName : '';
+    },
+    getAppList() {
+      this.miniAppList = []
+      listAll().then(response => {
+        const { code, data } = response
+        if (code === 200) {
+          if (data) {
+            this.miniAppList = data.map(v => {
+              return { appId: v.appid, appName: v.name }
+            })
+          }
+        }
+      })
+    },
     /** 查询订单列表 */
     getList() {
       this.loading = true;

+ 52 - 1
src/views/store/storeOrder/index.vue

@@ -26,6 +26,23 @@
         />
       </el-form-item>
 
+        <el-form-item label="订单来源" prop="appid">
+          <el-select
+            v-model="queryParams.orderSource"
+            placeholder="请选择订单来源"
+            clearable
+            size="small"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in miniAppList"
+              :key="item.appId"
+              :label="item.appName"
+              :value="item.appId"
+            />
+          </el-select>
+        </el-form-item>
+
        <el-form-item label="运单号" prop="deliveryId">
         <el-input
           v-model="queryParams.deliveryId"
@@ -278,6 +295,15 @@
               <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
           </template>
       </el-table-column>
+      <el-table-column label="订单来源" align="center" prop="orderSource">
+        <template slot-scope="scope">
+          <!-- 先找出匹配的项 -->
+          <template v-if="getAppName(scope.row.orderSource)">
+            <el-tag>{{ getAppName(scope.row.orderSource) }}</el-tag>
+          </template>
+          <span v-else>{{ scope.row.orderSource || '' }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
           <template slot-scope="scope">
               <el-tag prop="status" v-for="(item, index) in deliveryStatusOptions"    v-if="scope.row.deliveryStatus==item.dictValue">{{item.dictLabel}}</el-tag>
@@ -489,6 +515,7 @@ import { getTcmScheduleList } from "@/api/company/schedule";
 import { treeselect } from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {listAll} from "@/api/system/coursePlaySourceConfig";
 
 export default {
   components: { productOrder,productSelect,addUser,addUserAddress,Treeselect },
@@ -499,6 +526,7 @@ export default {
   },
   data() {
     return {
+      miniAppList: [],
       importMsgOpen:false,
       importMsg:"",
       scheduleOptions:[],
@@ -529,7 +557,6 @@ export default {
         open:false,
         title:"商品选择"
       },
-      userStatusOptions:[],
       phone:null,
       address:[],
       addressloading: false,
@@ -649,6 +676,7 @@ export default {
     };
   },
   created() {
+    this.getAppList()
     getCompanyList().then(response => {
         this.companys = response.data;
          if(this.companys!=null&&this.companys.length>0){
@@ -681,6 +709,29 @@ export default {
     this.getItemsNum();
   },
   methods: {
+    getAppName(orderSource) {
+      if (!orderSource || !this.miniAppList) return '';
+
+      const app = this.miniAppList.find(item => {
+        return String(item.appId) === String(orderSource);
+      });
+
+      console.log('匹配结果:', app);
+      return app ? app.appName : '';
+    },
+    getAppList() {
+      this.miniAppList = []
+      listAll().then(response => {
+        const { code, data } = response
+        if (code === 200) {
+          if (data) {
+            this.miniAppList = data.map(v => {
+              return { appId: v.appid, appName: v.name }
+            })
+          }
+        }
+      })
+    },
     handleGenPayUrl(row){
       this.payQr.open=true;
       setTimeout(() => {