Bläddra i källkod

物流状态改为可修改&订单数据汇合

lxb 1 vecka sedan
förälder
incheckning
2478192830

+ 17 - 5
src/views/hisStore/components/productOrder.vue

@@ -306,11 +306,20 @@
             </el-select>
         </el-form-item>
 
-        <el-form-item label="物流状态" prop="deliveryStatus" v-if="editForm.oldDeliveryStatus==='4'">
-          <el-select  style="width:220px" v-model="editForm.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
+        <el-form-item label="物流状态" prop="deliveryStatus" >
+
+          <el-select  style="width:200px" v-model="editForm.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
+            <!-- 添加一个空选项,用于显示空值 -->
+            <el-option
+              v-if="editForm.deliveryStatus===''"
+              :key="''"
+              :label="''"
+              :value="editForm.deliveryStatus"
+              style="display: none;"
+            />
             <el-option
               v-for="item in deliveryStatusOptions"
-              :key="item.dictValue" :disabled="!(item.dictValue==='5' || item.dictValue===editForm.oldDeliveryStatus+'')"
+              :key="item.dictValue"
               :label="item.dictLabel"
               :value="item.dictValue"
             />
@@ -872,6 +881,9 @@ export default {
     submitEditForm(){
         this.$refs["editForm"].validate(valid => {
         if (valid) {
+          if ((this.editForm.deliveryStatus===0||this.editForm.deliveryStatus==='0') && (this.editForm.oldDeliveryStatus===null||this.editForm.oldDeliveryStatus===''||this.editForm.oldDeliveryStatus==='null'||this.editForm.oldDeliveryStatus===0||this.editForm.oldDeliveryStatus==='0') ){
+            this.editForm.deliveryStatus=this.editForm.oldDeliveryStatus
+          }
           updateStoreOrder(this.editForm).then(response => {
             if (response.code === 200) {
               this.msgSuccess("操作成功");
@@ -889,8 +901,8 @@ export default {
         this.editForm.mark=this.order.mark
         this.editForm.id=this.order.id;
         this.editForm.userPhone=null;
-        this.editForm.deliveryStatus=this.order.deliveryStatus+'';
-        this.editForm.oldDeliveryStatus=this.order.deliveryStatus+''
+        this.editForm.deliveryStatus=this.order.deliveryStatus===null?'0':this.order.deliveryStatus+'';
+        this.editForm.oldDeliveryStatus=this.order.deliveryStatus
         if(this.order.orderType!=null){
           this.editForm.orderType=this.order.orderType.toString();
         }

+ 27 - 3
src/views/hisStore/statistics/storeProduct.vue

@@ -108,7 +108,25 @@
                 <span :class="{'group-name': scope.row.isGroup}">{{ scope.row.name }}</span>
               </template>
             </el-table-column>
-
+            <!-- 汇总数据-->
+            <el-table-column label="汇总" align="center">
+              <el-table-column
+                label="数量"
+                width="60"
+                align="center"> <template slot-scope="scope">
+                {{ scope.row.totalCount || 0 }}
+              </template>
+              </el-table-column>
+              <!-- 金额子列 -->
+              <el-table-column
+                label="金额"
+                width="80"
+                align="center">
+                <template slot-scope="scope">
+                  {{ scope.row.totalAmount ? scope.row.totalAmount.toFixed(2) : '0.00' }}
+                </template>
+              </el-table-column>
+            </el-table-column>
             <!-- 动态生成订单类型列 - 使用多级表头 -->
             <el-table-column
               v-for="orderType in orderTypeOptions"
@@ -312,7 +330,8 @@ export default {
       return rawTableData.map(item => {
         // 创建一个新的 productCounts 对象,包含所有订单类型
         const processedProductCounts = {};
-
+        let totalCount = 0;
+        let totalAmount = 0.0;
         // 遍历所有订单类型选项,为每个类型设置默认值
         this.orderTypeOptions.forEach(orderType => {
           const dictValue = orderType.dictValue;
@@ -326,11 +345,16 @@ export default {
               amount: 0.0
             };
           }
+          // 累加汇总数据
+          totalCount += processedProductCounts[dictValue].count;
+          totalAmount += processedProductCounts[dictValue].amount;
         });
 
         return {
           ...item,
-          productCounts: processedProductCounts
+          productCounts: processedProductCounts,
+          totalCount: totalCount,
+          totalAmount: totalAmount
         };
       });
     },