794 lines
31 KiB
JavaScript
794 lines
31 KiB
JavaScript
"use strict";
|
||
const common_vendor = require("../../common/vendor.js");
|
||
const common_config = require("../../common/config.js");
|
||
const CommonBeginReception = () => "./common_begin_reception2.js";
|
||
const ServiceListFurniture = () => "./serviceListFurniture.js";
|
||
const _sfc_main = {
|
||
components: {
|
||
CommonBeginReception,
|
||
ServiceListFurniture
|
||
},
|
||
data() {
|
||
return {
|
||
activeTab: "status",
|
||
// 导航栏位置相关
|
||
navbarTop: "88rpx",
|
||
// 默认值,会在onLoad/onShow时动态计算
|
||
contentTop: "160rpx",
|
||
// 默认值,会在onLoad/onShow时动态计算
|
||
receptionForm: {
|
||
id: "",
|
||
customerName: "",
|
||
contact: "",
|
||
customerSource: "",
|
||
gender: "女",
|
||
age: "",
|
||
dealershipId: "",
|
||
dealershipName: "",
|
||
salesId: "",
|
||
salesName: "",
|
||
salesPhone: "",
|
||
recordingCount: 0,
|
||
intendedModel: "",
|
||
infoCard: "",
|
||
remark: "",
|
||
detailedAddress: "",
|
||
contactCount: 0
|
||
},
|
||
// 标签管理
|
||
tagViewMode: "list",
|
||
// 'list' 或 'add' 或 'edit'
|
||
tagList: [],
|
||
tagLoading: false,
|
||
tagTotal: 0,
|
||
tagPage: {
|
||
current: 1,
|
||
size: 10
|
||
},
|
||
tagQuery: {
|
||
industry: "",
|
||
tagType: "",
|
||
tagName: ""
|
||
},
|
||
tagForm: {
|
||
id: "",
|
||
industry: "家居行业",
|
||
tagType: "",
|
||
name: "",
|
||
detail: "",
|
||
remark: "",
|
||
enabled: true
|
||
},
|
||
tagTypeOptions: ["接待客户", "质检SOP", "客户画像"],
|
||
showTagTypeDropdown: false,
|
||
selectedTagItem: null,
|
||
showTagActionMenu: false
|
||
};
|
||
},
|
||
computed: {
|
||
// 计算导航栏和内容区域的位置(使用计算属性确保响应式)
|
||
computedNavbarTop() {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:336", "[FurnitureReception][computedNavbarTop] 计算导航栏位置");
|
||
const systemInfo = common_vendor.index.getSystemInfoSync();
|
||
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
||
const navbarHeight = 44;
|
||
const statusBarHeightRpx = statusBarHeight * 2;
|
||
const navbarHeightRpx = navbarHeight * 2;
|
||
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
||
const result = totalNavbarHeight + "rpx";
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:344", "[FurnitureReception][computedNavbarTop] 计算结果:", {
|
||
statusBarHeight,
|
||
navbarHeight,
|
||
totalNavbarHeight,
|
||
result
|
||
});
|
||
return result;
|
||
},
|
||
computedContentTop() {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:353", "[FurnitureReception][computedContentTop] 计算内容区域位置");
|
||
const systemInfo = common_vendor.index.getSystemInfoSync();
|
||
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
||
const navbarHeight = 44;
|
||
const statusBarHeightRpx = statusBarHeight * 2;
|
||
const navbarHeightRpx = navbarHeight * 2;
|
||
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
||
const result = totalNavbarHeight + 72 + "rpx";
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:361", "[FurnitureReception][computedContentTop] 计算结果:", {
|
||
statusBarHeight,
|
||
navbarHeight,
|
||
totalNavbarHeight,
|
||
result
|
||
});
|
||
return result;
|
||
}
|
||
},
|
||
onLoad() {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:371", "[FurnitureReception][onLoad] 页面加载");
|
||
this.updateNavbarPosition();
|
||
this.loadCurrentUserInfo();
|
||
},
|
||
onShow() {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:378", "[FurnitureReception][onShow] 页面显示");
|
||
this.$nextTick(() => {
|
||
this.updateNavbarPosition();
|
||
setTimeout(() => {
|
||
this.updateNavbarPosition();
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:386", "[FurnitureReception][onShow] 延迟更新后的位置:", {
|
||
navbarTop: this.navbarTop,
|
||
contentTop: this.contentTop,
|
||
computedNavbarTop: this.computedNavbarTop,
|
||
computedContentTop: this.computedContentTop
|
||
});
|
||
}, 50);
|
||
});
|
||
},
|
||
onReady() {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:397", "[FurnitureReception][onReady] 页面渲染完成");
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:398", "[FurnitureReception][onReady] activeTab:", this.activeTab);
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:399", "[FurnitureReception][onReady] navbarTop:", this.navbarTop);
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:400", "[FurnitureReception][onReady] contentTop:", this.contentTop);
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:401", "[FurnitureReception][onReady] computedNavbarTop:", this.computedNavbarTop);
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:402", "[FurnitureReception][onReady] computedContentTop:", this.computedContentTop);
|
||
this.updateNavbarPosition();
|
||
const systemInfo = common_vendor.index.getSystemInfoSync();
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:408", "[FurnitureReception][onReady] 系统信息:", {
|
||
statusBarHeight: systemInfo.statusBarHeight,
|
||
windowHeight: systemInfo.windowHeight,
|
||
screenHeight: systemInfo.screenHeight
|
||
});
|
||
setTimeout(() => {
|
||
const query = common_vendor.index.createSelectorQuery().in(this);
|
||
query.select(".tabs").boundingClientRect((data) => {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:419", "[FurnitureReception][onReady] tab栏元素信息:", data);
|
||
if (!data) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:421", "[FurnitureReception][onReady] tab栏元素未找到!");
|
||
} else {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:423", "[FurnitureReception][onReady] tab栏位置:", {
|
||
top: data.top,
|
||
left: data.left,
|
||
width: data.width,
|
||
height: data.height,
|
||
expectedTop: this.navbarTop,
|
||
computedNavbarTop: this.computedNavbarTop,
|
||
isVisible: data.width > 0 && data.height > 0,
|
||
isOnScreen: data.top >= 0 && data.top < systemInfo.windowHeight
|
||
});
|
||
if (data.width === 0 || data.height === 0 || data.top < 0) {
|
||
common_vendor.index.__f__("warn", "at pages/furniture_reception/furniture_reception.vue:436", "[FurnitureReception][onReady] tab栏不可见,强制更新位置");
|
||
this.updateNavbarPosition();
|
||
this.$forceUpdate();
|
||
}
|
||
}
|
||
}).exec();
|
||
}, 100);
|
||
common_vendor.index.onWindowResize(() => {
|
||
if (this.showTagTypeDropdown) {
|
||
this.updateTagTypeDropdownPosition();
|
||
}
|
||
});
|
||
},
|
||
methods: {
|
||
// 计算并更新导航栏和内容区域的位置
|
||
updateNavbarPosition() {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:455", "[FurnitureReception][updateNavbarPosition] 开始更新导航栏位置");
|
||
const systemInfo = common_vendor.index.getSystemInfoSync();
|
||
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
||
const navbarHeight = 44;
|
||
const statusBarHeightRpx = statusBarHeight * 2;
|
||
const navbarHeightRpx = navbarHeight * 2;
|
||
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
||
const navbarTop = totalNavbarHeight + "rpx";
|
||
const contentTop = totalNavbarHeight + 72 + "rpx";
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:467", "[FurnitureReception][updateNavbarPosition] 更新导航栏位置:", {
|
||
statusBarHeight,
|
||
navbarHeight,
|
||
totalNavbarHeight,
|
||
navbarTop,
|
||
contentTop,
|
||
currentNavbarTop: this.navbarTop,
|
||
currentContentTop: this.contentTop
|
||
});
|
||
this.$set(this, "navbarTop", navbarTop);
|
||
this.$set(this, "contentTop", contentTop);
|
||
this.$forceUpdate();
|
||
},
|
||
/**
|
||
* 加载当前登录用户信息,填充销售姓名和电话
|
||
*/
|
||
loadCurrentUserInfo() {
|
||
try {
|
||
const loginResponse = common_vendor.index.getStorageSync("backend-login-response") || {};
|
||
if (loginResponse.userName) {
|
||
this.receptionForm.salesName = loginResponse.userName;
|
||
}
|
||
if (loginResponse.phone) {
|
||
this.receptionForm.salesPhone = loginResponse.phone;
|
||
} else if (loginResponse.userName) {
|
||
this.receptionForm.salesPhone = loginResponse.userName;
|
||
}
|
||
if (loginResponse.userId) {
|
||
this.receptionForm.salesId = String(loginResponse.userId);
|
||
}
|
||
} catch (e) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:512", "加载当前登录用户信息失败:", e);
|
||
}
|
||
},
|
||
goBack() {
|
||
const pages = getCurrentPages();
|
||
if (pages.length <= 1) {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:521", "[FurnitureReception][goBack] 当前是第一个页面,无法返回");
|
||
return;
|
||
}
|
||
common_vendor.index.navigateBack({
|
||
fail: (err) => {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:526", "[FurnitureReception][goBack] 返回失败:", err);
|
||
}
|
||
});
|
||
},
|
||
switchTab(tab) {
|
||
this.activeTab = tab;
|
||
if (tab === "reception") {
|
||
this.resetReceptionForm();
|
||
} else if (tab === "tag") {
|
||
this.tagViewMode = "list";
|
||
this.fetchTagList();
|
||
}
|
||
},
|
||
resetReceptionForm() {
|
||
this.receptionForm = {
|
||
id: "",
|
||
customerName: "",
|
||
contact: "",
|
||
customerSource: "",
|
||
gender: "女",
|
||
age: "",
|
||
dealershipId: "",
|
||
dealershipName: "",
|
||
salesId: "",
|
||
salesName: "",
|
||
salesPhone: "",
|
||
recordingCount: 0,
|
||
intendedModel: "",
|
||
infoCard: "",
|
||
remark: "",
|
||
detailedAddress: "",
|
||
contactCount: 0
|
||
};
|
||
this.loadCurrentUserInfo();
|
||
},
|
||
onReceptionCancel() {
|
||
this.resetReceptionForm();
|
||
},
|
||
onReceptionSaveSuccess({ action, data }) {
|
||
if (data) {
|
||
this.receptionForm = {
|
||
...this.receptionForm,
|
||
...data
|
||
};
|
||
}
|
||
this.resetReceptionForm();
|
||
if (action === "start") {
|
||
common_vendor.index.__f__("log", "at pages/furniture_reception/furniture_reception.vue:583", "开始接待成功", data);
|
||
}
|
||
},
|
||
onReceptionSaveError({ action, error }) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:588", "保存失败:", error);
|
||
},
|
||
// 标签管理相关方法
|
||
onTagListSearch() {
|
||
if (this.activeTab !== "tag") {
|
||
this.activeTab = "tag";
|
||
}
|
||
this.tagPage.current = 1;
|
||
this.fetchTagList({ force: true });
|
||
},
|
||
onTagListRefresh() {
|
||
this.tagPage.current = 1;
|
||
this.fetchTagList({ force: true });
|
||
},
|
||
onTagListReachBottom() {
|
||
if (this.tagLoading)
|
||
return;
|
||
if (this.tagList.length >= this.tagTotal)
|
||
return;
|
||
this.tagPage.current += 1;
|
||
this.fetchTagList();
|
||
},
|
||
async fetchTagList({ force = false } = {}) {
|
||
var _a, _b, _c, _d, _e;
|
||
if (this.tagLoading && !force) {
|
||
return;
|
||
}
|
||
this.tagLoading = true;
|
||
try {
|
||
const queryParams = {
|
||
current: this.tagPage.current,
|
||
size: this.tagPage.size
|
||
};
|
||
const trimmedTagType = (_b = (_a = this.tagQuery) == null ? void 0 : _a.tagType) == null ? void 0 : _b.trim();
|
||
const trimmedTagName = (_d = (_c = this.tagQuery) == null ? void 0 : _c.tagName) == null ? void 0 : _d.trim();
|
||
if (trimmedTagType) {
|
||
queryParams.tagType = trimmedTagType;
|
||
}
|
||
if (trimmedTagName) {
|
||
queryParams.tagName = trimmedTagName;
|
||
}
|
||
const url = common_config.getApiUrl("/api/industryTags/list");
|
||
let tenantId = "";
|
||
let token = "";
|
||
try {
|
||
tenantId = common_vendor.index.getStorageSync("backend-tenant-id") || "";
|
||
token = common_vendor.index.getStorageSync("backend-token") || "";
|
||
} catch (e) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:637", "获取认证信息失败:", e);
|
||
}
|
||
const headers = {
|
||
"Content-Type": "application/json"
|
||
};
|
||
if (token) {
|
||
headers["Authorization"] = `Bearer ${token}`;
|
||
}
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const res = await common_vendor.index.request({
|
||
url,
|
||
method: "POST",
|
||
data: queryParams,
|
||
header: headers,
|
||
timeout: 3e4
|
||
// 增加超时时间到30秒
|
||
});
|
||
if (res.statusCode === 200 && res.data && res.data.success) {
|
||
const records = Array.isArray(res.data.data) ? res.data.data : [];
|
||
if (this.tagPage.current === 1 || force) {
|
||
this.tagList = records;
|
||
} else {
|
||
this.tagList = this.tagList.concat(records);
|
||
}
|
||
this.tagTotal = Number(res.data.total) || 0;
|
||
} else {
|
||
this.tagList = [];
|
||
this.tagTotal = 0;
|
||
common_vendor.index.showToast({
|
||
title: ((_e = res.data) == null ? void 0 : _e.message) || "获取标签列表失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:676", "获取标签列表失败:", error);
|
||
let errorMessage = "获取标签列表失败,请稍后重试";
|
||
if (error.errMsg) {
|
||
if (error.errMsg.includes("timeout")) {
|
||
errorMessage = "请求超时,请检查网络连接后重试";
|
||
} else if (error.errMsg.includes("fail")) {
|
||
errorMessage = "网络请求失败,请检查网络连接";
|
||
}
|
||
}
|
||
common_vendor.index.showToast({
|
||
title: errorMessage,
|
||
icon: "none",
|
||
duration: 3e3
|
||
});
|
||
} finally {
|
||
this.tagLoading = false;
|
||
}
|
||
},
|
||
showAddTag() {
|
||
this.tagViewMode = "add";
|
||
this.showTagTypeDropdown = false;
|
||
this.tagForm = {
|
||
id: "",
|
||
industry: "家居行业",
|
||
tagType: "",
|
||
name: "",
|
||
detail: "",
|
||
remark: "",
|
||
enabled: true
|
||
};
|
||
},
|
||
onTagItemClick(item) {
|
||
},
|
||
onTagActionBtnClick(item) {
|
||
if (this.selectedTagItem && this.selectedTagItem.id === item.id && this.showTagActionMenu) {
|
||
this.closeTagActionMenu();
|
||
return;
|
||
}
|
||
this.selectedTagItem = item;
|
||
this.showTagActionMenu = true;
|
||
},
|
||
closeTagActionMenu() {
|
||
this.showTagActionMenu = false;
|
||
this.selectedTagItem = null;
|
||
},
|
||
editTag(item) {
|
||
this.closeTagActionMenu();
|
||
this.tagViewMode = "edit";
|
||
this.showTagTypeDropdown = false;
|
||
this.tagForm = {
|
||
id: item.id || "",
|
||
industry: item.industry || "家居行业",
|
||
tagType: item.tagType || "",
|
||
name: item.tagName || item.name || "",
|
||
detail: item.tagDetail || item.detail || "",
|
||
remark: item.remark || "",
|
||
enabled: item.enabled !== void 0 ? item.enabled : item.isEnabled !== void 0 ? item.isEnabled : true
|
||
};
|
||
},
|
||
async deleteTag(item) {
|
||
this.closeTagActionMenu();
|
||
const tagId = item.id;
|
||
if (!tagId) {
|
||
common_vendor.index.showToast({
|
||
title: "无法获取标签ID",
|
||
icon: "none"
|
||
});
|
||
return;
|
||
}
|
||
common_vendor.index.showModal({
|
||
title: "确认删除",
|
||
content: `确定要删除标签"${item.tagName || item.name || "未命名标签"}"吗?`,
|
||
success: async (res) => {
|
||
var _a, _b;
|
||
if (res.confirm) {
|
||
try {
|
||
common_vendor.index.showLoading({
|
||
title: "删除中..."
|
||
});
|
||
const deleteUrl = common_config.getApiUrl(`/api/industryTags/delete/${tagId}`);
|
||
let tenantId = "";
|
||
let token = "";
|
||
try {
|
||
tenantId = common_vendor.index.getStorageSync("backend-tenant-id") || "";
|
||
token = common_vendor.index.getStorageSync("backend-token") || "";
|
||
} catch (e) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:770", "获取认证信息失败:", e);
|
||
}
|
||
const headers = {};
|
||
if (token) {
|
||
headers["Authorization"] = `Bearer ${token}`;
|
||
}
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const deleteRes = await common_vendor.index.request({
|
||
url: deleteUrl,
|
||
method: "DELETE",
|
||
header: headers,
|
||
timeout: 3e4
|
||
// 增加超时时间到30秒
|
||
});
|
||
common_vendor.index.hideLoading();
|
||
if (deleteRes.statusCode === 200 && deleteRes.data && deleteRes.data.success) {
|
||
common_vendor.index.showToast({
|
||
title: ((_a = deleteRes.data) == null ? void 0 : _a.message) || "删除成功",
|
||
icon: "success"
|
||
});
|
||
this.tagPage.current = 1;
|
||
this.fetchTagList({ force: true });
|
||
} else {
|
||
common_vendor.index.showToast({
|
||
title: ((_b = deleteRes.data) == null ? void 0 : _b.message) || "删除失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.hideLoading();
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:807", "删除标签失败:", error);
|
||
let errorMessage = "删除失败,请重试";
|
||
if (error.errMsg) {
|
||
if (error.errMsg.includes("timeout")) {
|
||
errorMessage = "请求超时,请检查网络连接后重试";
|
||
} else if (error.errMsg.includes("fail")) {
|
||
errorMessage = "网络请求失败,请检查网络连接";
|
||
}
|
||
}
|
||
common_vendor.index.showToast({
|
||
title: errorMessage,
|
||
icon: "none",
|
||
duration: 3e3
|
||
});
|
||
}
|
||
}
|
||
}
|
||
});
|
||
},
|
||
cancelAddTag() {
|
||
this.tagViewMode = "list";
|
||
this.showTagTypeDropdown = false;
|
||
this.tagForm = {
|
||
id: "",
|
||
industry: "家居行业",
|
||
tagType: "",
|
||
name: "",
|
||
detail: "",
|
||
remark: "",
|
||
enabled: true
|
||
};
|
||
},
|
||
toggleTagTypeDropdown() {
|
||
this.showTagTypeDropdown = !this.showTagTypeDropdown;
|
||
if (this.showTagTypeDropdown) {
|
||
this.$nextTick(() => {
|
||
this.updateTagTypeDropdownPosition();
|
||
});
|
||
}
|
||
},
|
||
updateTagTypeDropdownPosition() {
|
||
const query = common_vendor.index.createSelectorQuery().in(this);
|
||
query.select(".tag-select").boundingClientRect((rect) => {
|
||
if (rect) {
|
||
const dropdownEl = this.$refs.tagTypeDropdown;
|
||
if (dropdownEl) {
|
||
this.$nextTick(() => {
|
||
const el = dropdownEl.$el || dropdownEl;
|
||
if (el && el.style) {
|
||
el.style.top = rect.bottom + 8 + "px";
|
||
el.style.left = rect.left + "px";
|
||
el.style.width = rect.width + "px";
|
||
}
|
||
});
|
||
}
|
||
}
|
||
}).exec();
|
||
},
|
||
selectTagType(option) {
|
||
this.tagForm.tagType = option;
|
||
this.showTagTypeDropdown = false;
|
||
},
|
||
closeTagTypeDropdown() {
|
||
this.showTagTypeDropdown = false;
|
||
},
|
||
onEnabledChange(e) {
|
||
this.tagForm.enabled = e.detail.value;
|
||
},
|
||
async saveTag() {
|
||
var _a, _b, _c, _d;
|
||
if (!this.tagForm.name || !this.tagForm.name.trim()) {
|
||
common_vendor.index.showToast({
|
||
title: "请输入标签名",
|
||
icon: "none"
|
||
});
|
||
return;
|
||
}
|
||
try {
|
||
common_vendor.index.showLoading({
|
||
title: this.tagViewMode === "edit" ? "更新中..." : "保存中..."
|
||
});
|
||
const payload = {
|
||
industry: ((_a = this.tagForm.industry) == null ? void 0 : _a.trim()) || "",
|
||
tagType: ((_b = this.tagForm.tagType) == null ? void 0 : _b.trim()) || "",
|
||
tagName: this.tagForm.name.trim(),
|
||
tagDetail: ((_c = this.tagForm.detail) == null ? void 0 : _c.trim()) || "",
|
||
remark: ((_d = this.tagForm.remark) == null ? void 0 : _d.trim()) || "",
|
||
enabled: this.tagForm.enabled !== void 0 ? this.tagForm.enabled : true
|
||
};
|
||
if (this.tagViewMode === "edit" && this.tagForm.id) {
|
||
payload.id = this.tagForm.id;
|
||
}
|
||
const url = this.tagViewMode === "edit" ? common_config.getApiUrl("/api/industryTags/update") : common_config.getApiUrl("/api/industryTags/add");
|
||
const method = this.tagViewMode === "edit" ? "PUT" : "POST";
|
||
let tenantId = "";
|
||
let token = "";
|
||
try {
|
||
tenantId = common_vendor.index.getStorageSync("backend-tenant-id") || "";
|
||
token = common_vendor.index.getStorageSync("backend-token") || "";
|
||
} catch (e) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:920", "获取认证信息失败:", e);
|
||
}
|
||
const headers = {
|
||
"Content-Type": "application/json"
|
||
};
|
||
if (token) {
|
||
headers["Authorization"] = `Bearer ${token}`;
|
||
}
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const res = await common_vendor.index.request({
|
||
url,
|
||
method,
|
||
data: payload,
|
||
header: headers,
|
||
timeout: 3e4
|
||
// 增加超时时间到30秒
|
||
});
|
||
const { statusCode, data } = res;
|
||
if (statusCode === 200 && data && (data.success || data.code === 200)) {
|
||
common_vendor.index.showToast({
|
||
title: (data == null ? void 0 : data.message) || (this.tagViewMode === "edit" ? "更新成功" : "保存成功"),
|
||
icon: "success"
|
||
});
|
||
this.tagViewMode = "list";
|
||
this.tagPage.current = 1;
|
||
this.fetchTagList({ force: true });
|
||
} else {
|
||
throw new Error((data == null ? void 0 : data.message) || (this.tagViewMode === "edit" ? "更新失败" : "保存失败"));
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.__f__("error", "at pages/furniture_reception/furniture_reception.vue:956", "保存标签失败:", error);
|
||
let errorMessage = (error == null ? void 0 : error.message) || (this.tagViewMode === "edit" ? "更新失败,请重试" : "保存失败,请重试");
|
||
if (error.errMsg) {
|
||
if (error.errMsg.includes("timeout")) {
|
||
errorMessage = "请求超时,请检查网络连接后重试";
|
||
} else if (error.errMsg.includes("fail")) {
|
||
errorMessage = "网络请求失败,请检查网络连接";
|
||
}
|
||
}
|
||
common_vendor.index.showToast({
|
||
title: errorMessage,
|
||
icon: "none",
|
||
duration: 3e3
|
||
});
|
||
} finally {
|
||
common_vendor.index.hideLoading();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
if (!Array) {
|
||
const _easycom_uni_nav_bar2 = common_vendor.resolveComponent("uni-nav-bar");
|
||
const _component_service_list_furniture = common_vendor.resolveComponent("service-list-furniture");
|
||
const _component_common_begin_reception = common_vendor.resolveComponent("common-begin-reception");
|
||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||
(_easycom_uni_nav_bar2 + _component_service_list_furniture + _component_common_begin_reception + _easycom_uni_icons2)();
|
||
}
|
||
const _easycom_uni_nav_bar = () => "../../uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.js";
|
||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||
if (!Math) {
|
||
(_easycom_uni_nav_bar + _easycom_uni_icons)();
|
||
}
|
||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
return common_vendor.e({
|
||
a: common_vendor.o($options.goBack),
|
||
b: common_vendor.p({
|
||
fixed: true,
|
||
statusBar: true,
|
||
border: false,
|
||
title: "AI销冠系统",
|
||
leftIcon: "left",
|
||
color: "#333",
|
||
backgroundColor: "#FFFFFF"
|
||
}),
|
||
c: $data.activeTab === "status" ? 1 : "",
|
||
d: common_vendor.o(($event) => $options.switchTab("status")),
|
||
e: $data.activeTab === "reception" ? 1 : "",
|
||
f: common_vendor.o(($event) => $options.switchTab("reception")),
|
||
g: $data.activeTab === "tag" ? 1 : "",
|
||
h: common_vendor.o(($event) => $options.switchTab("tag")),
|
||
i: $options.computedNavbarTop || $data.navbarTop,
|
||
j: $data.activeTab === "status"
|
||
}, $data.activeTab === "status" ? {
|
||
k: $options.computedContentTop || $data.contentTop
|
||
} : {}, {
|
||
l: $data.activeTab === "reception"
|
||
}, $data.activeTab === "reception" ? {
|
||
m: common_vendor.o($options.onReceptionCancel),
|
||
n: common_vendor.o($options.onReceptionSaveSuccess),
|
||
o: common_vendor.o($options.onReceptionSaveError),
|
||
p: common_vendor.p({
|
||
["initial-data"]: $data.receptionForm
|
||
})
|
||
} : {}, {
|
||
q: $data.activeTab === "tag" && $data.tagViewMode === "list"
|
||
}, $data.activeTab === "tag" && $data.tagViewMode === "list" ? common_vendor.e({
|
||
r: common_vendor.t($data.tagTotal),
|
||
s: common_vendor.o((...args) => $options.onTagListSearch && $options.onTagListSearch(...args)),
|
||
t: $data.tagQuery.tagType,
|
||
v: common_vendor.o(($event) => $data.tagQuery.tagType = $event.detail.value),
|
||
w: common_vendor.o((...args) => $options.onTagListSearch && $options.onTagListSearch(...args)),
|
||
x: $data.tagQuery.tagName,
|
||
y: common_vendor.o(($event) => $data.tagQuery.tagName = $event.detail.value),
|
||
z: common_vendor.p({
|
||
type: "refresh",
|
||
size: "18",
|
||
color: "#2A68FF"
|
||
}),
|
||
A: common_vendor.o((...args) => $options.onTagListRefresh && $options.onTagListRefresh(...args)),
|
||
B: common_vendor.p({
|
||
type: "plus",
|
||
size: "18",
|
||
color: "#2A68FF"
|
||
}),
|
||
C: common_vendor.o((...args) => $options.showAddTag && $options.showAddTag(...args)),
|
||
D: common_vendor.f($data.tagList, (item, index, i0) => {
|
||
return common_vendor.e({
|
||
a: common_vendor.t((item.tagName || item.name || "标").charAt(0)),
|
||
b: common_vendor.t(item.tagName || item.name || "未命名标签"),
|
||
c: common_vendor.o(($event) => $options.onTagItemClick(item), index),
|
||
d: "3d5558b6-5-" + i0,
|
||
e: common_vendor.o(($event) => $options.onTagActionBtnClick(item), index),
|
||
f: item.industry
|
||
}, item.industry ? {
|
||
g: common_vendor.t(item.industry)
|
||
} : {}, {
|
||
h: common_vendor.o(($event) => $options.onTagItemClick(item), index),
|
||
i: item.tagDetail || item.detail || item.remark
|
||
}, item.tagDetail || item.detail || item.remark ? common_vendor.e({
|
||
j: item.tagDetail || item.detail
|
||
}, item.tagDetail || item.detail ? {
|
||
k: common_vendor.t(item.tagDetail || item.detail)
|
||
} : {}, {
|
||
l: item.remark
|
||
}, item.remark ? {
|
||
m: common_vendor.t(item.remark)
|
||
} : {}, {
|
||
n: common_vendor.o(($event) => $options.onTagItemClick(item), index)
|
||
}) : {}, {
|
||
o: $data.selectedTagItem && $data.selectedTagItem.id === item.id && $data.showTagActionMenu
|
||
}, $data.selectedTagItem && $data.selectedTagItem.id === item.id && $data.showTagActionMenu ? {
|
||
p: common_vendor.o(($event) => $options.editTag(item), index),
|
||
q: common_vendor.o(($event) => $options.deleteTag(item), index),
|
||
r: common_vendor.o(() => {
|
||
}, index)
|
||
} : {}, {
|
||
s: index,
|
||
t: $data.selectedTagItem && $data.selectedTagItem.id === item.id ? 1 : ""
|
||
});
|
||
}),
|
||
E: common_vendor.p({
|
||
type: "more-filled",
|
||
size: "20",
|
||
color: "#999"
|
||
}),
|
||
F: $data.showTagActionMenu
|
||
}, $data.showTagActionMenu ? {
|
||
G: common_vendor.o((...args) => $options.closeTagActionMenu && $options.closeTagActionMenu(...args))
|
||
} : {}, {
|
||
H: !$data.tagLoading && !$data.tagList.length
|
||
}, !$data.tagLoading && !$data.tagList.length ? {} : {}, {
|
||
I: $data.tagLoading && $data.tagList.length
|
||
}, $data.tagLoading && $data.tagList.length ? {} : {}, {
|
||
J: $options.computedContentTop || $data.contentTop,
|
||
K: common_vendor.o((...args) => $options.onTagListReachBottom && $options.onTagListReachBottom(...args))
|
||
}) : {}, {
|
||
L: $data.activeTab === "tag" && ($data.tagViewMode === "add" || $data.tagViewMode === "edit")
|
||
}, $data.activeTab === "tag" && ($data.tagViewMode === "add" || $data.tagViewMode === "edit") ? common_vendor.e({
|
||
M: $data.tagViewMode === "add"
|
||
}, $data.tagViewMode === "add" ? {
|
||
N: $data.tagForm.industry,
|
||
O: common_vendor.o(($event) => $data.tagForm.industry = $event.detail.value)
|
||
} : {}, {
|
||
P: common_vendor.t($data.tagForm.tagType || "请选择标签分类"),
|
||
Q: common_vendor.n($data.tagForm.tagType ? "form-item__picker-text" : "form-item__picker-placeholder"),
|
||
R: common_vendor.p({
|
||
type: "bottom",
|
||
size: "16",
|
||
color: "#9ca3af"
|
||
}),
|
||
S: common_vendor.o((...args) => $options.toggleTagTypeDropdown && $options.toggleTagTypeDropdown(...args)),
|
||
T: $data.showTagTypeDropdown
|
||
}, $data.showTagTypeDropdown ? {
|
||
U: common_vendor.f($data.tagTypeOptions, (option, k0, i0) => {
|
||
return {
|
||
a: common_vendor.t(option),
|
||
b: option === $data.tagForm.tagType ? 1 : "",
|
||
c: option,
|
||
d: common_vendor.o(($event) => $options.selectTagType(option), option)
|
||
};
|
||
}),
|
||
V: common_vendor.o(() => {
|
||
})
|
||
} : {}, {
|
||
W: $data.tagForm.name,
|
||
X: common_vendor.o(($event) => $data.tagForm.name = $event.detail.value),
|
||
Y: $data.tagForm.detail,
|
||
Z: common_vendor.o(($event) => $data.tagForm.detail = $event.detail.value),
|
||
aa: $data.tagForm.remark,
|
||
ab: common_vendor.o(($event) => $data.tagForm.remark = $event.detail.value),
|
||
ac: $data.tagForm.enabled,
|
||
ad: common_vendor.o((...args) => $options.onEnabledChange && $options.onEnabledChange(...args)),
|
||
ae: common_vendor.o((...args) => $options.cancelAddTag && $options.cancelAddTag(...args)),
|
||
af: common_vendor.t($data.tagViewMode === "edit" ? "更新" : "保存"),
|
||
ag: common_vendor.o((...args) => $options.saveTag && $options.saveTag(...args)),
|
||
ah: $data.showTagTypeDropdown
|
||
}, $data.showTagTypeDropdown ? {
|
||
ai: common_vendor.o((...args) => $options.closeTagTypeDropdown && $options.closeTagTypeDropdown(...args))
|
||
} : {}, {
|
||
aj: $options.computedContentTop || $data.contentTop
|
||
}) : {});
|
||
}
|
||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||
wx.createPage(MiniProgramPage);
|
||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/furniture_reception/furniture_reception.js.map
|