|
@@ -3,8 +3,9 @@
|
|
<view class="tag-circle" v-for="(item, index) in initRecords" :key="index" @click="tabsClick(parseInt(item.no))"
|
|
<view class="tag-circle" v-for="(item, index) in initRecords" :key="index" @click="tabsClick(parseInt(item.no))"
|
|
:class="{'checked-tag' : parseInt(item.no) == current}">
|
|
:class="{'checked-tag' : parseInt(item.no) == current}">
|
|
<text class="circle" :class="{
|
|
<text class="circle" :class="{
|
|
- 'bg-green': item.result != '0',
|
|
|
|
- 'bg-black': item.result == '0'
|
|
|
|
|
|
+ 'bg-green': item.result == '合格',
|
|
|
|
+ 'bg-red': item.result == '不合格',
|
|
|
|
+ 'bg-black': item.result != '不合格' && item.result != '合格'
|
|
}">{{item.no}}</text>
|
|
}">{{item.no}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -12,7 +13,6 @@
|
|
<scroll-view style="flex:1">
|
|
<scroll-view style="flex:1">
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
|
|
|
|
- <!-- 检查报告卡片列表 -->
|
|
|
|
<view v-if="reportList.length" class="card-list">
|
|
<view v-if="reportList.length" class="card-list">
|
|
<!-- 注意:v-for 遍历 reportList 时,item 是响应式的,但内部字段需通过计算属性转换 -->
|
|
<!-- 注意:v-for 遍历 reportList 时,item 是响应式的,但内部字段需通过计算属性转换 -->
|
|
<view class="card" v-for="item in reportList" :key="item.no" v-show="current == parseInt(item.no)">
|
|
<view class="card" v-for="item in reportList" :key="item.no" v-show="current == parseInt(item.no)">
|
|
@@ -26,33 +26,33 @@
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">产品码</text>
|
|
<text class="label">产品码</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <input v-model="item.prodno" disabled></input>
|
|
|
|
|
|
+ {{item.prodno}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">检测项目</text>
|
|
<text class="label">检测项目</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <input v-model="item.invname" disabled></input>
|
|
|
|
|
|
+ {{item.invname}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">性质</text>
|
|
<text class="label">性质</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <input v-model="item.nature" disabled></input>
|
|
|
|
|
|
+ {{item.nature}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 上限要求:绑定计算属性 parsedMinNum -->
|
|
<!-- 上限要求:绑定计算属性 parsedMinNum -->
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">上限要求</text>
|
|
<text class="label">上限要求</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <uni-number-box v-model="currentMinNum" :min="0" disabled></uni-number-box>
|
|
|
|
|
|
+ {{item.maxNum}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 下限要求:绑定计算属性 parsedMaxNum(对应 item.maxNum) -->
|
|
<!-- 下限要求:绑定计算属性 parsedMaxNum(对应 item.maxNum) -->
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">下限要求</text>
|
|
<text class="label">下限要求</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <uni-number-box v-model="currentMaxNum" :min="0" disabled></uni-number-box>
|
|
|
|
|
|
+ {{item.minNum}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="divider"></view>
|
|
<view class="divider"></view>
|
|
@@ -60,26 +60,32 @@
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">实测值小</text>
|
|
<text class="label">实测值小</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <uni-number-box v-model="currentMeasuredValue" :step="0.1" :min="0"></uni-number-box>
|
|
|
|
|
|
+ <input type="digit" class="surround uni-input number-input" v-model="item.measuredvalue" @confirm="minNumberChange"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 实测值大:绑定计算属性 parsedMeasuredMaxValue(对应 item.measuredvaluemax) -->
|
|
<!-- 实测值大:绑定计算属性 parsedMeasuredMaxValue(对应 item.measuredvaluemax) -->
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">实测值大</text>
|
|
<text class="label">实测值大</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <uni-number-box v-model="currentMeasuredMaxValue" :step="0.1" :min="0"></uni-number-box>
|
|
|
|
|
|
+ <input type="digit" class="surround uni-input number-input" v-model="item.measuredvaluemax" @confirm="maxNumberChange"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
<text class="label">结论</text>
|
|
<text class="label">结论</text>
|
|
<view class="value">
|
|
<view class="value">
|
|
<radio-group class="radio-group-horizontal" @change="resultChange" v-if="item.nature == '定性'">
|
|
<radio-group class="radio-group-horizontal" @change="resultChange" v-if="item.nature == '定性'">
|
|
- <radio class="radio-group-horizontal-rg" value="1" :checked="item.result == '1'">合格</radio>
|
|
|
|
- <radio class="radio-group-horizontal-rg" value="2" :checked="item.result == '2'">未合格</radio>
|
|
|
|
|
|
+ <radio class="radio-group-horizontal-rg" value="合格" :checked="item.result == '合格'">合格</radio>
|
|
|
|
+ <radio class="radio-group-horizontal-rg" value="不合格" :checked="item.result == '不合格'">不合格</radio>
|
|
</radio-group>
|
|
</radio-group>
|
|
<input v-model="item.result" class="surround uni-input" v-if="item.nature != '定性'"></input>
|
|
<input v-model="item.result" class="surround uni-input" v-if="item.nature != '定性'"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="info-row">
|
|
|
|
+ <text class="label">备注</text>
|
|
|
|
+ <view class="value">
|
|
|
|
+ <input v-model="item.memo" class="surround uni-input" @confirm="remarksChange"></input>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -115,11 +121,6 @@
|
|
const reportList = ref<QcRecord[]>([])
|
|
const reportList = ref<QcRecord[]>([])
|
|
const initRecords = ref<QcRecord[]>([])
|
|
const initRecords = ref<QcRecord[]>([])
|
|
|
|
|
|
- const currentMinNum = ref(0);
|
|
|
|
- const currentMaxNum = ref(0);
|
|
|
|
- const currentMeasuredValue = ref(0);
|
|
|
|
- const currentMeasuredMaxValue = ref(0);
|
|
|
|
-
|
|
|
|
// 下拉框选项数组 - 定性分析选项
|
|
// 下拉框选项数组 - 定性分析选项
|
|
const array = ref(['合格', '不合格']);
|
|
const array = ref(['合格', '不合格']);
|
|
|
|
|
|
@@ -135,19 +136,6 @@
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
- // 处理定性分析下拉框选择变化
|
|
|
|
- const bindPickerChange = (e: UTSJSONObject) => {
|
|
|
|
- // 获取当前选中的报告项
|
|
|
|
- const currentItem = reportList.value.find(item => parseInt(item.no) === current.value);
|
|
|
|
- if (currentItem != null && currentItem.nature === '定性') {
|
|
|
|
- // 0表示合格,1表示不合格
|
|
|
|
- // 简化事件处理,提高兼容性
|
|
|
|
- const detail = e['detail'] as UTSJSONObject | null;
|
|
|
|
- const value = detail != null ? (detail['value'] as number) : 0;
|
|
|
|
- currentItem.result = value == 0 ? '1' : '0';
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
|
|
// 处理picker组件的点击事件,确保在安卓设备上可以正常触发
|
|
// 处理picker组件的点击事件,确保在安卓设备上可以正常触发
|
|
const handlePickerClick = (e: any) => {
|
|
const handlePickerClick = (e: any) => {
|
|
@@ -155,15 +143,6 @@
|
|
console.log('Picker clicked');
|
|
console.log('Picker clicked');
|
|
};
|
|
};
|
|
|
|
|
|
- const updateCurrentValues = (currentItem : QcRecord) => {
|
|
|
|
- currentMinNum.value = getParsedValue.value(currentItem.minNum);
|
|
|
|
- currentMaxNum.value = getParsedValue.value(currentItem.maxNum);
|
|
|
|
- currentMeasuredValue.value = getParsedValue.value(currentItem.measuredvalue);
|
|
|
|
- currentMeasuredMaxValue.value = getParsedValue.value(currentItem.measuredvaluemax);
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// 4. 切换标签时更新 reportList(使用响应式的 initRecords)
|
|
// 4. 切换标签时更新 reportList(使用响应式的 initRecords)
|
|
const tabsClick = (obj : number) => {
|
|
const tabsClick = (obj : number) => {
|
|
current.value = obj;
|
|
current.value = obj;
|
|
@@ -171,9 +150,6 @@
|
|
getParsedValue.value(item.no) === current.value
|
|
getParsedValue.value(item.no) === current.value
|
|
);
|
|
);
|
|
reportList.value = filtered;
|
|
reportList.value = filtered;
|
|
- if (filtered.length > 0) {
|
|
|
|
- updateCurrentValues(filtered[0]); // 手动更新数值
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
const refreshRecords = (index : number) => {
|
|
const refreshRecords = (index : number) => {
|
|
@@ -217,9 +193,6 @@
|
|
getParsedValue.value(item.no) === current.value
|
|
getParsedValue.value(item.no) === current.value
|
|
);
|
|
);
|
|
reportList.value = filtered;
|
|
reportList.value = filtered;
|
|
- if (filtered.length > 0) {
|
|
|
|
- updateCurrentValues(filtered[0]); // 初始化数值
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// #endif
|
|
// #endif
|
|
@@ -245,6 +218,63 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const minNumberChange = (event : UniInputConfirmEvent) => {
|
|
|
|
+ // 获取当前选中的报告项
|
|
|
|
+ const currentItem = reportList.value.find(item => parseInt(item.no) === current.value);
|
|
|
|
+ if (currentItem != null) {
|
|
|
|
+ // 更新结果值
|
|
|
|
+ currentItem.measuredvalue = event.detail.value;
|
|
|
|
+ //更新数据库
|
|
|
|
+ let updatedData = "measuredvalue='" + currentItem.measuredvalue + "'"
|
|
|
|
+ updateData('app_task_record_item', updatedData, 'sxid', currentItem.sxid.toString()).then((res : UTSJSONObject) => {
|
|
|
|
+ let data = res?.['data'] as boolean ?? false
|
|
|
|
+ if (data != null && data== true) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "保存成功!",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const maxNumberChange = (event : UniInputConfirmEvent) => {
|
|
|
|
+ // 获取当前选中的报告项
|
|
|
|
+ const currentItem = reportList.value.find(item => parseInt(item.no) === current.value);
|
|
|
|
+ if (currentItem != null) {
|
|
|
|
+ // 更新结果值
|
|
|
|
+ currentItem.measuredvaluemax = event.detail.value;
|
|
|
|
+ //更新数据库
|
|
|
|
+ let updatedData = "measuredvaluemax='" + currentItem.measuredvaluemax + "'"
|
|
|
|
+ updateData('app_task_record_item', updatedData, 'sxid', currentItem.sxid.toString()).then((res : UTSJSONObject) => {
|
|
|
|
+ let data = res?.['data'] as boolean ?? false
|
|
|
|
+ if (data != null && data== true) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "保存成功!",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const remarksChange = (event : UniInputConfirmEvent) => {
|
|
|
|
+ // 获取当前选中的报告项
|
|
|
|
+ const currentItem = reportList.value.find(item => parseInt(item.no) === current.value);
|
|
|
|
+ if (currentItem != null) {
|
|
|
|
+ // 更新结果值
|
|
|
|
+ currentItem.memo = event.detail.value;
|
|
|
|
+ //更新数据库
|
|
|
|
+ let updatedData = "memo='" + currentItem.memo + "'"
|
|
|
|
+ updateData('app_task_record_item', updatedData, 'sxid', currentItem.sxid.toString()).then((res : UTSJSONObject) => {
|
|
|
|
+ let data = res?.['data'] as boolean ?? false
|
|
|
|
+ if (data != null && data== true) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "保存成功!",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
pdid = options?.pdid ?? "1"
|
|
pdid = options?.pdid ?? "1"
|
|
senum = options?.senum ?? "1"
|
|
senum = options?.senum ?? "1"
|
|
@@ -419,6 +449,7 @@
|
|
.surround {
|
|
.surround {
|
|
border: 1px solid silver;
|
|
border: 1px solid silver;
|
|
border-radius: 10rpx;
|
|
border-radius: 10rpx;
|
|
|
|
+ min-height: 60rpx;
|
|
}
|
|
}
|
|
|
|
|
|
.selectable {
|
|
.selectable {
|
|
@@ -532,4 +563,9 @@
|
|
.btn-second {
|
|
.btn-second {
|
|
right: 15rpx;
|
|
right: 15rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .number-input {
|
|
|
|
+ width: 50%;
|
|
|
|
+ }
|
|
|
|
+
|
|
</style>
|
|
</style>
|