xiaohaizhao 5 ماه پیش
والد
کامیت
c000fac2e8
2فایلهای تغییر یافته به همراه175 افزوده شده و 1 حذف شده
  1. 21 1
      pages/generalServices/detail.vue
  2. 154 0
      pages/generalServices/modules/handle.vue

+ 21 - 1
pages/generalServices/detail.vue

@@ -109,13 +109,14 @@
                 <My-button :customStyle="{
                     'background-color': '#FFFFFF',
                     'color': '#3874F6',
-                }" text="拒绝受理" />
+                }" text="拒绝受理" @onClick="openRefusefunc" />
             </view>
             <view class="but-box-item">
                 <My-button text="转工单" />
             </view>
         </view>
     </view>
+    <handle ref="Handle" :sa_serviceorderid="sa_serviceorderid" @callBack="callBack" />
     <view style="height: 50px;" />
 </template>
 
@@ -123,6 +124,7 @@
 import { ref, reactive, getCurrentInstance } from 'vue';
 const { $Http } = getCurrentInstance().proxy;
 import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
+import handle from './modules/handle.vue';
 
 let sa_serviceorderid = 0;
 onLoad((options) => {
@@ -149,6 +151,24 @@ function getDetail() {
     })
 }
 
+let Handle = ref(null);
+
+function openRefusefunc() {
+    Handle.value.openRefusefunc(sa_serviceorderid);
+}
+
+function callBack({ status }) {
+    if (status == 'refused') {
+        uni.navigateBack();
+        setTimeout(() => {
+            uni.showToast({
+                title: '已拒绝受理',
+                icon: 'none'
+            });
+        }, 100);
+    }
+}
+
 defineExpose({ detail })
 </script>
 

+ 154 - 0
pages/generalServices/modules/handle.vue

@@ -0,0 +1,154 @@
+<template>
+    <up-modal :show="refuse" title="拒绝说明" showCancelButton @confirm="confirmClose
+    " ref="uModal1" :asyncClose="true">
+        <view style="width: 99%;">
+            <view style="display: flex;align-items: center;margin-bottom: 10px;">
+                拒绝原因:<picker class="picker" mode="selector" :range="types" range-key="value"
+                    @change="changeRefusereason">
+                    {{ refusereason || '请选择拒绝原因' }}
+                </picker>
+            </view>
+            <up-textarea v-model="refuseremarks" placeholder="拒绝说明" count></up-textarea>
+        </view>
+    </up-modal>
+
+    <!-- <view class="slot-content">
+        <view class="options-box">
+            拒绝原因:<view class="option" :class="refusereason == item.value ? 'active' : ''" v-for="item in types"
+                :key="item.value" @click="clickRadio(item.value, 'refusereason')">
+                {{ item.value }}
+            </view>
+        </view>
+    </view> -->
+</template>
+
+<script setup>
+import { getCurrentInstance, ref, defineProps, defineEmits } from 'vue';
+const emit = defineEmits(['callBack'])
+import { onLoad, onShow } from '@dcloudio/uni-app';
+
+const { $Http } = getCurrentInstance().proxy;
+const props = defineProps({
+    callBack: {
+        type: Function
+    }
+});
+
+let refuse = ref(false),
+    types = ref([]),
+    refusereason = ref(""),
+    refuseremarks = ref(""),
+    sa_serviceorderid = 0;
+
+(onLoad(() => {
+    getRefuseType()
+}))
+
+function getRefuseType() {
+    $Http.basic({
+        "classname": "sysmanage.develop.optiontype.optiontype",
+        "method": "optiontypeselect",
+        "content": {
+            "pageNumber": 1,
+            "pageSize": 1000,
+            "typename": "refusereason",
+        }
+    }).then(res => {
+        if (res.code !== 1) return;
+        types.value = res.data;
+        console.log("types", types.value)
+    })
+}
+
+function openRefusefunc(id) {
+    sa_serviceorderid = id;
+    refuse.value = true;
+}
+
+let uModal1 = ref(null);
+
+function confirmClose() {
+    if (refusereason.value == "") {
+        uni.showToast({
+            title: '请选择拒绝原因',
+            icon: 'none'
+        });
+        uModal1.value.loading = false;
+        return;
+    };
+    if (refuseremarks.value.trim() == "") {
+        uni.showToast({
+            title: '请输入拒绝说明',
+            icon: 'none'
+        });
+        uModal1.value.loading = false;
+        return;
+    };
+
+    $Http.basic({
+        "id": 2025072409011703,
+        "content": {
+            sa_serviceorderid,
+            "refusereason": refusereason.value,
+            "refuseremarks": refuseremarks.value
+        }
+    }).then(res => {
+        console.log("拒绝受理", res)
+        uni.showToast({ title: res.code !== 1 ? res.msg : '已拒绝受理', icon: 'none' });
+        if (res.code !== 1) return uModal1.value.loading = false;
+        types.value = res.data;
+        refuse.value = false;
+        emit('callBack', {
+            status: 'refused'
+        });
+    })
+}
+
+function changeRefusereason(e) {
+    let index = e.detail.value;
+    refusereason.value = types.value[index].value;
+}
+
+defineExpose({
+    openRefusefunc
+});
+</script>
+
+<style scoped lang="scss">
+.options-box {
+    position: relative;
+    top: -6rpx;
+    display: flex;
+    flex-wrap: wrap;
+    width: 100%;
+    box-sizing: border-box;
+
+    .option {
+        border: 1px solid #dadbde;
+        border-radius: 8rpx;
+        padding: 10rpx 20rpx;
+        margin-right: 18rpx;
+        margin-top: 12rpx;
+        transition: background-color 0.3s, color 0.3s, border-color 0.3s;
+        text-align: center;
+        min-width: 80rpx;
+    }
+
+    .active {
+        background: #006EF7;
+        color: #fff;
+        border-color: #006EF7;
+    }
+}
+
+.picker {
+    font-size: 28rpx;
+    color: #606266;
+    padding: 9px;
+    border-radius: 8rpx;
+    border: 2rpx solid #2979FF;
+    color: #2979FF;
+    margin-left: 6rpx;
+    box-sizing: border-box;
+}
+</style>