From 07f9f8657d057a38792c3822acc9b08d83478967 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 07 五月 2026 14:23:10 +0800
Subject: [PATCH] 合并代码

---
 src/views/customerService/afterSalesHandling/index.vue |  461 ++++++++++++++++++++++++++------------------------------
 1 files changed, 214 insertions(+), 247 deletions(-)

diff --git a/src/views/customerService/afterSalesHandling/index.vue b/src/views/customerService/afterSalesHandling/index.vue
index dd07ddb..a42337d 100644
--- a/src/views/customerService/afterSalesHandling/index.vue
+++ b/src/views/customerService/afterSalesHandling/index.vue
@@ -1,38 +1,94 @@
 <template>
 	<div class="app-container">
-		<div class="search_form">
-			<div>
-				<span class="search_title">鍙嶉鏃ユ湡锛�</span>
-				<el-date-picker
-					v-model="searchForm.feedbackDate"
-					value-format="YYYY-MM-DD"
-					format="YYYY-MM-DD"
-					type="date"
-					placeholder="璇烽�夋嫨"
-					clearable
-					@change="handleQuery"
-				/>
-				<span class="search_title ml10">澶勭悊鏃ユ湡锛�</span>
-				<el-date-picker
-					v-model="searchForm.disDate"
-					value-format="YYYY-MM-DD"
-					format="YYYY-MM-DD"
-					type="date"
-					placeholder="璇烽�夋嫨"
-					clearable
-					@change="handleQuery"
-				/>
-        <span style = "margin-left: 10px;" class="search_title">澶勭悊鐘舵�侊細</span>
-        <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="handleQuery" style="width: 140px" clearable>
-          <el-option label="寰呭鐞�" :value="1"></el-option>
-          <el-option label="宸插鐞�" :value="2"></el-option>
-        </el-select>
-				<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
-				>鎼滅储</el-button
-				>
-				<el-button @click="handleOut" style="margin-left: 10px">瀵煎嚭</el-button>
-			</div>
-		</div>
+		<div class="search-wrapper mb20">
+      <el-form
+          :model="searchForm"
+          class="demo-form-inline"
+      >
+        <el-row :gutter="20">
+          <el-col :span="4">
+            <el-form-item>
+              <el-input
+                  v-model="searchForm.afterSalesServiceNo"
+                  placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�"
+                  clearable
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item>
+              <el-select
+                  v-model="searchForm.status"
+                  placeholder="璇烽�夋嫨宸ュ崟鐘舵��"
+                  clearable
+              >
+                <el-option
+                    v-for="dict in workOrderStatusOptions"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item>
+              <el-select
+                  v-model="searchForm.urgency"
+                  placeholder="璇烽�夋嫨绱ф�ョ▼搴�"
+                  clearable
+              >
+                <el-option
+                    v-for="dict in degreeOfUrgencyOptions"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+           <el-col :span="4">
+            <el-form-item>
+              <el-select
+                  v-model="searchForm.serviceType"
+                  placeholder="璇烽�夋嫨鍞悗绫诲瀷"
+                  clearable
+              >
+                <el-option
+                    v-for="dict in classificationOptions"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+            <el-col :span="4">
+              <el-form-item>
+                <el-input
+                    v-model="searchForm.orderNo"
+                    placeholder="璇疯緭鍏ラ攢鍞崟鍙�"
+                    clearable
+                />
+              </el-form-item>
+            </el-col>
+          
+          
+
+          <!-- 鎸夐挳 -->
+          <el-col :span="4">
+            <el-form-item>
+              <el-button type="primary" @click="handleQuery">
+                鎼滅储
+              </el-button>
+              <el-button @click="handleReset">
+                閲嶇疆
+              </el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
 		<div class="table_list">
 			<PIMTable
 				rowKey="id"
@@ -46,33 +102,19 @@
 			></PIMTable>
 		</div>
 		<form-dia ref="formDia" @close="handleQuery"></form-dia>
-		<FileListDialog
-			ref="fileListRef"
-			v-model="fileListDialogVisible"
-			title="鍞悗闄勪欢"
-			:show-upload-button="true"
-			:show-delete-button="true"
-			:upload-method="handleFileUpload"
-			:delete-method="handleFileDelete"
-		/>
-	</div>
+    <FileList v-if="fileDialogVisible"  v-model:visible="fileDialogVisible" record-type="after_sales_service" :record-id="recordId"  />
+  </div>
 </template>
 
 <script setup>
-import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
+import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick, defineAsyncComponent} from "vue";
 import FormDia from "@/views/customerService/afterSalesHandling/components/formDia.vue";
-import FileListDialog from "@/components/Dialog/FileListDialog.vue";
 import { ElMessageBox } from "element-plus";
-import request from "@/utils/request";
-import { getToken } from "@/utils/auth";
 import {
 	afterSalesServiceListPage,
-	afterSalesServiceFileListPage,
-	afterSalesServiceFileDel,
 } from "@/api/customerService/index.js";
-import useUserStore from "@/store/modules/user.js";
 const { proxy } = getCurrentInstance();
