suixueyan 8 tháng trước cách đây
mục cha
commit
3df5aae94b
1 tập tin đã thay đổi với 17 bổ sung4 xóa
  1. 17 4
      src/views/shopping/components/DialogSales.vue

+ 17 - 4
src/views/shopping/components/DialogSales.vue

@@ -180,7 +180,8 @@
 </template>
 <script setup>
 import { listApi } from "@/plugins/api/shopping/logistics";
-import { auditApi, refundApi, redoApi } from "@/plugins/api/shopping/sales";
+import { auditApi, refundApi, redoApi,detailRefundApi } from "@/plugins/api/shopping/sales";
+import {ElMessage} from "element-plus";
 
 let ruleForm = ref({});
 let ruleForm2 = ref({});
@@ -227,13 +228,15 @@ function initFun(row) {
   if (typeof variable === 'string') {
     // 变量是字符串
     if (row.refund_info.refund_img) {
-      imgList.value = JSON.parse(row.refund_info.refund_img);
+      imgList.value = JSON.parse(row.refund_info.refund_img)||[];
     }
   }else{
-    imgList.value=row.refund_info.refund_img
+    imgList.value=row.refund_info.refund_img||[];
   }
   ruleForm.value.order_no = row.order_no;
   ruleForm2.value.order_no = row.order_no;
+  console.log(ruleForm.value,"ruleForm.value=>>>>>>>>>>>.")
+  ruleForm2.value.refund_price = showForm.value.amount_total||"";
   dialogVisible.value = true;
 
   getData();
@@ -247,7 +250,7 @@ function changeType(data) {
   if (data === 1) {
     ruleForm2.value.company_code = "";
   } else {
-    ruleForm2.value.refund_price = "";
+    ruleForm2.value.refund_price = showForm.value.amount_total||"";
   }
 }
 const emit = defineEmits(["refreshList"]);
@@ -257,6 +260,9 @@ function submit() {
     if (valid) {
       auditApi(ruleForm.value).then((data) => {
         ElMessage.success("操作成功!");
+        detailRefundApi({id: showForm.value.id}).then((data) => {
+          showForm.value = {...data};
+        })
         // dialogVisible.value = false;
         emit("refreshList");
         if (ruleForm.value.status == 1) {
@@ -275,6 +281,9 @@ function submit2() {
     if (valid) {
       refundApi(ruleForm2.value).then((data) => {
         ElMessage.success("操作成功!");
+        detailRefundApi({id: showForm.value.id}).then((data) => {
+          showForm.value = {...data};
+        })
         // dialogVisible.value = false;
         emit("refreshList");
         showForm.value.refund_status = 4;
@@ -308,6 +317,10 @@ function redoFun() {
           type: "success",
           message: "操作成功!",
         });
+        detailRefundApi({id: showForm.value.id}).then((data) => {
+          showForm.value = {...data};
+        })
+        emit("refreshList");
         showForm.value.refund_status = 4;
         showForm.value.refund_log.unshift(data);
       });