From 4403544f23791bb1dcde0d41c25ae19f40bc8f4d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 13 十一月 2025 14:17:00 +0800
Subject: [PATCH] 1.首页-展示一下当前登录账号的排班时间
---
src/views/basicData/product/index.vue | 65 +++++++++++++++++++++++++++-----
1 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index d71d7cb..db5f096 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
@@ -97,10 +97,9 @@
@selection-change="handleSelectionChange"
:tableLoading="tableLoading"
@pagination="pagination"
- :total="total"
></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"
@@ -115,6 +114,7 @@
v-model="form.productName"
placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
clearable
+ @keydown.enter.prevent
/>
</el-form-item>
</el-col>
@@ -132,6 +132,7 @@
title="瑙勬牸鍨嬪彿"
width="400px"
@close="closeModelDia"
+ @keydown.enter.prevent
>
<el-form
:model="modelForm"
@@ -145,8 +146,9 @@
<el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
<el-input
v-model="modelForm.model"
- placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�(g*琚嬫暟)"
clearable
+ @keydown.enter.prevent
/>
</el-form-item>
</el-col>
@@ -158,7 +160,26 @@
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>
@@ -210,6 +231,10 @@
prop: "unit",
},
{
+ label: "缁戝畾鏈哄櫒",
+ prop: "speculativeTradingName",
+ },
+ {
dataType: "action",
label: "鎿嶄綔",
align: "center",
@@ -227,11 +252,11 @@
const tableData = ref([]);
const tableLoading = ref(false);
const isShowButton = ref(false);
-const total = ref(0);
const selectedRows = ref([]);
const page = reactive({
current: 1,
size: 10,
+ total: 0,
});
const data = reactive({
form: {
@@ -243,10 +268,19 @@
modelForm: {
model: "",
unit: "",
+ speculativeTradingName: [],
},
modelRules: {
- model: [{ 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: true, message: "璇烽�夋嫨缁戝畾鏈哄櫒", trigger: "change" }],
},
});
const { form, rules, modelForm, modelRules } = toRefs(data);
@@ -283,10 +317,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(',');
+ }
}
};
// 鎻愪氦浜у搧鍚嶇О淇敼
@@ -316,6 +355,7 @@
proxy.$refs.formRef.resetFields();
productDia.value = false;
};
+
// 鍒犻櫎浜у搧
const remove = (node, data) => {
let ids = [];
@@ -354,8 +394,13 @@
const submitModelForm = () => {
proxy.$refs.modelFormRef.validate((valid) => {
if (valid) {
- modelForm.value.productId = currentId.value;
- addOrEditProductModel(modelForm.value).then((res) => {
+ // 灏嗛�変腑鐨勬満鍣ㄦ暟缁勮浆鎹负閫楀彿鍒嗛殧鐨勫瓧绗︿覆
+ const submitData = {
+ ...modelForm.value,
+ productId: currentId.value,
+ speculativeTradingName: modelForm.value.speculativeTradingName.join(',')
+ };
+ addOrEditProductModel(submitData).then((res) => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeModelDia();
getModelList();
@@ -388,7 +433,7 @@
}).then((res) => {
console.log("res", res);
tableData.value = res.records;
- total.value = res.total;
+ page.total = res.total;
tableLoading.value = false;
});
};
--
Gitblit v1.9.3