浏览代码

包邮范围内的报错

yuhongqi 1 周之前
父节点
当前提交
546c8e130f

+ 73 - 0
src/views/live/liveConfig/goods.vue

@@ -58,6 +58,13 @@
         label="销量"
       ></el-table-column>
 
+      <el-table-column
+        prop="sort"
+        label="排序号"
+        width="100"
+        align="center"
+      ></el-table-column>
+
       <el-table-column
         prop="isShow"
         label="显示状态"
@@ -111,6 +118,12 @@
             style="color: #0066FF;"
             @click="handleGoodSale(scope.row)"
           >调整销量</el-button>
+          <el-button
+            type="text"
+            size="small"
+            style="color: #0066FF;"
+            @click="handleGoodSort(scope.row)"
+          >修改排序</el-button>
           <el-button
             type="text"
             size="small"
@@ -251,6 +264,31 @@
       </div>
     </el-dialog>
 
+    <el-dialog
+      title="修改排序"
+      :visible.sync="sortDialogVisible"
+      width="400px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <el-form :model="sortForm" ref="sortForm" :rules="sortRules">
+        <el-form-item label="排序号" prop="sort">
+          <el-input-number
+            v-model="sortForm.sort"
+            :min="0"
+            :max="999999"
+            controls-position="right"
+            style="width: 100%;"
+          ></el-input-number>
+          <div style="color: #909399; font-size: 12px; margin-top: 5px;">数字越小,排序越靠前</div>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="sortDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="confirmSortChange">确 定</el-button>
+      </div>
+    </el-dialog>
+
   </div>
   </div>
 </template>
@@ -287,6 +325,7 @@ export default {
       socket: null,
       stockDialogVisible: false,
       salesDialogVisible: false,
+      sortDialogVisible: false,
       stockForm: {
         goodsId: '',
         stock: 0
@@ -296,6 +335,10 @@ export default {
         sales: 0,
         productId: 0,
       },
+      sortForm: {
+        goodsId: '',
+        sort: 0
+      },
       stockRules: {
         stock: [
           { required: true, message: '请输入库存数量', trigger: 'blur' },
@@ -307,6 +350,12 @@ export default {
           { required: true, message: '请输入销量数量', trigger: 'blur' },
           { type: 'number', min: 0, message: '库存数量不能小于0', trigger: 'blur' }
         ]
+      },
+      sortRules: {
+        sort: [
+          { required: true, message: '请输入排序号', trigger: 'blur' },
+          { type: 'number', min: 0, message: '排序号不能小于0', trigger: 'blur' }
+        ]
       }
     };
   },
@@ -529,6 +578,11 @@ export default {
       this.salesForm.productId = row.productId;
       this.salesDialogVisible = true;
     },
+    handleGoodSort(row){
+      this.sortForm.goodsId = row.goodsId;
+      this.sortForm.sort = row.sort || 0;
+      this.sortDialogVisible = true;
+    },
     // 添加确认修改库存方法
     confirmStockChange() {
       this.$refs.stockForm.validate((valid) => {
@@ -568,6 +622,25 @@ export default {
         }
       });
     },
+    // 添加确认修改排序方法
+    confirmSortChange() {
+      this.$refs.sortForm.validate((valid) => {
+        if (valid) {
+          updateLiveGoods({
+            goodsId: this.sortForm.goodsId,
+            sort: this.sortForm.sort
+          }).then(response => {
+            if (response.code === 200) {
+              this.$message.success('排序修改成功');
+              this.sortDialogVisible = false;
+              this.getLiveGoodsList(); // 重新获取列表数据
+            } else {
+              this.$message.error(response.msg || '排序修改失败');
+            }
+          });
+        }
+      });
+    },
 
   }
 };

+ 1 - 1
src/views/live/liveOrder/liveOrderDetails.vue

@@ -164,7 +164,7 @@
         </el-table-column>
         <el-table-column label="出库价" width="240" align="center">
           <template slot-scope="scope">
-            <p>¥{{getOutboundPrice(scope.$index, scope.row).toFixed(2)}}</p>
+            <p>¥{{(scope.row.netPrice != null ? scope.row.netPrice : getOutboundPrice(scope.$index, scope.row)).toFixed(2)}}</p>
           </template>
         </el-table-column>
         <el-table-column label="市场价" width="240" align="center">

+ 2 - 2
src/views/store/components/productOrder.vue

@@ -237,7 +237,7 @@
         </el-table-column>
         <el-table-column label="出库价" width="240" align="center">
           <template slot-scope="scope">
-            <p>¥{{getOutboundPrice(scope.$index, scope.row).toFixed(2)}}</p>
+            <p>¥{{(scope.row.netPrice != null ? scope.row.netPrice : getOutboundPrice(scope.$index, scope.row)).toFixed(2)}}</p>
           </template>
         </el-table-column>
         <el-table-column label="规格" width="240" align="center">
@@ -257,7 +257,7 @@
         </el-table-column>
         <el-table-column label="小计"  align="center">
           <template slot-scope="scope" >
-            ¥{{scope.row.num*JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}
+            ¥{{(JSON.parse(scope.row.jsonInfo).price * 3).toFixed(2)}}
           </template>
         </el-table-column>
       </el-table>

+ 6 - 6
src/views/store/storeProduct/index.vue

@@ -330,8 +330,8 @@
                           <a @click="delAttrTable(scope.$index)" align="center">删除</a>
                         </div>
                         <div v-else-if="scope.column.property == 'taxRate'" align="center">
-                          <el-input 
-                            v-model="scope.row.taxRate" 
+                          <el-input
+                            v-model="scope.row.taxRate"
                             placeholder="请输入税率"
                             @input="handleTaxRateInput($event, scope.row)"
                           />
@@ -343,8 +343,8 @@
                     </el-table-column>
                     <el-table-column prop="taxRate" label="税率" align="center" width="150">
                       <template slot-scope="scope">
-                        <el-input 
-                          v-model="scope.row.taxRate" 
+                        <el-input
+                          v-model="scope.row.taxRate"
                           placeholder="请输入税率"
                           @input="handleTaxRateInput($event, scope.row)"
                         />
@@ -433,8 +433,8 @@
                 </el-table-column>
                 <el-table-column prop="taxRate" label="税率" align="center">
                   <template slot-scope="scope">
-                    <el-input 
-                      v-model="scope.row.taxRate" 
+                    <el-input
+                      v-model="scope.row.taxRate"
                       placeholder="请输入税率"
                       @input="handleTaxRateInput($event, scope.row)"
                     />