优化后,再次提交
This commit is contained in:
339
unpackage/dist/dev/mp-weixin/pages/closeout/application.js
vendored
Normal file
339
unpackage/dist/dev/mp-weixin/pages/closeout/application.js
vendored
Normal file
@@ -0,0 +1,339 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_picker2 + _easycom_up_datetime_picker2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_picker + _easycom_up_datetime_picker + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "application",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const showHazardPicker = common_vendor.ref(false);
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const showDeptPicker = common_vendor.ref(false);
|
||||
const selectedHazard = common_vendor.ref("");
|
||||
const selectedHazardId = common_vendor.ref("");
|
||||
const hazardColumns = common_vendor.ref([["暂无数据"]]);
|
||||
const acceptanceHazardList = common_vendor.ref([]);
|
||||
const hazardList = common_vendor.ref([]);
|
||||
const selectedDeptName = common_vendor.ref("");
|
||||
const selectedDeptId = common_vendor.ref("");
|
||||
const deptColumns = common_vendor.ref([["暂无数据"]]);
|
||||
const deptList = common_vendor.ref([]);
|
||||
const dateValue = common_vendor.ref(Date.now());
|
||||
const aiGenerating = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
rectifyDeadline: "",
|
||||
// 整改时限
|
||||
responsibleDeptId: "",
|
||||
// 隐患治理责任单位ID
|
||||
responsiblePerson: "",
|
||||
// 主要负责人
|
||||
mainTreatmentContent: "",
|
||||
// 主要治理内容
|
||||
treatmentResult: "",
|
||||
// 隐患治理完成内容
|
||||
selfVerifyContent: ""
|
||||
// 责任单位自行验收情况
|
||||
});
|
||||
const fetchWriteOffList = async () => {
|
||||
try {
|
||||
const res = await request_api.getMyWriteOffList();
|
||||
if (res.code === 0 && res.data) {
|
||||
hazardList.value = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:148", "销号申请列表:", res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:151", "获取销号申请列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchAcceptanceList = async () => {
|
||||
try {
|
||||
const res = await request_api.getAcceptanceList();
|
||||
if (res.code === 0 && res.data) {
|
||||
const list = res.data.records || res.data || [];
|
||||
acceptanceHazardList.value = list;
|
||||
if (list.length > 0) {
|
||||
hazardColumns.value = [list.map((item) => item.title || item.hazardTitle || `隐患${item.hazardId}`)];
|
||||
} else {
|
||||
hazardColumns.value = [["暂无可申请销号的隐患"]];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:168", "可申请销号的隐患列表:", list);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:171", "获取可申请销号隐患列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchDeptList = async () => {
|
||||
try {
|
||||
const res = await request_api.getDepartmentPersonUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
const users = [];
|
||||
res.data.forEach((dept) => {
|
||||
if (dept.users && dept.users.length > 0) {
|
||||
dept.users.forEach((user) => {
|
||||
users.push({
|
||||
userId: user.userId,
|
||||
deptId: dept.deptId,
|
||||
name: `${user.nickName}(${dept.deptName})`
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
deptList.value = users;
|
||||
if (users.length > 0) {
|
||||
deptColumns.value = [users.map((item) => item.name)];
|
||||
} else {
|
||||
deptColumns.value = [["暂无人员数据"]];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:199", "部门人员列表:", users);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:202", "获取部门人员列表失败:", error);
|
||||
}
|
||||
};
|
||||
const onDeptConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:208", "选择的人员:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
selectedDeptName.value = e.value[0];
|
||||
const index = e.indexs[0];
|
||||
if (deptList.value[index]) {
|
||||
selectedDeptId.value = deptList.value[index].deptId;
|
||||
formData.responsibleDeptId = deptList.value[index].deptId;
|
||||
}
|
||||
}
|
||||
showDeptPicker.value = false;
|
||||
};
|
||||
const openAddPopup = () => {
|
||||
resetForm();
|
||||
fetchAcceptanceList();
|
||||
fetchDeptList();
|
||||
showAddPopup.value = true;
|
||||
};
|
||||
const onHazardConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:231", "选择的隐患:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
selectedHazard.value = e.value[0];
|
||||
const index = e.indexs[0];
|
||||
if (acceptanceHazardList.value[index]) {
|
||||
selectedHazardId.value = acceptanceHazardList.value[index].hazardId;
|
||||
}
|
||||
}
|
||||
showHazardPicker.value = false;
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:245", "选择的日期时间:", e);
|
||||
const date = new Date(e.value);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||
formData.rectifyDeadline = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
showDatePicker.value = false;
|
||||
};
|
||||
const resetForm = () => {
|
||||
selectedHazard.value = "";
|
||||
selectedHazardId.value = "";
|
||||
selectedDeptName.value = "";
|
||||
selectedDeptId.value = "";
|
||||
formData.rectifyDeadline = "";
|
||||
formData.responsibleDeptId = "";
|
||||
formData.responsiblePerson = "";
|
||||
formData.mainTreatmentContent = "";
|
||||
formData.treatmentResult = "";
|
||||
formData.selfVerifyContent = "";
|
||||
};
|
||||
const handleAiGenerate = async () => {
|
||||
if (!selectedHazardId.value) {
|
||||
common_vendor.index.showToast({ title: "请先选择隐患", icon: "none" });
|
||||
return;
|
||||
}
|
||||
aiGenerating.value = true;
|
||||
try {
|
||||
const hazardRes = await request_api.getHiddenDangerDetail({ hazardId: selectedHazardId.value });
|
||||
if (hazardRes.code !== 0 || !hazardRes.data) {
|
||||
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const assigns = hazardRes.data.assigns;
|
||||
if (!assigns || assigns.length === 0 || !assigns[0].rectify) {
|
||||
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const rectifyId = assigns[0].rectify.rectifyId;
|
||||
const rectifyRes = await request_api.getRectifyDetail({ rectifyId });
|
||||
if (rectifyRes.code !== 0 || !rectifyRes.data) {
|
||||
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const rectifyPlan = rectifyRes.data.rectifyPlan;
|
||||
if (!rectifyPlan) {
|
||||
common_vendor.index.showToast({ title: "整改方案内容为空", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const aiRes = await request_api.generateWriteoffContent({ rectifyContent: rectifyPlan });
|
||||
if (aiRes.code === 0 && aiRes.data) {
|
||||
formData.mainTreatmentContent = aiRes.data.mainContent || "";
|
||||
formData.treatmentResult = aiRes.data.completionContent || "";
|
||||
formData.selfVerifyContent = aiRes.data.selfInspection || "";
|
||||
common_vendor.index.showToast({ title: "AI生成成功", icon: "success" });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:319", "AI生成销号方案失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI生成失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiGenerating.value = false;
|
||||
}
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
if (!selectedHazardId.value) {
|
||||
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
hazardId: Number(selectedHazardId.value),
|
||||
// 隐患ID(必需)
|
||||
rectifyDeadline: formData.rectifyDeadline || "",
|
||||
// 整改时限
|
||||
responsibleDeptId: Number(formData.responsibleDeptId) || 0,
|
||||
// 隐患治理责任单位ID
|
||||
responsiblePerson: formData.responsiblePerson || "",
|
||||
// 主要负责人
|
||||
mainTreatmentContent: formData.mainTreatmentContent || "",
|
||||
// 主要治理内容
|
||||
treatmentResult: formData.treatmentResult || "",
|
||||
// 隐患治理完成内容
|
||||
selfVerifyContent: formData.selfVerifyContent || ""
|
||||
// 责任单位自行验收情况
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:344", "提交数据:", params);
|
||||
try {
|
||||
const res = await request_api.applyDelete(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "申请成功", icon: "success" });
|
||||
showAddPopup.value = false;
|
||||
resetForm();
|
||||
fetchWriteOffList();
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:358", "申请失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const editor = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/closeout/editor"
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
fetchWriteOffList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(hazardList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.hazardTitle),
|
||||
b: common_vendor.t(item.statusName),
|
||||
c: common_vendor.t(item.hazardCreatedAt),
|
||||
d: common_vendor.t(item.responsibleDeptName),
|
||||
e: common_vendor.t(item.responsiblePerson),
|
||||
f: common_vendor.t(item.createdAt),
|
||||
g: common_vendor.o(($event) => editor(), index),
|
||||
h: index
|
||||
};
|
||||
}),
|
||||
b: common_vendor.o(openAddPopup),
|
||||
c: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
|
||||
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
|
||||
f: common_vendor.o(($event) => showHazardPicker.value = true),
|
||||
g: common_vendor.o(onHazardConfirm),
|
||||
h: common_vendor.o(($event) => showHazardPicker.value = false),
|
||||
i: common_vendor.o(($event) => showHazardPicker.value = false),
|
||||
j: common_vendor.p({
|
||||
show: showHazardPicker.value,
|
||||
columns: hazardColumns.value
|
||||
}),
|
||||
k: common_vendor.t(formData.rectifyDeadline || "请选择整改时限"),
|
||||
l: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
|
||||
m: common_vendor.o(($event) => showDatePicker.value = true),
|
||||
n: common_vendor.o(onDateConfirm),
|
||||
o: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
p: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
q: common_vendor.o(($event) => dateValue.value = $event),
|
||||
r: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: dateValue.value
|
||||
}),
|
||||
s: common_vendor.t(selectedDeptName.value || "请选择隐患治理责任单位"),
|
||||
t: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
|
||||
v: common_vendor.o(($event) => showDeptPicker.value = true),
|
||||
w: common_vendor.o(onDeptConfirm),
|
||||
x: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
y: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
z: common_vendor.p({
|
||||
show: showDeptPicker.value,
|
||||
columns: deptColumns.value
|
||||
}),
|
||||
A: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
B: common_vendor.p({
|
||||
placeholder: "请输入主要负责人",
|
||||
modelValue: formData.responsiblePerson
|
||||
}),
|
||||
C: !aiGenerating.value
|
||||
}, !aiGenerating.value ? {} : {}, {
|
||||
D: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
|
||||
E: aiGenerating.value,
|
||||
F: aiGenerating.value,
|
||||
G: common_vendor.o(handleAiGenerate),
|
||||
H: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
|
||||
I: common_vendor.p({
|
||||
placeholder: "请输入主要治理内容",
|
||||
modelValue: formData.mainTreatmentContent
|
||||
}),
|
||||
J: common_vendor.o(($event) => formData.treatmentResult = $event),
|
||||
K: common_vendor.p({
|
||||
placeholder: "请输入隐患治理完成情况",
|
||||
modelValue: formData.treatmentResult
|
||||
}),
|
||||
L: common_vendor.o(($event) => formData.selfVerifyContent = $event),
|
||||
M: common_vendor.p({
|
||||
placeholder: "请输入隐患治理责任单位自行验收的情况",
|
||||
modelValue: formData.selfVerifyContent
|
||||
}),
|
||||
N: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
O: common_vendor.o(handleAdd),
|
||||
P: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
Q: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
R: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4b6250eb"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/application.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/pages/closeout/application.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/closeout/application.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "销号申请",
|
||||
"usingComponents": {
|
||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-4b6250eb', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{R}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="padding bg-white radius margin-bottom data-v-4b6250eb"><view class="flex justify-between margin-bottom data-v-4b6250eb"><view class="text-bold text-black data-v-4b6250eb">{{item.a}}</view><view class="data-v-4b6250eb">{{item.b}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">隐患日期:</view><view class="text-black data-v-4b6250eb">{{item.c}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">责任单位:</view><view class="text-black data-v-4b6250eb">{{item.d}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">判定人员:</view><view class="text-black data-v-4b6250eb">{{item.e}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">创建时间:</view><view class="text-black data-v-4b6250eb">{{item.f}}</view></view><view class="flex justify-between data-v-4b6250eb"><view class="data-v-4b6250eb"></view><view class="data-v-4b6250eb"><button class="bg-blue round cu-btn lg data-v-4b6250eb" bindtap="{{item.g}}">查看详情</button></view></view></view><button class="cuIcon-add bg-blue round margin-top data-v-4b6250eb" bindtap="{{b}}">新增</button><u-popup wx:if="{{Q}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-s="{{['d']}}" bindclose="{{P}}" u-i="4b6250eb-0" bind:__l="__l" u-p="{{Q}}"><view class="popup-content data-v-4b6250eb"><view class="popup-header data-v-4b6250eb"><view class="popup-title text-bold data-v-4b6250eb">新增销号申请</view><view class="popup-close data-v-4b6250eb" bindtap="{{c}}">×</view></view><scroll-view class="popup-body data-v-4b6250eb" scroll-y style="{{'height:' + '60vh'}}"><view class="flex margin-bottom data-v-4b6250eb"><view class="data-v-4b6250eb">隐患</view><view class="text-red data-v-4b6250eb">*</view></view><view class="picker-input data-v-4b6250eb" bindtap="{{f}}"><text class="{{['data-v-4b6250eb', e]}}">{{d}}</text></view><up-picker wx:if="{{j}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{g}}" bindcancel="{{h}}" bindclose="{{i}}" u-i="4b6250eb-1,4b6250eb-0" bind:__l="__l" u-p="{{j}}"></up-picker><view class="flex margin-bottom margin-top data-v-4b6250eb"><view class="data-v-4b6250eb">整改时限</view></view><view class="picker-input data-v-4b6250eb" bindtap="{{m}}"><text class="{{['data-v-4b6250eb', l]}}">{{k}}</text></view><up-datetime-picker wx:if="{{r}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{n}}" bindcancel="{{o}}" bindclose="{{p}}" u-i="4b6250eb-2,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"></up-datetime-picker><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位</view><view class="picker-input data-v-4b6250eb" bindtap="{{v}}"><text class="{{['data-v-4b6250eb', t]}}">{{s}}</text></view><up-picker wx:if="{{z}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{w}}" bindcancel="{{x}}" bindclose="{{y}}" u-i="4b6250eb-3,4b6250eb-0" bind:__l="__l" u-p="{{z}}"></up-picker><view class="margin-bottom margin-top data-v-4b6250eb">主要负责人</view><up-input wx:if="{{B}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-4,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{A}}" u-p="{{B}}"></up-input><view class="ai-btn-wrapper margin-top margin-bottom data-v-4b6250eb"><button class="ai-analyze-btn data-v-4b6250eb" loading="{{E}}" disabled="{{F}}" bindtap="{{G}}"><text wx:if="{{C}}" class="cuIcon-magic ai-btn-icon data-v-4b6250eb"></text> {{D}}</button></view><view class="margin-bottom margin-top data-v-4b6250eb">主要治理内容</view><up-textarea wx:if="{{I}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-5,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{H}}" u-p="{{I}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理完成内容</view><up-textarea wx:if="{{K}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-6,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{J}}" u-p="{{K}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{M}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-7,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{L}}" u-p="{{M}}"></up-textarea></scroll-view><view class="popup-footer data-v-4b6250eb"><button class="btn-cancel data-v-4b6250eb" bindtap="{{N}}">取消</button><button class="btn-confirm bg-blue data-v-4b6250eb" bindtap="{{O}}">确定</button></view></view></u-popup></view>
|
||||
112
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxss
vendored
Normal file
112
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxss
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-4b6250eb {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.popup-content.data-v-4b6250eb {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-4b6250eb {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-4b6250eb {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-4b6250eb {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-4b6250eb {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.popup-footer.data-v-4b6250eb {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-4b6250eb {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-4b6250eb::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-4b6250eb {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-4b6250eb {
|
||||
color: #fff;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-4b6250eb {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-4b6250eb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-4b6250eb::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-4b6250eb {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-4b6250eb {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.picker-input.data-v-4b6250eb {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1rpx solid #eee;
|
||||
}
|
||||
.picker-input text.data-v-4b6250eb {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
137
unpackage/dist/dev/mp-weixin/pages/closeout/editor.js
vendored
Normal file
137
unpackage/dist/dev/mp-weixin/pages/closeout/editor.js
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
_easycom_up_input2();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
if (!Math) {
|
||||
_easycom_up_input();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "editor",
|
||||
setup(__props) {
|
||||
const getPageOptions = () => {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
return (currentPage == null ? void 0 : currentPage.options) || {};
|
||||
};
|
||||
const pageId = common_vendor.ref("");
|
||||
const canEdit = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
id: "",
|
||||
hazardId: "",
|
||||
hazardTitle: "",
|
||||
// 隐患标题
|
||||
hazardCreatedAt: "",
|
||||
// 隐患日期
|
||||
responsibleDeptName: "",
|
||||
// 隐患治理责任单位
|
||||
responsiblePerson: "",
|
||||
// 主要负责人
|
||||
createdAt: "",
|
||||
// 创建时间
|
||||
statusName: ""
|
||||
// 状态
|
||||
});
|
||||
const fetchDetail = async (id) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:56", "=== fetchDetail 被调用 ===, id:", id);
|
||||
try {
|
||||
const res = await request_api.getMyWriteOffList();
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:59", "接口返回:", res);
|
||||
if (res.code === 0 && res.data && res.data.length > 0) {
|
||||
const list = res.data;
|
||||
let data = null;
|
||||
if (id) {
|
||||
data = list.find((item) => item.id == id);
|
||||
}
|
||||
if (!data) {
|
||||
data = list[0];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:72", "绑定数据:", data);
|
||||
formData.id = data.id;
|
||||
formData.hazardId = data.hazardId;
|
||||
formData.hazardTitle = data.hazardTitle || "";
|
||||
formData.hazardCreatedAt = data.hazardCreatedAt || "";
|
||||
formData.responsibleDeptName = data.responsibleDeptName || "";
|
||||
formData.responsiblePerson = data.responsiblePerson || "";
|
||||
formData.createdAt = data.createdAt || "";
|
||||
formData.statusName = data.statusName || "";
|
||||
if (data.status == 1 || data.statusName === "待审核") {
|
||||
canEdit.value = true;
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:86", "状态为待审核,可以编辑");
|
||||
} else {
|
||||
canEdit.value = false;
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:89", "状态为已审核,不可编辑");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/editor.vue:93", "获取详情失败:", error);
|
||||
}
|
||||
};
|
||||
const handleCancel = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:114", "=== onLoad 触发 ===");
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:115", "options:", options);
|
||||
pageId.value = (options == null ? void 0 : options.id) || "";
|
||||
fetchDetail(pageId.value);
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:122", "=== onMounted 触发 ===");
|
||||
if (!pageId.value) {
|
||||
const options = getPageOptions();
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:125", "备用获取参数:", options);
|
||||
pageId.value = (options == null ? void 0 : options.id) || "";
|
||||
fetchDetail(pageId.value);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => formData.hazardTitle = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardTitle
|
||||
}),
|
||||
c: common_vendor.o(($event) => formData.hazardCreatedAt = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardCreatedAt
|
||||
}),
|
||||
e: common_vendor.o(($event) => formData.responsibleDeptName = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsibleDeptName
|
||||
}),
|
||||
g: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsiblePerson
|
||||
}),
|
||||
i: common_vendor.o(($event) => formData.createdAt = $event),
|
||||
j: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.createdAt
|
||||
}),
|
||||
k: common_vendor.o(($event) => formData.statusName = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.statusName
|
||||
}),
|
||||
m: common_vendor.o(handleCancel),
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bbd4165b"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/editor.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/pages/closeout/editor.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pages/closeout/editor.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "销号详情",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-bbd4165b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{n}}"><view class="padding bg-white radius data-v-bbd4165b"><view class="flex margin-bottom data-v-bbd4165b"><view class="text-gray data-v-bbd4165b">隐患</view></view><up-input wx:if="{{b}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患日期</view><up-input wx:if="{{d}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患治理责任单位</view><up-input wx:if="{{f}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">主要负责人</view><up-input wx:if="{{h}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">创建时间</view><up-input wx:if="{{j}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-4" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">状态</view><up-input wx:if="{{l}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-5" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-input><view class="flex justify-center margin-top-xl data-v-bbd4165b" style="gap:30rpx"><button class="round cu-btn lg data-v-bbd4165b" bindtap="{{m}}">返回</button></view></view></view>
|
||||
30
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxss
vendored
Normal file
30
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxss
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-bbd4165b {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
Reference in New Issue
Block a user