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

fix: input number

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