Browse Source

fix:“修复湿度区间参数修改错乱问题”

soobin 1 year ago
parent
commit
763abd675d

+ 5 - 0
src/service/order/index.js

@@ -29,3 +29,8 @@ export function refundWechatOrder(params) {
 export function Api_getOnlineExport(params) {
   return axios.get(`/ORDER-SERVER/tOrder/orderExport?${stringToUrl(params)}`,{responseType:'blob'});
 }
+
+// 获取订单列表
+export function updateIsInvoice(params) {
+  return axios.get(`/ORDER-SERVER/tOrder/updateIsInvoice?${stringToUrl(params)}`);
+}

+ 4 - 1
src/styles/home/index.less

@@ -368,5 +368,8 @@
       }
     }
   }
-
+  
+}
+.van-floating-bubble {
+  background-color: #557ffd;
 }

+ 1 - 1
src/views/device/deviceOper.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 设备常见操作弹窗 -->
   <van-dialog class-name="operDialog" width="350px" v-model:show="show" :showConfirmButton="false"
-    :showCancelButton="false">
+    :showCancelButton="false" :closeOnClickOverlay="true">
     <slot name="title">
       <div class="van-dialog__header" style="padding-bottom: 1em;">{{ $t("device.commonOperations") }}</div>
       <div class="txt1" style="padding: 0.2em 1em">

+ 1 - 1
src/views/device/paramsSet/paramsSetInfo.vue

