diff --git a/frontent/ops_vue_js/package-lock.json b/frontent/ops_vue_js/package-lock.json index 96dbc25..d952b2e 100644 --- a/frontent/ops_vue_js/package-lock.json +++ b/frontent/ops_vue_js/package-lock.json @@ -91,7 +91,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -1090,7 +1089,6 @@ "resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.19.tgz", "integrity": "sha512-z0aVlO5e4Wah6p6mouM0UEqtRf1MZZPt4mwzEyU6kusaNL+dlWQgAasF2cK23hwT4cmxkEmr4inULXgpyeExdQ==", "license": "MIT", - "peer": true, "dependencies": { "preact": "~10.12.1" } @@ -1574,7 +1572,6 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -2308,7 +2305,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -2716,8 +2712,7 @@ "version": "4.32.11", "resolved": "https://registry.npmjs.org/filepond/-/filepond-4.32.11.tgz", "integrity": "sha512-+uHkc/XNksMMy2S+x5MGxTuA97NqzBBwmoixn3tqGELa4BgqJ+PBiWL3YeRamqAoYguT7t/au3s7ams2jjMshA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/filepond-plugin-file-validate-type": { "version": "1.2.9", @@ -3542,7 +3537,6 @@ "integrity": "sha512-+VUy01yfDqNmIVMd/LLKl2TTtY0ovZN0rTonh+FhKr65mFwIYgU9WzgIZKS7U9/SPCQvWTsTGx9jyt+qRm/XFw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@bufbuild/protobuf": "^2.5.0", "buffer-builder": "^0.2.0", @@ -4106,7 +4100,6 @@ "integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -4285,7 +4278,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.24.tgz", "integrity": "sha512-uTHDOpVQTMjcGgrqFPSb8iO2m1DUvo+WbGqoXQz8Y1CeBYQ0FXf2z1gLRaBtHjlRz7zZUBHxjVB5VTLzYkvftg==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.24", "@vue/compiler-sfc": "3.5.24", diff --git a/frontent/ops_vue_js/src/i18n/en.json b/frontent/ops_vue_js/src/i18n/en.json index 2ffddc3..87d7430 100644 --- a/frontent/ops_vue_js/src/i18n/en.json +++ b/frontent/ops_vue_js/src/i18n/en.json @@ -90,7 +90,8 @@ "input_tracking_number": "Enter tracking number", "order_status": "Order Status", "modify_order_status": "Modify Order Status", - "submit": "Submit" + "submit": "Submit", + "part_name":"Parts Name" }, "schedule": { "my_schedule": "My Schedule", diff --git a/frontent/ops_vue_js/src/i18n/zh-CN.json b/frontent/ops_vue_js/src/i18n/zh-CN.json index e4c499f..822f048 100644 --- a/frontent/ops_vue_js/src/i18n/zh-CN.json +++ b/frontent/ops_vue_js/src/i18n/zh-CN.json @@ -90,7 +90,8 @@ "input_tracking_number": "输入快递单号", "order_status": "订单状态", "modify_order_status": "修改订单状态", - "submit": "提交" + "submit": "提交", + "part_name":"物件名称" }, "schedule": { "my_schedule": "我的日程", diff --git a/frontent/ops_vue_js/src/views/purchase/addorder.vue b/frontent/ops_vue_js/src/views/purchase/addorder.vue index 89ea9f9..b7dba01 100644 --- a/frontent/ops_vue_js/src/views/purchase/addorder.vue +++ b/frontent/ops_vue_js/src/views/purchase/addorder.vue @@ -16,35 +16,12 @@ const router = useRouter(); import TomSelect from "tom-select"; import "tom-select/dist/css/tom-select.css"; - -const textarea_maxlen=256 -const textarea_len=ref(0) -const textarea_val=ref() +const textarea_maxlen = 256; +const textarea_len = ref(0); +const textarea_val = ref(); const { t, locale } = useI18n(); -function submit_order(){ - -} - - -function textarea_change(a){ - //console.log(textarea_val.value.length) - - textarea_len.value=textarea_val.value.length - - // if(a.inputType=="insertText"){ - // textarea_len.value+=1; - // } - // if(a.inputType=="deleteContentBackward"){ - // textarea_len.value-=1; - // } -} - -function functionupdataTitle() { - document.title = "Operations." + t("purchase.add_part"); -} - //货币类型 const currency_type = reactive({ 1: "RMB", @@ -109,13 +86,33 @@ function add_cost() { //console.log(t); } +function submit_order() { + console.log("up"); +} + +function textarea_change(a) { + //console.log(textarea_val.value.length) + + textarea_len.value = textarea_val.value.length; + + // if(a.inputType=="insertText"){ + // textarea_len.value+=1; + // } + // if(a.inputType=="deleteContentBackward"){ + // textarea_len.value-=1; + // } +} + +function functionupdataTitle() { + document.title = "Operations." + t("purchase.add_part"); +} + onMounted(() => { functionupdataTitle(); //sele_init(); if (!userStore.isLoggedIn) { router.push("/login"); } - }); // 监听语言变化,更新标题 watch(locale, () => { @@ -123,6 +120,20 @@ watch(locale, () => { update_cost_type(); update_order_status(); }); + +// 监听 cost 变化,自动限制小数位 +watch( + () => cost_sheet.cost, + (newVal) => { + if (newVal !== null && newVal !== undefined) { + // 四舍五入到2位小数 + const fixed = parseFloat(newVal).toFixed(2); + if (parseFloat(fixed) !== newVal) { + cost_sheet.cost = parseFloat(fixed); + } + } + } +);