From c8b65690b946b28b179796fbe2f020e732043c58 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期四, 08 一月 2026 18:10:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津军泰伟业' into dev_天津军泰伟业
---
src/views/basicData/product/index.vue | 86 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 78 insertions(+), 8 deletions(-)
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index b17be1f..f9a61cd 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -55,7 +55,7 @@
>
缂栬緫
</el-button>
- <el-button type="primary" link @click="openProDia('add', data)">
+ <el-button type="primary" link @click="openProDia('add', data)" :disabled="node.level >= 3">
娣诲姞浜у搧
</el-button>
<el-button
@@ -99,7 +99,7 @@
@pagination="pagination"
></PIMTable>
</div>
- <el-dialog v-model="productDia" title="浜у搧" width="400px">
+ <el-dialog v-model="productDia" title="浜у搧" width="400px" @keydown.enter.prevent>
<el-form
:model="form"
label-width="140px"
@@ -114,6 +114,7 @@
v-model="form.productName"
placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
clearable
+ @keydown.enter.prevent
/>
</el-form-item>
</el-col>
@@ -131,6 +132,7 @@
title="瑙勬牸鍨嬪彿"
width="400px"
@close="closeModelDia"
+ @keydown.enter.prevent
>
<el-form
:model="modelForm"
@@ -144,8 +146,21 @@
<el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
<el-input
v-model="modelForm.model"
- placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�(g*琚嬫暟)"
clearable
+ @keydown.enter.prevent
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="鍏朵粬瑙勬牸鍨嬪彿锛�" prop="otherModel">
+ <el-input
+ v-model="modelForm.otherModel"
+ placeholder="璇疯緭鍏ュ叾浠栬鏍煎瀷鍙�"
+ clearable
+ @keydown.enter.prevent
/>
</el-form-item>
</el-col>
@@ -157,10 +172,29 @@
v-model="modelForm.unit"
placeholder="璇疯緭鍏ュ崟浣�"
clearable
+ @keydown.enter.prevent
/>
</el-form-item>
</el-col>
</el-row>
+<!-- <el-row>-->
+<!-- <el-col :span="24">-->
+<!-- <el-form-item label="缁戝畾鏈哄櫒锛�" prop="speculativeTradingName">-->
+<!-- <el-select-->
+<!-- v-model="modelForm.speculativeTradingName"-->
+<!-- placeholder="璇烽�夋嫨缁戝畾鏈哄櫒"-->
+<!-- multiple-->
+<!-- clearable-->
+<!-- style="width: 100%"-->
+<!-- >-->
+<!-- <el-option label="鐐掓満1" value="鐐掓満1" />-->
+<!-- <el-option label="鐐掓満2" value="鐐掓満2" />-->
+<!-- <el-option label="鐐掓満3" value="鐐掓満3" />-->
+<!-- <el-option label="鐐掓満4" value="鐐掓満4" />-->
+<!-- </el-select>-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
+<!-- </el-row>-->
</el-form>
<template #footer>
<div class="dialog-footer">
@@ -208,6 +242,10 @@
label: "鍗曚綅",
prop: "unit",
},
+ // {
+ // label: "缁戝畾鏈哄櫒",
+ // prop: "speculativeTradingName",
+ // },
{
dataType: "action",
label: "鎿嶄綔",
@@ -240,12 +278,22 @@
productName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
},
modelForm: {
+ otherModel:'',
model: "",
unit: "",
+ speculativeTradingName: [],
},
modelRules: {
- model: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ model: [
+ // { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ {
+ pattern: /^[0-9*]*$/,
+ message: "鍙兘杈撳叆鏁板瓧鍜�*鍙�",
+ trigger: "blur"
+ }
+ ],
+ // unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ // speculativeTradingName: [{ required: false, message: "璇烽�夋嫨缁戝畾鏈哄櫒", trigger: "change" }],
},
});
const { form, rules, modelForm, modelRules } = toRefs(data);
@@ -282,10 +330,15 @@
modelOperationType.value = type;
modelDia.value = true;
modelForm.value.model = "";
- modelForm.value.model = "";
+ modelForm.value.unit = "";
+ modelForm.value.speculativeTradingName = [];
modelForm.value.id = "";
if (type === "edit") {
modelForm.value = { ...data };
+ // 濡傛灉鍚庣杩斿洖鐨勬槸瀛楃涓诧紝闇�瑕佽浆鎹负鏁扮粍
+ if (data.speculativeTradingName && typeof data.speculativeTradingName === 'string') {
+ modelForm.value.speculativeTradingName = data.speculativeTradingName.split(',');
+ }
}
};
// 鎻愪氦浜у搧鍚嶇О淇敼
@@ -315,6 +368,7 @@
proxy.$refs.formRef.resetFields();
productDia.value = false;
};
+
// 鍒犻櫎浜у搧
const remove = (node, data) => {
let ids = [];
@@ -353,8 +407,24 @@
const submitModelForm = () => {
proxy.$refs.modelFormRef.validate((valid) => {
if (valid) {
- modelForm.value.productId = currentId.value;
- addOrEditProductModel(modelForm.value).then((res) => {
+ let _modelForm = { ...modelForm.value };
+
+ if(_modelForm.otherModel){
+ _modelForm.model = _modelForm.otherModel;
+ }
+ delete _modelForm.otherModel;
+ // 纭繚 speculativeTradingName 鏄暟缁勭被鍨嬶紝鐒跺悗杞崲涓洪�楀彿鍒嗛殧鐨勫瓧绗︿覆
+ let speculativeTradingNameValue = modelForm.value.speculativeTradingName;
+ if (!Array.isArray(speculativeTradingNameValue)) {
+ // 濡傛灉涓嶆槸鏁扮粍锛岃浆鎹负鏁扮粍
+ speculativeTradingNameValue = speculativeTradingNameValue.split(',').filter(item => item);
+ }
+ const submitData = {
+ ..._modelForm,
+ productId: currentId.value,
+ speculativeTradingName: speculativeTradingNameValue.join(',')
+ };
+ addOrEditProductModel(submitData).then((res) => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeModelDia();
getModelList();
--
Gitblit v1.9.3