first commit
This commit is contained in:
134
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.js
vendored
Normal file
134
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.js
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
|
||||
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2)();
|
||||
}
|
||||
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
||||
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspectionresult",
|
||||
setup(__props) {
|
||||
const oneTableId = common_vendor.ref("");
|
||||
const checkData = common_vendor.ref(null);
|
||||
const radiolist1 = common_vendor.reactive([
|
||||
{
|
||||
name: "正常",
|
||||
value: 1,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "异常",
|
||||
value: 2,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "不涉及",
|
||||
value: 3,
|
||||
disabled: false
|
||||
}
|
||||
]);
|
||||
const radiovalue1 = common_vendor.ref("");
|
||||
const groupChange = (n) => {
|
||||
console.log("groupChange", n);
|
||||
};
|
||||
const radioChange = (n) => {
|
||||
console.log("radioChange", n);
|
||||
};
|
||||
const value1 = common_vendor.ref("");
|
||||
const handleSubmit = async () => {
|
||||
var _a;
|
||||
if (!radiovalue1.value) {
|
||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const selectedItem = radiolist1.find((item) => item.name === radiovalue1.value);
|
||||
const resultValue = selectedItem ? selectedItem.value : null;
|
||||
if (!resultValue) {
|
||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const params = {
|
||||
taskId: (_a = checkData.value) == null ? void 0 : _a.taskId,
|
||||
result: resultValue,
|
||||
remark: value1.value
|
||||
};
|
||||
console.log("提交参数:", params);
|
||||
const res = await request_api.submitCheckResult(params);
|
||||
console.log("提交结果:", res);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "提交成功", icon: "success" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("提交失败:", error);
|
||||
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const getCheckData = async () => {
|
||||
try {
|
||||
const res = await request_api.enterCheckPlan(oneTableId.value);
|
||||
console.log("检查项数据:", res);
|
||||
if (res.code === 0) {
|
||||
checkData.value = res.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
console.log("接收到的参数:", options);
|
||||
if (options.id) {
|
||||
oneTableId.value = options.id;
|
||||
getCheckData();
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
var _a, _b;
|
||||
return {
|
||||
a: common_vendor.t(((_a = checkData.value) == null ? void 0 : _a.name) || "加载中..."),
|
||||
b: ((_b = checkData.value) == null ? void 0 : _b.point) || "",
|
||||
c: common_vendor.f(radiolist1, (item, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: common_vendor.o(radioChange, index),
|
||||
c: "643afff0-1-" + i0 + ",643afff0-0",
|
||||
d: common_vendor.p({
|
||||
customStyle: {
|
||||
marginBottom: "8px"
|
||||
},
|
||||
label: item.name,
|
||||
name: item.name
|
||||
})
|
||||
};
|
||||
}),
|
||||
d: common_vendor.o(groupChange),
|
||||
e: common_vendor.o(($event) => radiovalue1.value = $event),
|
||||
f: common_vendor.p({
|
||||
placement: "row",
|
||||
modelValue: radiovalue1.value
|
||||
}),
|
||||
g: common_vendor.o(($event) => value1.value = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入备注信息",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
i: common_vendor.o(handleSubmit)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-643afff0"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
8
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "检查结果",
|
||||
"usingComponents": {
|
||||
"u-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
||||
"u-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-643afff0', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-643afff0"><view class="text-bold data-v-643afff0">{{a}}</view><view class="margin-top data-v-643afff0"><rich-text class="data-v-643afff0" nodes="{{b}}"></rich-text></view><view class="margin-top data-v-643afff0"><u-radio-group wx:if="{{f}}" class="data-v-643afff0" virtualHostClass="data-v-643afff0" u-s="{{['d']}}" bindchange="{{d}}" u-i="643afff0-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"><u-radio wx:for="{{c}}" wx:for-item="item" wx:key="a" class="data-v-643afff0" virtualHostClass="data-v-643afff0" bindchange="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></u-radio></u-radio-group></view><view class="data-v-643afff0"><up-textarea wx:if="{{h}}" class="data-v-643afff0" virtualHostClass="data-v-643afff0" u-i="643afff0-2" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-textarea></view></view><button class="bg-blue round margin-top-xl data-v-643afff0" bindtap="{{i}}">提交</button></view>
|
||||
30
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxss
vendored
Normal file
30
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.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-643afff0 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
Reference in New Issue
Block a user