Bladeren bron

fix(create-order): 优化发票功能和订单详情展示

- 在 InvoiceInfo 组件中,只有当 code_url 存在时才显示"查看开票二维码"按钮
- 在 OrderActions 组件中,移除了对 isAdminPage 的冗余判断
- 在 OrderDetailCardProductList 和 SelectOrderDetailCard 组件中,针对"阳光采购"产品类型进行了特殊处理
- 优化了 SelectOrderDetailCard 组件的初始化逻辑和数据处理方式
- 在 uploadInvoiceModule 组件中,添加了上传发票对话框的样式,限制最大高度并添加滚动条

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 maand geleden
bovenliggende
commit
d8c259d6b3

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

@@ -32,7 +32,7 @@
           </template>
           <template v-slot:code_url="{ row }">
             <div class="invoice-info-action">
-              <span class="column-cell" @click="getInvoiceInfo(row.row)">查看开票二维码</span>
+              <span class="column-cell" v-if="row.row.code_url" @click="getInvoiceInfo(row.row)">查看开票二维码</span>
               <span class="column-cell" v-if="showAgainBtn(row.row)" @click="againInvoce(row.row)">重新开票</span>
               <span class="column-cell" v-if="showEditBtn()" @click="editInvoice(row.row)">编辑发票</span>
             </div>
@@ -137,7 +137,8 @@ export default {
       // 按钮展示权限:发票状态为已开具或开票失败时,且管理后台用户群组为“财务”时才展示,否则不展示;
       const status = item.invoice_status === 1 || item.invoice_status === -1
       const root = Array.isArray(this.orderDetail?.userIdentity) && this.orderDetail?.userIdentity.includes(5)
-      return status && root
+      const url = item.code_url
+      return status && root && url
     },
     showEditBtn() {
       /**

+ 1 - 1
src/views/create-order/components/order-detail-submodule/OrderActions.vue

@@ -18,7 +18,7 @@
       <div class="order-action-item" v-if="isAdminPage && checkActionPower['协议归档']">
         <div class="order-action-text" @click="doActionByPower('协议归档')">协议归档</div>
       </div>
-      <div class="order-action-item" v-if="isAdminPage">
+      <div class="order-action-item">
         <div class="order-action-text" @click="doActionByPower('上传发票')">上传发票</div>
       </div>
       <div class="order-action-item" v-if="isAdminPage && newActionList.length > 0">

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

@@ -44,7 +44,7 @@
                 </div>
                 <div v-else-if="item.key === 'original_price'">
                   {{ item.label }}:
-                  <span v-if="!product.original_price" class="no_open_root">该产品暂无法计算标准售价</span>
+                  <span v-if="!product.original_price && product.product_type !== '阳光采购'" class="no_open_root">该产品暂无法计算标准售价</span>
                   <span v-else>¥{{ getFilteredValue(product[item.key], item.filter) || '-' }}</span>
                 </div>
                 <div v-else-if="item.key === 'validity_period'">

+ 18 - 13
src/views/create-order/components/order-detail-submodule/SelectOrderDetailCard.vue

@@ -77,7 +77,7 @@
                 </div>
                 <div v-else-if="item.key === 'original_price'">
                   {{ item.label }}:
-                  <span v-if="!product.original_price" class="no_open_root">该产品暂无法计算标准售价</span>
+                  <span v-if="!product.original_price && product.product_type !== '阳光采购'" class="no_open_root">该产品暂无法计算标准售价</span>
                   <span v-else>¥{{ getFilteredValue(product[item.key], item.filter) || '-' }}</span>
                     </div>
                     <div v-else-if="item.key === 'validity_period'">
@@ -101,7 +101,7 @@
                   {{ item.label }}:{{ product.filter.num || '-' }}个
                 </div>
                 <div v-else-if="item.key === 'sale_final_price'">
-                  {{ item.label }}:¥{{ product.filter.num }}
+                  {{ item.label }}:¥{{ divided(product.filter.num, 100) }}
                 </div>
 
                     <div v-else>{{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}</div>
@@ -200,7 +200,6 @@ export default {
   },
   data() {
     return {
-      orderDetailInfo: {},
       basicInfoItems: [
         { label: '创建人', key: 'create_person' },
         { label: '创建时间', key: 'create_time' },
@@ -333,19 +332,17 @@ export default {
   watch: {
     orderDetail: {
       handler(newVal) {
-        this.orderDetailInfo = newVal || {};
-        this.init();
+        this.beforeInit(newVal);
       },
       deep: true,
       immediate: true
     }
   },
-  computed: {
-    isUpEntRed() {
-      return this.orderDetailInfo?.redPunchData?.isUpEnt || false
-    }
+  mounted() {
+    this.beforeInit();
   },
   methods: {
+
     formatInputMoney (f, key = 'money') {
       f[key] = this.formatNumber((f[key] || 0) * 100)
     },
@@ -393,10 +390,15 @@ export default {
       }
       return result
     },
+    beforeInit() {
+      this.$nextTick(() => {
+        this.init();
+      })
+    },
     async init() {
-      this.orderData = this.orderDetailInfo?.orderData || {};
-      let productData = this.orderDetailInfo?.productData || [];
-      const { _productArr } = this.orderDetailInfo || {}
+      this.orderData = this.orderDetail?.orderData || {};
+      let productData = this.orderDetail?.productData || [];
+      const { _productArr } = this.orderDetail || {}
 
       if(productData.length > 0) {
         // 使用 Promise.all 来并行处理每个 product 的异步操作
@@ -523,7 +525,7 @@ export default {
     },
     // 设置红冲标识显示字段
     setRedPunchDisplay(product) {
-      const { isUpCommission, isUpEnt, isUpCash } = this.orderDetailInfo?.redPunchData || {};
+      const { isUpCommission, isUpEnt, isUpCash } = this.orderDetail?.redPunchData || {};
       const RETURN_BOOL = {
         '合同金额': isUpCash,
         '销售费用': isUpCommission,
@@ -680,6 +682,9 @@ export default {
       }
 
     },
+    divided(a, b) {
+      return div(a, b)
+    },
     calculateValidityPeriod(parsedFilter, product) {
       const { buy_cycle, buy_type, give_cycle, give_type, validYear } = parsedFilter
       const { product_type, returned_open } = product

+ 13 - 1
src/views/create-order/components/uploadInvoiceModule.vue

@@ -45,4 +45,16 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.uploadInvoiceModule {
+  ::v-deep {
+    .upload-invoice-dialog {
+      .el-dialog__body {
+        max-height: 500px;
+        overflow-y: scroll;
+      }
+    }
+  }
+}
+
+</style>