-const userStore = useUserStore()
+const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
 
 const data = reactive({
 	searchForm: {
@@ -81,69 +123,112 @@
 	},
 });
 const { searchForm } = toRefs(data);
+/* 
+post_sale_waiting_list 鏂板鐨勫敭鍚庡垎绫�
+degree_of_urgency 鏂板鐨勭揣鎬ョ▼搴�
+work_order_status 涓婚〉鐨勫伐鍗曠姸鎬�
+*/
+const { post_sale_waiting_list, degree_of_urgency, work_order_status } = proxy.useDict(
+  "post_sale_waiting_list",
+  "degree_of_urgency",
+  "work_order_status",
+);
+
+const classificationOptions = computed(() => post_sale_waiting_list?.value || []);
+const degreeOfUrgencyOptions = computed(() => degree_of_urgency?.value || []);
+const workOrderStatusOptions = computed(() => work_order_status?.value || []);
 
 const tableColumn = ref([
 	{
-		label: "澶勭悊鐘舵��",
-		prop: "status",
-		dataType: "tag",
-		formatData: (params) => {
-			if (params == 1) {
-				return "寰呭鐞�";
-			} else if (params == 2) {
-				return "宸插鐞�";
-			} else {
-				return null;
-			}
-		},
-		formatType: (params) => {
-			if (params == 1) {
-				return "danger";
-			} else if (params == 2) {
-				return "success";
-			} else {
-				return null;
-			}
-		},
-	},
+    label: "宸ュ崟缂栧彿",
+    prop:"afterSalesServiceNo",
+    width: 150,
+    align: "center"
+  },
+  {
+    label: "閿�鍞崟鍙�",
+    prop:"salesContractNo",
+    width: 150,
+    align: "center"
+  },
+  {
+    label: "澶勭悊鐘舵��",
+    prop: "status",
+    dataType: "tag",
+    
+    formatData: (params) => {
+      if (params === 1) {
+        return "寰呭鐞�";
+      } else if (params === 2) {
+        return "宸插鐞�";
+      } else {
+        return null;
+      }
+    },
+    formatType: (params) => {
+      if (params === 1) {
+        return "danger";
+      } else if (params === 2) {
+        return "success";
+      } else {
+        return null;
+      }
+    },
+    align: "center"
+  },
+  {
+    label: "鍙嶉鏃ユ湡",
+    prop: "feedbackDate",
+    width: 150,
+    align: "center"
+  },
+  {
+    label: "鐧昏浜�",
+    prop: "checkNickName",
+    align: "center"
+  },
+  {
+    label: "绱ф�ョ▼搴�",
+    prop: "urgency",
+    // 鏍规嵁degreeOfUrgencyOptions瀛楀吀鍘昏嚜鍔ㄥ尮閰�
+    formatData: (params) => {
+      if (params) {
+        const item = degreeOfUrgencyOptions.value.find(item => item.value === params);
+        return item?.label || params;
+      }
+      return null;
+    },
+    align: "center"
+  },
+  {
+    label: "鍞悗绫诲瀷",
+    prop: "serviceType",
+    // 鏍规嵁classificationOptions瀛楀吀鍘昏嚜鍔ㄥ尮閰�
+    formatData: (params) => {
+      if (params) {
+        const item = classificationOptions.value.find(item => item.value === params);
+        return item?.label || params;
+      }
+      return null;
+    },
+    align: "center"
+  },
 	{
-		label: "鍙嶉鏃ユ湡",
-		prop: "feedbackDate",
-		width: 150,
-	},
-	{
-		label: "鐧昏浜�",
-		prop: "checkNickName",
-	},
-	{
-		label: "瀹㈡埛鍚嶇О",
-		prop: "customerName",
-		width: 200,
-	},
-	{
-		label: "闂鎻忚堪",
-		prop: "proDesc",
-		width:300
-	},
-	{
-		label: "鍏宠仈閮ㄩ棬",
-		prop: "deptName",
-		width: 200,
-	},
-	{
-		label: "澶勭悊浜�",
-		prop: "disposeNickName",
-	},
-	{
-		label: "澶勭悊缁撴灉",
-		prop: "disRes",
-		width: 200,
-	},
-	{
-		label: "澶勭悊鏃ユ湡",
-		prop: "disDate",
-		width: 150,
-	},
+    label: "闂鎻忚堪",
+    prop: "proDesc",
+    width:300,
+  },
+  {
+    label: "澶勭悊缁撴灉",
+    prop: "disRes",
+    width:300,
+  },
+  {
+    label: "鍏宠仈閮ㄩ棬",
+    prop: "deptName",
+    width: 200,
+    align: "center"
+  },
 	{
 		dataType: "action",
 		label: "鎿嶄綔",
@@ -197,145 +282,22 @@
 const fileListDialogVisible = ref(false)
 const currentFileRow = ref(null)
 
+// 閲嶇疆
+const handleReset = () => {
+  Object.keys(searchForm.value).forEach(key => {
+    searchForm.value[key] = ""
+  })
+}
+
+
+// 鎵撳紑闄勪欢寮圭獥
+const recordId =ref(0)
+const fileDialogVisible = ref(false)
 
 // 鎵撳紑闄勪欢寮规
 const openFilesFormDia = async (row) => {
-	currentFileRow.value = row
-	try {
-		const res = await afterSalesServiceFileListPage({
-			afterSalesServiceId: row.id,
-			current: 1,
-			size: 100,
-		})
-		if (res.code === 200 && fileListRef.value) {
-			const fileList = (res.data?.records || []).map((item) => ({
-				name: item.name || item.fileName,
-				url: item.url || item.fileUrl,
-				id: item.id,
-				...item,
-			}))
-			fileListRef.value.open(fileList)
-			fileListDialogVisible.value = true
-		} else {
-			fileListRef.value?.open([])
-			fileListDialogVisible.value = true
-		}
-	} catch (error) {
-		proxy.$modal.msgError("鑾峰彇闄勪欢鍒楄〃澶辫触")
-		fileListRef.value?.open([])
-		fileListDialogVisible.value = true
-	}
-}
-
-// 涓婁紶闄勪欢
-const handleFileUpload = async () => {
-	if (!currentFileRow.value) {
-		proxy.$modal.msgWarning("璇峰厛閫夋嫨鏁版嵁")
-		return
-	}
-	return new Promise((resolve) => {
-		const input = document.createElement("input")
-		input.type = "file"
-		input.style.display = "none"
-		input.onchange = async (e) => {
-			const file = e.target.files[0]
-			if (!file) {
-				resolve(null)
-				return
-			}
-			try {
-				const formData = new FormData()
-				formData.append("file", file)
-				formData.append("id", currentFileRow.value.id)
-				const uploadRes = await request({
-					url: "/afterSalesService/file/upload",
-					method: "post",
-					data: formData,
-					headers: {
-						"Content-Type": "multipart/form-data",
-						Authorization: `Bearer ${getToken()}`,
-					},
-				})
-				if (uploadRes.code === 200) {
-					proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛")
-					// 閲嶆柊鑾峰彇鏂囦欢鍒楄〃
-					const listRes = await afterSalesServiceFileListPage({
-						afterSalesServiceId: currentFileRow.value.id,
-						current: 1,
-						size: 100,
-					})
-					if (listRes.code === 200 && fileListRef.value) {
-						const fileList = (listRes.data?.records || []).map((item) => ({
-							name: item.fileName,
-							url: item.fileUrl,
-							id: item.id,
-							...item,
-						}))
-						fileListRef.value.setList(fileList)
-					}
-					resolve({ name: file.name, url: "", id: null })
-				} else {
-					proxy.$modal.msgError(uploadRes.msg || "鏂囦欢涓婁紶澶辫触")
-					resolve(null)
-				}
-			} catch (err) {
-				proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触")
-				resolve(null)
-			} finally {
-				document.body.removeChild(input)
-			}
-		}
-		document.body.appendChild(input)
-		input.click()
-	})
-}
-
-// 鍒犻櫎闄勪欢
-const handleFileDelete = async (row) => {
-	try {
-		// 娣诲姞纭瀵硅瘽妗�
-		const confirmResult = await ElMessageBox.confirm(
-			'纭畾瑕佸垹闄よ繖涓檮浠跺悧锛�',
-			'鍒犻櫎纭',
-			{
-				confirmButtonText: '纭畾',
-				cancelButtonText: '鍙栨秷',
-				type: 'warning'
-			}
-		)
-
-		if (confirmResult === 'confirm') {
-			const res = await afterSalesServiceFileDel(row.id)
-			if (res.code === 200) {
-				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
-				if (currentFileRow.value && fileListRef.value) {
-					const listRes = await afterSalesServiceFileListPage({
-						afterSalesServiceId: currentFileRow.value.id,
-						current: 1,
-						size: 100,
-					})
-					if (listRes.code === 200) {
-						const fileList = (listRes.data?.records || []).map((item) => ({
-							name: item.fileName,
-							url: item.fileUrl,
-							id: item.id,
-							...item,
-						}))
-						fileListRef.value.setList(fileList)
-					}
-				}
-			} else {
-				proxy.$modal.msgError(res.msg || "鍒犻櫎澶辫触")
-				return false
-			}
-		}
-	} catch (error) {
-		// 濡傛灉鐢ㄦ埛鍙栨秷鍒犻櫎锛屼笉鏄剧ず閿欒淇℃伅
-		if (error !== 'cancel') {
-			proxy.$modal.msgError("鍒犻櫎澶辫触")
-		}
-		return false
-	}
+  recordId.value = row.id
+  fileDialogVisible.value = true
 }
 
 // 鏌ヨ鍒楄〃
@@ -386,5 +348,10 @@
 </script>
 
 <style scoped>
-
+.search-wrapper {
+  background: white;
+  padding: 1rem 1rem 0 1rem;
+  border: 8px;
+  border-radius: 16px;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3