提交 ca273371 authored 作者: JaxBBLL's avatar JaxBBLL

fix: input number

上级 f0e0c2e4
......@@ -23,15 +23,46 @@
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view> </view
><input
</view>
</view>
<!-- <input
v-if="'value' in item"
class="input"
v-model="item.value"
type="text"
placeholder="请输入"
maxlength="3"
/>{{ item.unit }}
/> -->
<template v-if="'value' in item">
<NumberInput
v-if="index == 0"
class="input"
v-model="item.value"
type="number"
allowNegative
:max="100"
:min="-100"
placeholder="请输入"
/>
<NumberInput
v-if="index == 1"
class="input"
v-model="item.value"
type="number"
:max="100"
:min="0"
placeholder="请输入"
/>
<NumberInput
v-else
class="input"
v-model="item.value"
type="number"
placeholder="请输入"
/>
</template>
{{ item.unit }}
</view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item">
......@@ -81,6 +112,7 @@
</template>
<script>
import NumberInput from "@/components/NumberInput/index.vue";
import CommonUpload from "@/components/CommonUpload/index.vue";
import customPopup from "./customPopup.vue";
import _ from "lodash";
......@@ -88,6 +120,7 @@ import mixin from "./mixin";
export default {
mixins: [mixin],
components: {
NumberInput,
CommonUpload,
customPopup,
},
......
......@@ -23,14 +23,39 @@
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view> </view
><input
</view>
</view>
<!-- <input
v-if="'value' in item"
class="input"
v-model="item.value"
type="text"
placeholder="请输入"
/>{{ item.unit }}
/> -->
<template v-if="'value' in item">
<NumberInput
v-if="index == 0"
class="input"
v-model="item.value"
type="number"
allowNegative
:max="100"
:min="-100"
placeholder="请输入"
/>
<NumberInput
v-if="index == 1"
class="input"
v-model="item.value"
type="number"
:max="100"
:min="0"
placeholder="请输入"
/>
</template>
{{ item.unit }}
</view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item">
......@@ -80,6 +105,7 @@
</template>
<script>
import NumberInput from "@/components/NumberInput/index.vue";
import CommonUpload from "@/components/CommonUpload/index.vue";
import customPopup from "./customPopup.vue";
import _ from "lodash";
......@@ -87,6 +113,7 @@ import mixin from "./mixin";
export default {
mixins: [mixin],
components: {
NumberInput,
CommonUpload,
customPopup,
},
......
......@@ -23,15 +23,26 @@
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view> </view
><input
</view>
</view>
<!-- <input
v-if="'value' in item && item.inspectionResult === 1"
class="input"
v-model="item.value"
type="text"
placeholder="请输入"
maxlength="3"
/>{{ item.inspectionResult === 1 ? item.unit : "" }}
/> -->
<NumberInput
v-if="'value' in item && item.inspectionResult === 1"
class="input"
v-model="item.value"
type="number"
:max="10"
:min="0"
placeholder="请输入"
/>
{{ item.inspectionResult === 1 ? item.unit : "" }}
</view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item">
......@@ -81,6 +92,7 @@
</template>
<script>
import NumberInput from "@/components/NumberInput/index.vue";
import CommonUpload from "@/components/CommonUpload/index.vue";
import customPopup from "./customPopup.vue";
import _ from "lodash";
......@@ -88,6 +100,7 @@ import mixin from "./mixin";
export default {
mixins: [mixin],
components: {
NumberInput,
CommonUpload,
customPopup,
},
......
......@@ -548,6 +548,7 @@ export default {
}
const params = this.getParams(isSubmit); //数据获取
console.log("提交时获取一次", params);
this.all_data = this.$store.state.all_data || [];
this.realSave(params).then(() => {
let logContent = "";
......@@ -586,8 +587,11 @@ export default {
// 更新日志
const log_list = this.$store.state.log_list;
logContent.inspectionType = params.inspectionType;
console.log("logContent", logContent);
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => {
console.log("日志文件写入成功");
});
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论