瀏覽代碼

update:信息采集

ct 1 天之前
父節點
當前提交
d598c47252
共有 2 個文件被更改,包括 112 次插入4 次删除
  1. 3 2
      src/components/user/login.vue
  2. 109 2
      src/views/order/userInformationOrder/userInfoDetail.vue

+ 3 - 2
src/components/user/login.vue

@@ -23,9 +23,10 @@
     data() {
       return {
         hasBindReadyEvent : false,
-        logo: logo,
+        // logo: logo,
         loading: false,
-        OpenIM: null
+        OpenIM: null,
+        logo: require(process.env.VUE_APP_LOG_URL)
       }
     },
     created() {

+ 109 - 2
src/views/order/userInformationOrder/userInfoDetail.vue

@@ -78,6 +78,9 @@
             <img :src="detail.doctorType2Sign" style="max-width: 200px;">
           </el-popover>
         </el-descriptions-item>
+        <el-descriptions-item label="订单状态" >
+          {{ orderStatus }}
+        </el-descriptions-item>
       </el-descriptions>
 
       <!-- 问卷 -->
@@ -120,6 +123,70 @@
       </div>
 
     </div>
+
+
+    <div class="my-content" v-if="packageInfo">
+      <div class="my-title">商品信息</div>
+
+      <div>
+        <el-table
+          border
+          :data="productInfo"
+          size="small"
+          style="width: 100%;margin-top: 20px"
+        >
+          <el-table-column label="商品图片" width="150" align="center">
+            <template slot-scope="scope">
+              <img v-if="scope.row.image" :src="scope.row.image" style="height: 80px; max-width: 120px;">
+              <span v-else>无图片</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="商品编码" width="300" align="center">
+            <template slot-scope="scope">
+              {{ scope.row.barCode || '-' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="商品名称" width="300" align="center">
+            <template slot-scope="scope">
+              {{ scope.row.productName || '-' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="单价" width="240" align="center">
+            <template slot-scope="scope">
+              ¥{{ Number(scope.row.price || 0).toFixed(2) }}
+            </template>
+          </el-table-column>
+          <el-table-column label="规格" width="240" align="center">
+            <template slot-scope="scope">
+              {{ scope.row.sku || scope.row.prescribeSpec || '默认' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="数量" width="180" align="center">
+            <template slot-scope="scope">
+              {{ scope.row.count || scope.row.num || 0 }}
+            </template>
+          </el-table-column>
+          <el-table-column label="处方药" width="240" align="center">
+            <template slot-scope="scope">
+              {{ (scope.row.isDrug === 1 || scope.row.isPrescribe === 1) ? '是' : '否' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="小计" align="center">
+            <template slot-scope="scope">
+              ¥{{ (Number(scope.row.count || 0) * Number(scope.row.price || 0)).toFixed(2) }}
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <!-- 合计信息 -->
+        <div style="float: right;margin: 20px" v-if="packageInfo.totalPrice != null">
+          合计:<span class="color-danger">¥{{ Number(packageInfo.totalPrice).toFixed(2) }}</span>
+        </div>
+      </div>
+    </div>
+
+
+
   </div>
 </template>
 
@@ -133,16 +200,40 @@ export default {
 
   data() {
     return {
+      packageInfo:null,
+      productInfo:null,
       detail: null,
       doctorAdvice: "",
-      confirming: false,
-      doctorType:1,
+      confirming: false
     };
   },
   computed: {
     ...mapState({
       doctorType: state => state.user.doctor.doctorType,
     }),
+    orderStatus() {
+      const param = this.detail;
+
+      if (param.userConfirm === 0) {
+        return '待用户确认';
+      } else if (param.userConfirm === 1 && param.doctorConfirm === 0) {
+        return '待医生确认';
+      } else if (param.userConfirm === 1 && param.doctorConfirm === 1) {
+        if (param.isPay != 1) {
+          return "用户待付款"
+        } else {
+          if (param.doctorType2Confirm === 0){
+            return '已付款待药师确认'; // 或者您需要的其他状态
+          } else if (param.doctorType2Confirm === 1 ) {
+            return param.orderStatus;
+          }
+        }
+
+
+      } else {
+        return '未知状态';
+      }
+    }
   },
 
   methods: {
@@ -163,6 +254,22 @@ export default {
         getUserInformation(id).then((response) => {
           console.log(response.data)
           this.detail = response.data;
+          this.packageInfo = this.detail.packageJson?JSON.parse(this.detail.packageJson) :null;
+          console.log("--------------",this.packageInfo);
+          // 修复:productInfo 需要解析
+          if (this.packageInfo && this.packageInfo.productJson) {
+            if (typeof this.packageInfo.productJson === 'string') {
+              this.productInfo = JSON.parse(this.packageInfo.productJson);
+            } else {
+              this.productInfo = this.packageInfo.productJson;
+            }
+          } else {
+            this.productInfo = [];
+          }
+
+          console.log("解析后的 productInfo:", this.productInfo);
+          console.log("productInfo 类型:", typeof this.productInfo);
+          console.log("第一个商品:", this.productInfo[0]);
           this.doctorAdvice = this.detail.doctorAdvice || "";
 
           // 解析问卷 JSON