Просмотр исходного кода

feat:工单退回申请页面新增;

zhangchong 1 год назад
Родитель
Сommit
d7d0d1fee1

+ 5 - 0
src/api/business/return.ts

@@ -0,0 +1,5 @@
+/*
+ * @Author: zc
+ * @description 业务待办-退回
+ */
+import request from '/@/utils/request';

+ 158 - 0
src/views/business/return/components/Apply.vue

@@ -0,0 +1,158 @@
+<template>
+  <el-dialog
+      v-model="state.dialogVisible"
+      draggable
+      title="省退回申请"
+      @mouseup="mouseup"
+      :style="'transform: ' + state.transform + ';'"
+      ref="dialogRef"
+      width="50%"
+      append-to-body
+      destroy-on-close
+      @close="close"
+  >
+    <div class="collapse-container pb1">
+      <el-form label-width="110px" ref="ruleFormRef" :model="state.ruleForm">
+        <el-row :gutter="35">
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+            <el-form-item label="工单编码"> {{ state.orderDetail.no }} </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+            <el-form-item label="工单标题"> {{ state.orderDetail.title }} </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+            <el-form-item label="办理人"> {{ userInfos.name }} </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+            <el-form-item label="办理单位"> {{ userInfos.orgName }} </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+            <el-form-item label="申请退回时间"> {{ formatDate(Date(), 'YYYY-mm-dd HH:MM:SS') }} </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+            <el-form-item label="退回原因" prop="applyContent" :rules="[{ required: true, message: '请填写退回原因', trigger: 'blur' }]">
+              <common-advice
+                  @chooseAdvice="chooseAdvice"
+                  v-model="state.ruleForm.applyContent"
+                  placeholder="请填写退回原因"
+                  :loading="state.loading"
+                  :commonEnum="commonEnum.Supervise"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+            <el-form-item label="附件" prop="handleResult" :rules="[{ required: false, message: '请选择附件', trigger: 'change' }]">
+              <annex-list name="退回附件" ref="annexListRef" businessId="" classify="督办申请" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <template #footer>
+			<span class="dialog-footer">
+				<el-button @click="closeDialog" class="default-button">取 消</el-button>
+				<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="state.loading" v-auth="'business:order:supervise:apply'">提交</el-button>
+			</span>
+    </template>
+  </el-dialog>
+</template>
+<script setup lang="ts" name="businessSuperviseDialog">
+import {defineAsyncComponent, reactive, ref} from 'vue';
+import {ElMessage, FormInstance} from 'element-plus';
+import {storeToRefs} from 'pinia';
+import {useUserInfo} from '/@/stores/userInfo';
+import {formatDate} from '/@/utils/formatTime';
+import {commonEnum} from '/@/utils/constants';
+import {superviseApply, urgeOrgList} from '/@/api/business/supervise';
+
+// 引入组件
+const AnnexList = defineAsyncComponent(() => import('/@/components/AnnexList/index.vue'));
+const CommonAdvice = defineAsyncComponent(() => import('/@/components/CommonAdvice/index.vue')); // 常用意见
+
+// 定义子组件向父组件传值/事件
+const emit = defineEmits(['updateList']);
+// 定义变量内容
+const state = reactive<any>({
+  collapseArr: ['1', '2'], // 折叠面板
+  dialogVisible: false, // 是否显示弹窗
+  loading: false, // 是否显示加载
+  ruleForm: {
+    acceptSms: false, // 发送督办短信
+    applyContent: '', // 督办内容
+    org:[]
+  },
+  orderDetail: {}, // 工单详情
+  transform: 'translate(0px, 0px)', // 滚动条位置
+  orgData: [], // 被督办部门
+});
+const ruleFormRef = ref<RefType>();
+const storesUserInfo = useUserInfo();
+const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
+const getOrgList = async (workflowId: string) => {
+  const res = await urgeOrgList(workflowId);
+  state.orgData = res.result ?? [];
+};
+// 打开弹窗
+const openDialog = (val: any) => {
+  if (!val.workflow) {
+    ElMessage.warning('该工单未配置流程');
+    return;
+  }
+  state.orderDetail = val;
+  getOrgList(val.workflow.id);
+  state.dialogVisible = true;
+};
+// 关闭弹窗
+const closeDialog = () => {
+  state.dialogVisible = false;
+};
+const close = ()=>{
+  ruleFormRef.value?.clearValidate();
+  ruleFormRef.value?.resetFields();
+}
+// 选中常用意见
+const chooseAdvice = (item: any) => {
+  state.ruleForm.content += item.content;
+};
+// 设置抽屉
+const dialogRef = ref<RefType>();
+const mouseup = () => {
+  state.transform = dialogRef.value.dialogContentRef.$el.style.transform;
+};
+// 提交
+const annexListRef = ref<RefType>(); // 附件列表
+const onSubmit = (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  formEl.validate((valid: boolean) => {
+    if (!valid) return;
+    state.loading = true;
+    const request = {
+      files: annexListRef.value?.fileList,
+      orderId: state.orderDetail.id,
+      applyContent: state.ruleForm.applyContent,
+      acceptSms: state.ruleForm.acceptSms,
+      replyLimitTime: state.ruleForm.replyLimitTime,
+      superviseOrgDtos: state.ruleForm.org.map((item: any) => {
+        return {
+          orgId: item.key,
+          orgName: item.value,
+        };
+      }),
+    }
+    superviseApply(request)
+        .then((res: any) => {
+          state.loading = false;
+          closeDialog();
+          emit('updateList');
+          ElMessage.success('操作成功');
+        })
+        .catch(() => {
+          state.loading = false;
+        });
+  });
+};
+defineExpose({
+  openDialog,
+  closeDialog,
+});
+</script>

