Ver código fonte

Merge branch 'ch/ht_3.0' of eta_mini/eta_mini_crm_front into debug_ht

leichen 4 meses atrás
pai
commit
db03680fd0

+ 2 - 2
src/views/order/OrderList.vue

@@ -39,7 +39,7 @@ const tableColumns = [
         widthsty:110,
     },{
         label:'有效期',
-        key:'ReadCount',
+        key:'ValidDuration',
         sortable:false
     },{
         label:'订单状态',
@@ -67,7 +67,7 @@ const tableColumns = [
         sortable:false
     },{
         label:'下单时间',
-        key:'RefundFinishTime',
+        key:'CreatedTime',
         sortable:false
     },
     {

+ 5 - 0
src/views/order/components/UserDialog.vue

@@ -40,6 +40,11 @@ function getRefundData(){
 }
 
 function confirm() {
+    remark
+    if (!remark.value) {
+        ElMessage.error('请输入退款说明')
+        return
+    }
     apiOrderConfig.postOrderRefund({
         ProductOrderNo:props.row.OrderID,
         Remark:remark.value

+ 17 - 8
src/views/products/components/PackageDialog.vue

@@ -15,14 +15,20 @@ const props = defineProps({
     default:[]
   },
 })
+const rules = {
+  SourceId:[{required:true,message:'请选择品种'}],
+  Price:[{required:true,message:'请输入价格'}],
+  ProductName:[{required:true,message:'请输入套餐名称'}],
+  ValidDays:[{required:true,message:'请输入有效时长'}],
+}
 const emits = defineEmits(["close"])
 const formRef = ref(null)
 const packageData = reactive({
-    SourceId:'',
+    SourceId:null,
     Type:'',
     ProductName:'',
     CoverSrc:'',
-    ValidDays:'',
+    ValidDays:null,
     Price:'',
     Description:'',
     RiskLevel:'',
@@ -37,7 +43,7 @@ watch(show,(newval)=>{
     }
   }else{
     Object.assign(packageData,{
-      SourceId:'',
+      SourceId:null,
       Type:'',
       ProductName:'',
       CoverSrc:'',
@@ -67,6 +73,9 @@ function getRiskLevel() {
 
 
 async function handleSubmitForm() {
+  try{
+  await formRef.value?.validate()
+  }catch(e){ return }
   const packageParams = {
     SourceId:Array.isArray(packageData.SourceId) ? packageData.SourceId[packageData.SourceId.length-1] : packageData.SourceId,
     Type: 'package',
@@ -124,9 +133,9 @@ function handleValidPrice() {
     :title="isAdd?'添加套餐':'编辑'"
   >
     <div class="dialog-content">
-      <el-form label-width="100px" ref="formRef" class="form">
+      <el-form label-width="100px" ref="formRef" :model="packageData" class="form" :rules="rules">
         <div class="left">
-          <el-form-item label="品种">
+          <el-form-item label="品种" prop="SourceId" :label-width="150">
             <!-- <el-input v-model="packageData.Price" placeholder="请选择品种" /> -->
             <el-cascader
               filterable
@@ -143,13 +152,13 @@ function handleValidPrice() {
               clearable>
             </el-cascader>
           </el-form-item>
-          <el-form-item label="套餐名称">
+          <el-form-item label="套餐名称" prop="ProductName" :label-width="150">
             <el-input v-model="packageData.ProductName" placeholder="请输入套餐名称"/>
           </el-form-item>
-          <el-form-item label="商品价格(元)">
+          <el-form-item label="商品价格(元)" prop="Price" :label-width="150">
             <el-input v-model="packageData.Price" placeholder="请输入价格" @keyup="handleValidPrice()"/>
           </el-form-item>
-          <el-form-item label="有效时长(天)">
+          <el-form-item label="有效时长(天)" prop="ValidDays" :label-width="150">
             <el-input v-model="packageData.ValidDays" min="0" class="no-spinner" placeholder="请输入有效时长" @keyup="handleValidValidDays()" />
           </el-form-item>
           <div class="tips" v-if="!isAdd">

+ 2 - 1
src/views/products/components/editSingle.vue

@@ -12,9 +12,10 @@ const emits = defineEmits(["close"])
 async function handleSubmitForm() {
   if(!props.productInfo.Price) return ElMessage.warning('请输入商品价格')
   const res=await apiProductsConfig.postEditProduct({
-    SourceId:props.productInfo.Id,
+    SourceId:props.productInfo.SourceId,
     Type:props.productInfo.ProductType === '报告'?'report':'audio',
     Price:props.productInfo.Price,
+    ProductId:props.productInfo.Id,
   })
   if(res.Ret!==200) return
   ElMessage.success('保存成功')