Эх сурвалжийг харах

reactor:中心待办,发布待办新增平移功能;

zhangchong 10 сар өмнө
parent
commit
53be36c443

+ 5 - 1
src/views/business/publish/todo.vue

@@ -48,7 +48,7 @@
 				<!-- 表格操作 -->
 				<template #operation="{ row }">
 					<el-button link type="primary" @click="publish(row)" title="发布工单" v-auth="'business:publish:todo:publish'"> 发布 </el-button>
-					<order-detail :order="row" @updateList="queryList" />
+          <el-button link type="primary" @click="onTranslation(row)" title="平移功能" v-auth="'business:publish:todo:translation'"> 平移 </el-button>
 				</template>
 			</ProTable>
 		</el-card>
@@ -170,6 +170,10 @@ const orderPublishRef = ref<RefType>(); // 工单发布详情ref
 const publish = (row: any) => {
 	orderPublishRef.value.openDialog(row);
 };
+// 平移功能
+const onTranslation = (row: any) => {
+
+}
 onMounted(() => {
 	queryList();
 });

+ 1 - 1
src/views/business/visit/component/Assign-return-visitors.vue

@@ -86,7 +86,7 @@ const remoteMethod = (query: string) => {
     userList.value = [];
   }
 };
-// 新增
+// 保存
 const onSubmit = throttle(async (formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	await formEl.validate((valid: boolean) => {

+ 101 - 0
src/views/todo/center/Order-translation.vue

@@ -0,0 +1,101 @@
+<template>
+  <el-dialog v-model="state.dialogVisible" width="500px" draggable title="分配回访人" @close="close" destroy-on-close>
+    <el-form :model="state.ruleForm" label-width="90px" ref="ruleFormRef">
+      <el-form-item label="平移人" prop="employee" :rules="[{ required: true, message: '请选择平移的人员', trigger: 'change' }]">
+        <el-select-v2
+          v-model="state.ruleForm.employee"
+          :options="options"
+          placeholder="请选择平移的人员"
+          value-key="value"
+          style="width: 240px"
+        />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+			<span class="dialog-footer">
+				<el-button @click="closeDialog" class="default-button">取 消</el-button>
+				<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="loading">确 定</el-button>
+			</span>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup lang="ts">
+import { reactive, ref } from 'vue';
+import {ElNotification, FormInstance} from 'element-plus';
+import { throttle } from '@/utils/tools';
+import { queryUser } from '@/api/system/workflow';
+import { removeDuplicate } from '@/utils/arrayOperation';
+import { distribution } from '@/api/todo/visit';
+
+// 定义子组件向父组件传值/事件
+const emit = defineEmits(['updateList']);
+
+// 定义变量内容
+const state = reactive<any>({
+  dialogVisible: false,
+  ruleForm: {
+    employee: null, // 当前用户
+  },
+});
+const options = ref([]);
+let loading = ref<boolean>(false); // 加载状态
+// 打开弹窗
+const ruleFormRef = ref<RefType>();
+const openDialog = async (type:string,row:object) => {
+  try {
+    switch (type){
+      case '中心待办':
+
+        break;
+      case '发布待办':
+
+        break;
+      default:
+        break;
+    }
+    state.ruleForm.ids = ids;
+    state.dialogVisible = true;
+  } catch (error) {
+    console.log(error);
+  }
+};
+// 关闭弹窗
+const closeDialog = () => {
+  state.dialogVisible = false;
+};
+const close = () => {
+  ruleFormRef.value?.resetFields();
+  ruleFormRef.value?.clearValidate();
+};
+// 保存
+const onSubmit = throttle(async (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  await formEl.validate((valid: boolean) => {
+    if (!valid) return;
+    loading.value = true;
+    const request = {
+      ids: state.ruleForm.ids,
+      employeeId: state.ruleForm.employee.id,
+    };
+    distribution(request)
+      .then((res) => {
+        loading.value = false;
+        closeDialog();
+        emit('updateList');
+        ElNotification({
+          title: '分配完成',
+          message: `成功分配${res.result?.successCount}条,失败${res.result?.errorCount}条`,
+        });
+      })
+      .finally(() => {
+        loading.value = false;
+      });
+  });
+}, 300);
+// 暴露变量
+defineExpose({
+  openDialog,
+  closeDialog,
+});
+</script>

+ 9 - 1
src/views/todo/center/index.vue

@@ -138,12 +138,14 @@
 					<el-button link type="success" @click="onOrderEdit(row)" title="编辑工单" v-if="row.canEdit" v-auth="'todo:center:edit'">
 						修改
 					</el-button>
-					<order-detail :order="row" @updateList="queryList" />
+          <el-button link type="primary" @click="onTranslation(row)" title="平移功能" v-auth="'todo:center:translation'"> 平移 </el-button>
 				</template>
 			</ProTable>
 		</el-card>
 		<!-- 工单省退回 -->
 		<order-return ref="orderReturnRef" @updateList="queryList" />
+    <!-- 工单平移 -->
+    <order-translation ref="orderTranslationRef" @updateList="queryList" />
 	</div>
 </template>
 <script setup lang="tsx" name="todoCenter">
@@ -162,6 +164,7 @@ import { downloadFileByStream, downloadZip } from "@/utils/tools";
 // 引入组件
 const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
 const OrderReturn = defineAsyncComponent(() => import('@/views/business/return/components/Apply.vue')); // 工单退回
+const OrderTranslation = defineAsyncComponent(() => import('@/views/todo/center/Order-translation.vue')); // 工单平移
 
 // 定义变量内容
 const state = reactive<any>({
@@ -352,6 +355,11 @@ const onJbExport = () => {
     })
     .catch(() => {});
 };
+// 平移功能
+const orderTranslationRef = ref<RefType>();
+const onTranslation = (row: any) => {
+  orderTranslationRef.value.openDialog('中心待办',row)
+}
 // 表格导出
 const exportTable = (val: any, isExportAll = false) => {
   const columnInfos = val.map((item: any) => {