Prechádzať zdrojové kódy

修改导出订单报错

YY 2 rokov pred
rodič
commit
25b0db65bb

+ 1 - 1
src/components/orderParts/parts/detail-4.vue

@@ -134,7 +134,7 @@ export default {
           ['订单号', '产品名称', '产品规格', '购买数量'],
         ];
         for (const p2 of p1.goodsList) {
-          let p4 = [[p2.order_no, p2.goods.name, p2.name, p2.buy_num]];
+          let p4 = [[p2.order_no, p2.goods_name, p2.spec_name, p2.buy_num]];
           data.push(...p4);
         }
         const row = worksheet.getRow(1);

+ 16 - 13
src/views/platGroup/group/detail.vue

@@ -22,7 +22,7 @@
               >
                 <el-option v-for="item in goodsList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
               </el-select>
-              <p style="color: red">只能查询到设置团购金额的商品</p>
+              <!-- <p style="color: red">只能查询到设置团购金额的商品</p> -->
             </template>
             <template #leader>
               <el-select v-model="form.leader" filterable clearable remote :remote-method="leadSearch" placeholder="请输入团长" style="width: 100%">
@@ -160,13 +160,13 @@ export default {
       this.loading = true;
       let res = await this.goodsQuery({ name: value });
       if (this.$checkRes(res)) {
-        let list = [];
-        for (const p1 of res.data) {
-          let arr = await this.goodsConfigQuery({ goods: p1._id });
-          if (this.$checkRes(arr)) if (arr.total > 0) list.push(p1);
-        }
-        this.$set(this, 'goodsList', list);
-        // this.$set(this, 'goodsList', res.data);
+        // let list = [];
+        // for (const p1 of res.data) {
+        //   let arr = await this.goodsConfigQuery({ goods: p1._id });
+        //   if (this.$checkRes(arr)) if (arr.total > 0) list.push(p1);
+        // }
+        // this.$set(this, 'goodsList', list);
+        this.$set(this, 'goodsList', res.data);
       }
       this.loading = false;
     },
@@ -190,11 +190,14 @@ export default {
     // 保存
     async toSave({ data }) {
       let res;
-      if (this.id) res = await this.update(data);
-      else res = await this.create(data);
-      if (this.$checkRes(res)) {
-        this.$message({ type: `success`, message: `维护信息成功` });
-        this.toBack();
+      if (this.form.group_config.length == 0) this.$message({ type: `warning`, message: `该商品没有规格设置团购金额,请在商品管理设置` });
+      else {
+        if (this.id) res = await this.update(data);
+        else res = await this.create(data);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `维护信息成功` });
+          this.toBack();
+        }
       }
     },
     // 返回