+ 22 - 22
src/views/business/return/index.vue

@@ -1,26 +1,27 @@
 <template>
 	<div class="business-return-container layout-pd">
-		<!-- 搜索  -->
-		<el-card shadow="never">
-			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent class="mt15" label-width="100px">
-				<el-row :gutter="10">
-					<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
-						<el-form-item label="工单标题" prop="Keyword">
-							<el-input v-model="state.queryParams.Keyword" placeholder="工单编码/标题" clearable @keyup.enter="queryList" />
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
-						<el-form-item label=" ">
-							<el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
-							<el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button" :loading="state.loading">
-								<SvgIcon name="ele-Refresh" class="mr5" />重置
-							</el-button>
-						</el-form-item>
-					</el-col>
-				</el-row>
-			</el-form>
-		</el-card>
 		<el-card shadow="never">
+      <el-tabs v-model="state.queryParams.IsHandled" class="demo-tabs" @tab-change="queryList">
+        <el-tab-pane name="false" label="工单待办"></el-tab-pane>
+        <el-tab-pane name="true" label="工单已办"></el-tab-pane>
+      </el-tabs>
+      <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent class="mt15" label-width="100px">
+        <el-row :gutter="10">
+          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
+            <el-form-item label="工单标题" prop="Keyword">
+              <el-input v-model="state.queryParams.Keyword" placeholder="工单编码/标题" clearable @keyup.enter="queryList" />
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
+            <el-form-item label=" ">
+              <el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
+              <el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button" :loading="state.loading">
+                <SvgIcon name="ele-Refresh" class="mr5" />重置
+              </el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
 			<!-- 功能按钮 -->
 			<div class="mb20">
 				<el-button type="primary" @click="onExport" v-auth="'business:supervise:export'" :disabled="!multipleSelection.length">
@@ -106,7 +107,6 @@ const OrderDetail = defineAsyncComponent(() => import('/@/views/business/order/c
 
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
-const searchCol = ref(true); // 是否显示搜索栏
 const router = useRouter(); // 路由
 const state = reactive(<any>{
 	queryParams: {
@@ -121,7 +121,7 @@ const state = reactive(<any>{
 });
 /** 获取列表 */
 const queryList = throttle(() => {
-	if (!auth('business:return:query')) ElMessage.error('抱歉,您没有权限查看退回列表!');
+	if (!auth('business:return:query')) ElMessage.error('抱歉,您没有权限查看退回申请!');
 	else {
 	}
 }, 300);

+ 6 - 1
src/views/todo/order/index.vue

@@ -148,9 +148,10 @@
 						</template>
 					</el-table-column>
 				</template>
-				<el-table-column label="操作" width="80" fixed="right" align="center">
+				<el-table-column label="操作" width="110" fixed="right" align="center">
 					<template #default="{ row }">
 						<el-button link type="primary" @click="onOrderDetail(row)" title="查看工单详情" v-auth="'todo:order:detail'"> 详情 </el-button>
+            <el-button link type="primary" @click="onReturn(row)" title="退回工单" v-auth="'todo:order:return'" v-if="row.source > 1 && row.status <= 1"> 退回</el-button>
 					</template>
 				</el-table-column>
 				<template #empty>
@@ -249,6 +250,10 @@ const OrderDetailRef = ref<RefType>(); // 工单详情ref
 const onOrderDetail = (row: any) => {
 	OrderDetailRef.value.openDialog(row);
 };
+// 工单退回
+const onReturn = (row:any)=>{
+
+}
 onMounted(() => {
 	queryList();
 });