Bladeren bron

refactor(create-order): 优化发票信息和订单详情页面展示

- 修改发票信息表格列的标题和数据属性
- 更新发票状态的显示逻辑
- 在订单详情页面添加赠品数量和销售费用字段
- 优化订单服务类型为空时的显示处理
- 移除不必要的 console.log 语句

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 2 maanden geleden
bovenliggende
commit
b588c5ac07

+ 9 - 9
src/views/create-order/components/order-detail-submodule/InvoiceInfo.vue

@@ -69,8 +69,8 @@ export default {
   data() {
     return {
       invoiceColumns: [
-        { prop: 'invoice_number', label: '发票号', width: 160 },
-        { prop: 'invoice_code', label: '发票代码', width: 160 },
+        { prop: 'invoice_order_code', label: '发票ID', width: 160 },
+        { prop: 'invoice_number', label: '发票编号', width: 160 },
         { prop: 'invoice_money', label: '关联订单开票金额', width: 160 },
         { prop: 'invoice_status', label: '发票状态', width: 120 },
         { prop: 'code_url', label: '开票二维码', width: 188 },
@@ -113,14 +113,14 @@ export default {
       return (num / 100).toFixed(x)
     },
     backInvoiceStatus(val) {
-      if (val == 0) {
-          return '未申请'
+      if (val == -2) {
+          return '已冲红'
+      } else if (val == -1) {
+          return '失败'
+      } else if (val == 0) {
+          return '开票中'
       } else if (val == 1) {
-          return '已申请'
-      } else if (val == 2) {
-          return '已开具'
-      } else {
-          return '未申请'
+          return '成功'
       }
     },
     getInvoiceStatus(val) {

+ 17 - 19
src/views/create-order/components/order-detail-submodule/OrderDetailCardProductList.vue

@@ -64,6 +64,13 @@
                 <div v-else-if="item.key ==='phone'">
                   {{ item.label }}:{{ orderData.user_phone || '-' }}
                 </div>
+                <div v-else-if="item.key === 'giftCount'">
+                  {{ item.label }}:{{ product.filter.num || '-' }}个
+                </div>
+                <div v-else-if="item.key === 'sale_final_price'">
+                  {{ item.label }}:¥{{ getFilteredValue(product[item.key], item.filter)}}
+                </div>
+
                 <div v-else>{{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}</div>
               </div>
             </div>
@@ -131,9 +138,15 @@ export default {
         { label: '合同金额', key: 'final_price', span: 3},
         { label: '标准售价', key: 'original_price', span: 3},
         { label: '折扣率', key: 'rate', span: 3},
-        { label: '子账号数量', key: 'subAccountCount', span: 1, condition: () => this.parsedFilter.buyAccountCount || this.parsedFilter.giftAccountCount },
+        { label: '子账号数量', key: 'subAccountCount', span: 1, condition: (product) => product.filter.buyAccountCount || product.filter.giftAccountCount },
         { label: '主账号数量', key: 'mainAccountCount', span: 1 },
         { label: '关联订单', key: 'linkedOrder', span: 1},
+        { label: '赠品数量', key: 'giftCount', span: 1, condition: (product) => {
+          return product.tactics === '2' && product.filter.num && product.product_type !== '销售费用'
+        } },
+        { label: '销售费用', key: 'sale_final_price', span: 1, condition: (product) => {
+          return product.tactics === '2' && product.product_type === '销售费用'
+        }},
         { label: '补充说明', key: 'supExplanation', span: 1, condition: (product) => product.supExplanation && product.supExplanation !== '-' },
         { label: '开通权益手机号', key: 'phone', span: 3},
         { label: '服务开始时间', key: 'service_starttime', span: 3},
@@ -206,7 +219,7 @@ export default {
   },
   computed: {
     ...mapState({
-      orderDetail: state => state.order.orderDetail,
+      orderDetail: state => state.order.orderDetail
     }),
     // 对options展开
     associationTableData() {
@@ -286,6 +299,7 @@ export default {
                 linkedOrder,
                 bigServiceNames,
                 final_price: finalPrice,
+                sale_final_price: finalPrice,
                 original_price: originalPrice,
                 supExplanation,
                 ..._productArr[index] || {},
@@ -553,7 +567,7 @@ export default {
     getFilteredValue(value, filterName) {
       // 判断value是否是数字,或者是字符串数字
       if (typeof value === 'number' || /^\d+$/.test(value)) {
-        if(!value) return '0.00'
+        if(!value && filterName !== 'orderServiceType') return '0.00'
       }
       if (!filterName) return value || '-';
       return this[filterName](value);
@@ -576,22 +590,6 @@ export default {
       const matchedOption = paymentTypeOptions.find(option => option.value === val);
       return matchedOption ? matchedOption.label : val; // 如果未找到匹配项,返回原始值
     },
-    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      console.log('objectSpanMethod===', row, column, rowIndex, columnIndex);
-      if (columnIndex <= 3) {
-        if (rowIndex % 2 === 0) {
-          return {
-            rowspan: 2,
-            colspan: 1
-          };
-        } else {
-          return {
-            rowspan: 0,
-            colspan: 0
-          };
-        }
-      }
-    }
   }
 }
 </script>