@@ -226,7 +226,7 @@ export default {
       if (value === 0) {
         params.name = "allUpdate";
         params.val = interval.value;
-      } else if (value === 0) {
+      } else if (value === 1) {
         params.name = "winter";
         params.val = "winter";
       } else {

+ 56 - 19
src/views/orderCenter/index.vue

@@ -190,6 +190,16 @@
               <span class="word8">{{ $t('orderCenter.refunded') }}</span>
               <span class="info4">{{ refundObject.refundAmount }}</span>
             </div>
+            <div class="layer6 flex-row justify-between l-flex-center"
+              v-if="(refundObject.status != 0 && refundObject.status != 2) && orderType == '3'">
+              <span class="word6 o-mr-40">是否开发票</span>
+              <van-radio-group v-model="isInvoice" direction="horizontal">
+                <van-radio name="1">是</van-radio>
+                <van-radio name="0">否</van-radio>
+              </van-radio-group>
+              <van-button color="#4d6add" type="primary" size="small" class="o-p-20" @click="updateInvoice(refundObject.id)"
+                style="padding: 10px; margin-left: 20px;">更新</van-button>
+            </div>
             <!-- 发起退款 -->
             <!-- 非已付款订单,线下订单要隐藏按钮 -->
             <van-button size="small"
@@ -203,9 +213,9 @@
     </van-popup>
     <!-- 退款弹窗 -->
     <kDialog :isCloseForConfirm="false" :dialogTitle="$t('orderCenter.refundTip')"
-      :confirmBtnTxt="$t('orderCenter.refundSubmit')" ref="kDialogRef" @confirmclk="confirmClk" >
+      :confirmBtnTxt="$t('orderCenter.refundSubmit')" ref="kDialogRef" @confirmclk="confirmClk">
       <template #content>
-        <div class="refundBox l-flex-RC" style="overflow-y: auto; overflow-x: hidden; max-height: 40vh;" >
+        <div class="refundBox l-flex-RC" style="overflow-y: auto; overflow-x: hidden; max-height: 40vh;">
           <div v-for="(item, index) in orderDetails" :key="index" class="card01">
             <van-checkbox v-model="isChecked[index]" @change="checkGood(index)" icon-size="20px"></van-checkbox>
             <van-card :price="item.price.toFixed(2)" :title="item.productName" :thumb="showSugarPic(item.productNo)">
@@ -218,6 +228,8 @@
           </div>
         </div>
         <div class="o-mt-5" style="height: 1px; background: #d7d7e2"></div>
+        <van-field v-if="orderType === '3'" v-model="cofficentForm.refundReason" rows="2" autosize label="退款原因"
+          type="textarea" maxlength="30" :clearable="true" placeholder="请输入退款原因" show-word-limit />
         <div class="btnFooter">
           <van-checkbox class="checkAllBtn o-mt-5" v-model="checkedAll" @click="checkAll">全选</van-checkbox>
           <div class="o-mt-5">
@@ -241,7 +253,7 @@ import kNoData from "../../components/commom/kNoData/index.vue";
 import { onMounted, reactive, ref } from "vue";
 import sHeader from "../../components/SimpleHeader";
 import orderSearch from "./orderSearch.vue";
-import { getOrderList, refundOrder, refundWechatOrder } from "../../service/order/index";
+import { getOrderList, refundOrder, refundWechatOrder, updateIsInvoice } from "../../service/order/index";
 import { showFailToast, showToast, showLoadingToast } from "vant";
 import { getLoginUser, $M_IsDate, Format_time, $M_ExportFile, styleUrl } from "../../common/js/utils";
 import { getHuifuId } from "../../service/huifuMch/index";
@@ -268,6 +280,23 @@ export default {
     const refundNum = ref([]);
     // 订单类型
     const orderType = ref('');
+    // 是否开发票
+    const isInvoice = ref("0");
+    // 更新是否开发票
+    const updateInvoice = (id) => {
+      const params = {
+        id,
+        isInvoice: isInvoice.value,
+      }
+      showConfirmDialog({
+        message: '是否确认更新',
+      }).then(() => {
+        const { data } = updateIsInvoice(params);
+        console.log(data);
+      }).catch(() => {
+        return;
+      });
+    }
     // 加载状态
     // const isLoading = ref(false);
     // 监控退款选择框状态
@@ -300,7 +329,6 @@ export default {
     }
     // 点击弹出退款弹窗
     const noticeClk = (row) => {
-      orderType.value = row.payPlatform;
       if (row.orderDetails.length > 0) {
         isChecked.value = [];
         orderDetails.value = [];
@@ -362,26 +390,30 @@ export default {
       if (cofficentForm.note === "" || cofficentForm.price === 0 || cofficentForm.price === "") {
         showToast(t('orderCenter.refundPlace'));
         return;
-      } else {
-        showConfirmDialog({
-          // title: "提示",
-          message: t('orderCenter.refundCheck'),
-        }).then(() => {
-          // isLoading.value = true; // 开始加载
-          refundAjax();
-          // isLoading.value = false; // 加载完成
-
-          kDialogRef.value.closeDialog();
-        }).catch(() => {
-          return;
-        });
       }
+      if (orderType.value === '3' && (cofficentForm.refundReason === "" || cofficentForm.refundReason === null)) {
+        showToast('请填写退款原因');
+        return;
+      }
+      showConfirmDialog({
+        // title: "提示",
+        message: t('orderCenter.refundCheck'),
+      }).then(() => {
+        // isLoading.value = true; // 开始加载
+        refundAjax();
+        // isLoading.value = false; // 加载完成
+
+        kDialogRef.value.closeDialog();
+      }).catch(() => {
+        return;
+      });
+
     }
     // 退款操作
     const refundAjax = async () => {
       try {
         // 如果为微信退款
-        let data  = null;
+        let data = null;
         if (orderType.value === '3') {
           data = await refundWechatOrder(cofficentForm);
         } else {
@@ -409,7 +441,8 @@ export default {
       price: 0,
       id: "",
       productNumber: 0,
-      note: 0
+      note: 0,
+      refundReason: "",
     });
     // 引入语言
     const { t } = useI18n();
@@ -670,6 +703,7 @@ export default {
     const orderClick = (item) => {
       //查询商户余额,要用admin的type去区分 TODO
       refundObject.value = item;
+      orderType.value = item.payPlatform;
       refundType.value = true;
     };
     const accountDetail = ref({});
@@ -851,6 +885,9 @@ export default {
       // isLoading,
       isRefund,
       currencySymbol,
+      orderType,
+      isInvoice,
+      updateInvoice,
     };
   },
 };

+ 1 - 1
src/views/orderCenter/orderSearch.vue

@@ -66,7 +66,7 @@ export default {
     const sheetShow = ref(false);
     const startDateShow = ref(false);
     const endDateShow = ref(false);
-    const minDate = new Date(2018, 1, 1);
+    const minDate = new Date(2022, 0, 1);
     const maxDate = new Date();
 
     const userName = ref(''); // 用户名