From b95bdc2199e991c4643814663a005c5e0e7d5048 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 18 二月 2025 12:43:59 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue |   54 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue
index 30483a9..6951b52 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue
@@ -140,6 +140,7 @@
       basic.value.input=basic.value.input+"mm"
     }
   }
+  basic.value.input=basic.value.input.trim()
   request.post(`/basicData/addBasicData`, basic.value).then(res => {
     if (res.data) {
       ElMessage.success(t('basicData.msg.saveSuccess'))
@@ -156,7 +157,7 @@
   let submitArr  = props.rowIndex
   submitArr.basicType = basic.value.basicType[0]
   submitArr.basicCategory = basic.value.basicType[1]
-  submitArr.basicName = basic.value.input
+  submitArr.basicName = basic.value.input.trim()
   submitArr.nickname = basic.value.nickname
   request.post(`/basicData/updateBasicData`, submitArr).then(res => {
     if (res.data) {
@@ -172,20 +173,42 @@
   ).map((item) =>item.children.filter((item) =>item.value === value[1]))
 }
 
+const changeFile = (file) => {
+  const isJPG = file.raw.type === 'image/jpeg' || file.raw.type === 'image/png' ;
+  const isLt2M = file.size / 1024 / 1024 < 5;
+
+  if (!isJPG) {
+    ElMessage.warning(t('orderBasicData.msg2'))
+    return
+  }
+  if (!isLt2M) {
+    ElMessage.warning(t('orderBasicData.msg1'))
+    return
+  }
+
+  return new Promise((resolve, reject) => {
+    let reader = new FileReader();
+    reader.readAsDataURL(file.raw);
+    reader.onload = (e) => {
+      resolve(e.target.result);
+      basic.value.nickname=e.target.result;
+    };
+  });
+}
+
 
 </script>
 
 <template>
   <div>
     <el-row>
-      <el-col :span="4">{{ $t('orderBasicData.basicType') }}:</el-col>
+      <el-col :span="4">{{ $t('orderBasicData.page.searchOrderBasicData') }}:</el-col>
       <el-col :span="12">
         <el-cascader
             v-model="basic.basicType"
             @change="handleChange"
             :options="options"
-            clearable
-            placeholder=""
+            :placeholder="$t('processCard.pleaseSelect')"
             :disabled="props.rowIndex"
         />
       </el-col>
@@ -199,7 +222,28 @@
     <el-row>
       <el-col :span="4">{{ $t('orderBasicData.alias') }}:</el-col>
       <el-col :span="12">
-        <el-input v-model="basic.nickname"/>
+        <el-input v-if="basic.basicType.length>0 && basic.basicType[1]!=='process'" v-model="basic.nickname"/>
+        <el-select v-model="basic.nickname" v-else>
+          <el-option  :label="$t('orderBasicData.commonProcess')" value="" />
+          <el-option  :label="$t('orderBasicData.laminatingProcess')" value="laminating" />
+        </el-select>
+      </el-col>
+    </el-row>
+    <el-row v-if="basic.basicType.length!==0 && basic.basicType[1]==='icon'" >
+      <el-col :span="4"></el-col>
+      <el-col :span="12">
+        <el-upload
+            v-model="basic.nickname"
+            :limit="1"
+            :on-change="changeFile"
+            class="upload-demo"
+            ref="upload"
+            action="https://jsonplaceholder.typicode.com/posts/"
+            :file-list="fileList"
+            :auto-upload="false">
+          <el-button slot="trigger" size="small" type="primary" >{{ $t('orderBasicData.selectFile') }}</el-button>
+          <div slot="tip" class="el-upload__tip">{{ $t('orderBasicData.msg3') }}</div>
+        </el-upload>
       </el-col>
     </el-row>
     <el-row>

--
Gitblit v1.8.0