|
@@ -11,13 +11,21 @@
|
|
|
<template #label1></template>
|
|
|
<template #paperTypeBarcodeContentItem>
|
|
|
<div class="flex items-center">
|
|
|
- <a-input-number
|
|
|
+ <!-- <a-input-number
|
|
|
style="width: 200px"
|
|
|
v-model:value="params.paperTypeBarcodeContentItem"
|
|
|
allow-clear
|
|
|
:disabled="!canEdit"
|
|
|
:min="0"
|
|
|
:controls="false"
|
|
|
+ /> -->
|
|
|
+ <a-input
|
|
|
+ style="width: 200px"
|
|
|
+ v-model:value="params.paperTypeBarcodeContentItem"
|
|
|
+ allow-clear
|
|
|
+ :disabled="!canEdit"
|
|
|
+ :maxlength="10"
|
|
|
+ @change="inputChange"
|
|
|
/>
|
|
|
<qm-button
|
|
|
class="m-l-8px"
|
|
@@ -92,7 +100,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script name="ScanParams" lang="ts" setup>
|
|
|
-import { ref, h, onMounted, reactive, computed } from "vue";
|
|
|
+import { ref, h, onMounted, reactive, computed, watch } from "vue";
|
|
|
import { PlusCircleOutlined, SaveOutlined } from "@ant-design/icons-vue";
|
|
|
import useToken from "@/hooks/useToken";
|
|
|
import { EditOutlined } from "@ant-design/icons-vue";
|
|
@@ -111,12 +119,13 @@ const getData = () => {
|
|
|
params.enableSyncVerify = res.enableSyncVerify;
|
|
|
params.scannerAssignedMaxCount = res.scannerAssignedMaxCount;
|
|
|
params.scannerAssignedVerifyPassword = res.scannerAssignedVerifyPassword;
|
|
|
+
|
|
|
+ oldParams = { ...params, paperTypeBarcodeContentItem: "" };
|
|
|
});
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
getData();
|
|
|
});
|
|
|
-let oldTags: string[] = [];
|
|
|
const params = reactive<any>({
|
|
|
paperTypeBarcodeContentItem: "",
|
|
|
paperTypeBarcodeContent: [],
|
|
@@ -126,6 +135,7 @@ const params = reactive<any>({
|
|
|
scannerAssignedMaxCount: "",
|
|
|
scannerAssignedVerifyPassword: "",
|
|
|
});
|
|
|
+let oldParams = { ...params, paperTypeBarcodeContentItem: "" };
|
|
|
const fields = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -273,13 +283,18 @@ const save = () => {
|
|
|
});
|
|
|
};
|
|
|
const willEdit = () => {
|
|
|
- oldTags = JSON.parse(JSON.stringify(params.paperTypeBarcodeContent));
|
|
|
+ oldParams = { ...params, paperTypeBarcodeContentItem: "" };
|
|
|
canEdit.value = !canEdit.value;
|
|
|
};
|
|
|
const cancelEdit = () => {
|
|
|
- params.paperTypeBarcodeContent = oldTags;
|
|
|
+ for (let k in params) {
|
|
|
+ params[k] = oldParams[k];
|
|
|
+ }
|
|
|
canEdit.value = !canEdit.value;
|
|
|
};
|
|
|
+const inputChange = (e: any) => {
|
|
|
+ params.paperTypeBarcodeContentItem = e.target.value.replace(/[^0-9]/g, "");
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.scan-params {
|