cz 1 سال پیش
والد
کامیت
0f72839d9a

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 三梵
+VITE_APP_TITLE = 三梵MES制造执行系统
 
 # 开发环境配置
 VITE_APP_ENV = 'development'

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 三梵
+VITE_APP_TITLE = 三梵MES制造执行系统
 
 # 生产环境配置
 VITE_APP_ENV = 'production'

+ 1 - 1
.env.staging

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 三梵
+VITE_APP_TITLE = 三梵MES制造执行系统
 
 # 生产环境配置
 VITE_APP_ENV = 'staging'

+ 1 - 1
index.html

@@ -7,7 +7,7 @@
   <meta name="renderer" content="webkit">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
   <link rel="icon" href="/favicon.ico">
-  <title>三梵</title>
+  <title>三梵MES制造执行系统</title>
   <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
   <style>
     html,

+ 2 - 2
package.json

@@ -1,8 +1,8 @@
 {
   "name": "ruoyi",
   "version": "3.8.5",
-  "description": "三梵",
-  "author": "三梵",
+  "description": "三梵MES制造执行系统",
+  "author": "三梵MES制造执行系统",
   "license": "MIT",
   "scripts": {
     "dev": "vite",

BIN
public/static/printer.zip


+ 1 - 1
src/assets/icons/iconfont/iconfont.json

@@ -1,6 +1,6 @@
 {
   "id": "3933484",
-  "name": "三梵",
+  "name": "三梵MES制造执行系统",
   "font_family": "iconfont",
   "css_prefix_text": "icon-",
   "description": "",

+ 23 - 0
src/assets/styles/element-ui.scss

@@ -129,6 +129,10 @@
   margin-bottom: 0px !important;
 }
 
+.wid100.el-form-item {
+  width: 100% !important;
+}
+
 .el-form-item__label {
   // height: 22px !important;
 }
@@ -171,4 +175,23 @@
   // border: none !important;
   // box-shadow: none;e7e8e9
   box-shadow: 0 0 0 1px #f1f1f1 inset !important;
+}
+
+.el-upload--picture-card {
+  width: 80px !important;
+  height: 80px !important;
+}
+
+.el-upload-list--picture-card .el-upload-list__item {
+  width: 80px !important;
+  height: 80px !important;
+}
+
+.el-upload-list--text .el-upload-list__item {
+  min-width: 200px !important;
+  width: auto;
+}
+
+.el-input-number .el-input__inner {
+  text-align: left !important;
 }

+ 27 - 23
src/components/byForm/index.vue

@@ -25,9 +25,10 @@
                     :max="i.max" :min="i.min" :maxlength="i.maxlength" :readonly="i.readonly ? i.readonly : false">
             <template #prepend>
               <el-select v-model="formData[i.selectProp]" :placeholder="i.selectPlaceholder || $t('common.pleaseSelect')"
-                         @change="(e) => commonsEmit(e, i)" :disabled="i.disabled ? i.disabled : false" :readonly="i.readonly ? i.readonly : false"
-                         style="width: 80px">
-                <el-option :label="j.title || j.name || j.label" :value="j.id || j.value" v-for="j in i.data" :key="j.id">
+                         @change="(e) => commonsEmit(e, i)" :disabled="i.disabledSelect ? i.disabledSelect : false"
+                         :readonly="i.readonly ? i.readonly : false" style="width: 80px">
+                <el-option :label="j.dictValue || j.name || j.label" :value="j.dictKey||j.id || j.value" v-for="j in i.data"
+                           :key="j.id || j.dictKey || j.value">
                 </el-option>
               </el-select>
             </template>
@@ -35,8 +36,9 @@
           <el-select v-model="formData[i.prop]" :multiple="i.multiple || false" v-else-if="i.type == 'select'"
                      :placeholder="i.placeholder || $t('common.pleaseSelect')" @change="(e) => commonsEmit(e, i)"
                      :disabled="i.disabled ? i.disabled : false" :clearable="i.clearable ? i.clearable : false"
-                     :filterable="i.filterable ? true : false" :style="i.style" :readonly="i.readonly ? i.readonly : false">
-            <el-option :label="j.title || j.name || j.label" :value="j.id || j.value" v-for="j in i.data" :key="j.id">
+                     :filterable="i.filterable ? true : false" :style="i.style?i.style:{width:'100%'}" :readonly="i.readonly ? i.readonly : false">
+            <el-option :label="j.dictValue || j.name || j.label" :value="j.dictKey||j.id || j.value" v-for="j in i.data"
+                       :key="j.id || j.dictKey || j.value">
             </el-option>
           </el-select>
           <el-tree-select v-model="formData[i.prop]" v-else-if="i.type == 'treeSelect'" :data="i.data" :readonly="i.readonly ? i.readonly : false"
@@ -45,7 +47,7 @@
               label: i.propsTreeLabel || 'label',
               children: i.propsTreeChildren || 'children',
             }" value-key="id" :placeholder="i.placeholder || $t('common.pleaseSelect')" :disabled="i.disabled ? i.disabled : false" check-strictly
-                          :style="i.style" />
+                          :style="i.style?i.style:{width:'100%'}" />
           <el-date-picker v-model="formData[i.prop]" :readonly="i.readonly ? i.readonly : false" v-else-if="i.type == 'date'" :type="i.itemType"
                           :placeholder="i.placeholder || $t('common.pleaseSelectTime')" @change="(e) => commonsEmit(e, i)"
                           :disabled="i.disabled ? i.disabled : false" :format="i.format ? i.format : dateFormatInit(i.itemType)"
@@ -68,7 +70,7 @@
                            :placeholder="i.placeholder || $t('common.pleaseEnter')" @change="(e) => commonsEmit(e, i)"
                            :disabled="i.disabled ? i.disabled : false" :min="i.min ? i.min : 0" :max="i.max ? i.max : 9999999999"
                            :step="i.step ? i.step : 1" :precision="i.precision !== '' ? i.precision : 2"
-                           :controls="i.controls === false ? false : true" :style="i.style" onmousewheel="return false;">
+                           :controls="i.controls === false ? false : true" :style="i.style?i.style:{width:'100%'}" onmousewheel="return false;">
           </el-input-number>
           <el-tree v-else-if="i.type == 'tree'" :data="i.data" :props="i.props" :readonly="i.readonly ? i.readonly : false"
                    :show-checkbox="i.showCheckbox || true">
@@ -98,12 +100,14 @@
             {{ i.slotName }}插槽占位符
           </slot>
           <div class="upload" v-else-if="i.type == 'upload'">
-            <el-upload v-model="formData[i.prop]" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
-                       list-type="picture-card" :on-remove="handleRemove" :on-success="handleSuccess" :before-upload="handleBeforeUpload">
-              <!-- <el-icon class="el-icon--upload"><upload-filled /></el-icon> -->
-              <el-icon>
+            <el-upload :file-list="formData[i.prop]" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
+                       :list-type="i.listType ? i.listType : 'text'" :accept="i.accept?i.accept :'.gif, .jpeg, .jpg, .png'"
+                       :on-success="handleSuccess" :before-upload="(file)=>handleBeforeUpload(file,i.prop)" :on-preview="onPreviewFile">
+
+              <el-icon v-if="i.listType=='picture-card'">
                 <Plus />
               </el-icon>
+              <el-button type="primary" plain v-else>点击上传</el-button>
             </el-upload>
           </div>
           <div v-else-if="i.type == 'table'" class="by-form-table" style="width: 100%">
@@ -181,23 +185,23 @@ const handleSuccess = (res, file, files) => {
   emit("update:modelValue", formData.value);
 };
 
-const handleRemove = (file) => {
-  const index = fileListCopy.value.findIndex(
-    (x) => x.uid === file.uid || x.id === file.id
-  );
-  fileListCopy.value.splice(index, 1);
-};
-
-const handleBeforeUpload = async (file) => {
+const handleBeforeUpload = async (file, prop) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
   uploadData.value = res.uploadBody;
-  fileListCopy.value.push({
+  // file.id = res.id;
+  // file.fileName = res.fileName;
+  // file.fileUrl = res.fileUrl;
+  formData.value[prop].push({
     id: res.id,
     fileName: res.fileName,
-    path: res.fileUrl,
-    url: res.fileUrl,
-    uid: file.uid,
+    // path: res.fileUrl,
+    // url: res.fileUrl,
+    fileUrl: res.fileUrl,
   });
+  return true;
+};
+const onPreviewFile = (file) => {
+  if (file && file.fileUrl) window.open(file.fileUrl, "_blank");
 };
 
 const isInit = ref(false);

+ 2 - 2
src/components/byTable/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="header-actions" v-if="getActionList.length != 0 &&getActionList.length>1">
+  <div class="header-actions" v-if="getActionList.length != 0 &&getActionList.length>2">
     <div class="overflow-box">
       <el-button v-for="(item, index) in getActionList" :key="index" :type="item.type || 'primary'" :plain="item.plain || false"
                  v-bind="getHeaderActions(item)" @click="item.action" :disabled="item.disabled || false">
@@ -49,7 +49,7 @@
     </header>
     <div class="by-search" v-if="!hideSearch">
       <div style="display: flex">
-        <div v-if="getActionList.length != 0 &&getActionList.length==1" style="margin-right:10px">
+        <div v-if="getActionList.length != 0 &&getActionList.length <=2" style="margin-right:10px">
           <el-button v-for="(item, index) in getActionList" :key="index" :type="item.type || 'primary'" :plain="item.plain || false"
                      v-bind="getHeaderActions(item)" @click="item.action" :disabled="item.disabled || false">
             {{ item.text }}

+ 40 - 7
src/components/headerBar/header-bar.vue

@@ -2,7 +2,7 @@
   <div id="main" class="header-bar" @click="isChildMenu = false">
     <header>
       <ul class="nav">
-        <!-- <div class="logo">三梵</div> -->
+        <!-- <div class="logo">三梵MES制造执行系统</div> -->
         <div class="logo" style="display: flex; align-items: center; justify-content: center">
           <img v-if="!logoUrl" :src="'/img/logo2.png'" />
           <el-image v-else style="width: 120px; height: 30px" :src="logoUrl" fit="scale-down" />
@@ -149,19 +149,35 @@
         </div>
       </ul>
       <div class="fr">
+        <div style="float:right;height: 50px;line-height: 50px;padding-right:20px;color:#fff;font-size:14px;cursor: pointer;" @click="plugDowload">
+          插件下载
+        </div>
         <div style="float:right;height: 50px;padding-right:20px">
-          <el-badge :value="jobData.sumCount" :max="99" style="cursor: pointer;margin-top:15px;" @click="handleOpenDrawer">
+          <el-badge :value="jobData.sumCount" :max="99" style="cursor: pointer;margin-top:15px;" v-if="jobData.sumCount" @click="handleOpenDrawer">
             <el-icon :size="20" color="#fff">
               <Opportunity />
             </el-icon>
           </el-badge>
+          <div style="margin:15px 0 15px 0" v-else>
+            <el-icon :size="20" color="#fff">
+              <Opportunity />
+            </el-icon>
+          </div>
         </div>
         <!-- :value="12" -->
-        <el-badge :value="badgeNum" style="cursor: pointer" class="badge" @click="noticeTableModal = true">
-          <el-icon :size="20" color="#fff">
-            <BellFilled />
-          </el-icon>
-        </el-badge>
+        <div>
+          <el-badge :value="badgeNum" style="cursor: pointer" class="badge" v-if="badgeNum" @click="noticeTableModal = true">
+            <el-icon :size="20" color="#fff">
+              <BellFilled />
+            </el-icon>
+          </el-badge>
+          <div style="margin:15px 24px 15px 0" v-else @click="noticeTableModal = true">
+            <el-icon :size="20" color="#fff">
+              <BellFilled />
+            </el-icon>
+          </div>
+        </div>
+
         <notice v-model="noticeTableModal" @changeNum="(e) => (badgeNum = e)" @openNotice="noticeTableModal = true"></notice>
         <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
           <div class="dropdown-box" style="color:#fff">
@@ -621,6 +637,23 @@ const openDetails = (row) => {
     });
   }
 };
+
+const plugDowload = () => {
+  proxy.msgTip("请稍后", 2);
+  // 静态资源下载
+  fetch("/static/printer.zip")
+    .then((res) => res.blob())
+    .then((res) => {
+      const url = window.URL.createObjectURL(res);
+      let filename = "printer.zip";
+      const link = document.createElement("a");
+      link.style.display = "none";
+      link.href = url;
+      link.setAttribute("download", filename);
+      document.body.appendChild(link);
+      link.click();
+    });
+};
 </script>
 
 <style lang="scss">

+ 78 - 81
src/components/process/EHSD/Contract.vue

@@ -13,82 +13,69 @@
       </template>
       <template #seller>
         <div style="width: 100%">
-          <el-form-item prop="sellCorporationId">
+          <el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
             <el-select v-model="formData.data.sellCorporationId" style="width: 100%" filterable>
               <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </el-form-item>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="8">
-              <el-form-item label="地址" prop="sellCountryName">
-                <el-input v-model="formData.data.sellCountryName" placeholder="请输入国家" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label=" " prop="sellProvinceName">
-                <el-input v-model="formData.data.sellProvinceName" placeholder="请输入省/州" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label=" " prop="sellCityName">
-                <el-input v-model="formData.data.sellCityName" placeholder="请输入城市" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="24">
-              <el-form-item prop="sellAddress">
-                <el-input v-model="formData.data.sellAddress" type="textarea">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="8">
-              <el-form-item label="联系人" prop="sellContactName">
-                <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="16">
-              <el-form-item label=" " prop="sellContactNumber">
-                <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
-              </el-form-item>
-            </el-col>
-          </el-row>
+          <el-form-item label="地址" class="wid100">
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="sellCountryName" label-width="0px" class="margin-b-0">
+                  <el-input v-model="formData.data.sellCountryName" placeholder="请输入国家" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="sellProvinceName" label-width="0px" class="margin-b-0">
+                  <el-input v-model="formData.data.sellProvinceName" placeholder="请输入省/州" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="sellCityName" label-width="0px" class="margin-b-0">
+                  <el-input v-model="formData.data.sellCityName" placeholder="请输入城市" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+
+          <el-form-item label="详细地址" prop="sellAddress" class="wid100">
+            <el-input v-model="formData.data.sellAddress" type="textarea">
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="联系人" class="wid100" required>
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
         </div>
       </template>
       <template #buyer>
         <div style="width: 100%">
-          <div style="width: 100%">
-            <!-- <el-form-item prop="buyCorporationId">
-              <el-select
-                v-model="formData.data.buyCorporationId"
-                style="width: 100%"
-                @change="changeCustomer"
-              >
-                <el-option
-                  v-for="item in customerList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </el-form-item> -->
-            <el-form-item prop="buyCorporationId">
-              <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
-                         :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer"
-                         v-if="
+          <el-form-item label="买方信息" prop="buyCorporationId" class="wid100">
+            <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
+                       :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer" v-if="
                   [30].includes(route.query.processType) ||
                   !route.query.processType
                 ">
-                <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
-              </el-select>
-              <el-select v-model="formData.data.buyCorporationName" disabled v-else style="width: 100%">
-              </el-select>
-            </el-form-item>
-            <el-row style="margin-top: 20px; width: 100%">
+              <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+            <el-select v-model="formData.data.buyCorporationName" disabled v-else style="width: 100%">
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地址" class="wid100" required>
+            <el-row style="width: 100%">
               <el-col :span="6">
-                <el-form-item label="地址" prop="countryId">
+                <el-form-item label="" prop="countryId" class="margin-b-0">
                   <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
                     <el-option v-for="item in countryData" :label="item.name" :value="item.id">
                     </el-option>
@@ -96,47 +83,46 @@
                 </el-form-item>
               </el-col>
               <el-col :span="6">
-                <el-form-item label=" " prop="provinceName">
+                <el-form-item label="" prop="provinceName" class="margin-b-0">
                   <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
                               v-model="formData.data" :data="provinceData">
                   </selectCity>
                 </el-form-item>
               </el-col>
               <el-col :span="6">
-                <el-form-item label=" " prop="cityName">
+                <el-form-item label="" prop="cityName" class="margin-b-0">
                   <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
                   </selectCity>
                 </el-form-item>
               </el-col>
               <el-col :span="6">
-                <el-form-item label=" " prop="buyPostalCode">
+                <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
                   <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
                 </el-form-item>
               </el-col>
             </el-row>
-            <el-row style="margin-top: 20px; width: 100%">
-              <el-col :span="24">
-                <el-form-item prop="buyAddress">
-                  <el-input v-model="formData.data.buyAddress" type="textarea">
-                  </el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row style="margin-top: 20px; width: 100%">
+          </el-form-item>
+
+          <el-form-item label="详细地址" prop="buyAddress" class="wid100">
+            <el-input v-model="formData.data.buyAddress" type="textarea">
+            </el-input>
+          </el-form-item>
+          <el-form-item label="联系人" class="wid100" required>
+            <el-row style="width: 100%">
               <el-col :span="8">
-                <el-form-item label="联系人" prop="buyContactName">
+                <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0">
                   <el-autocomplete v-model="formData.data.buyContactName" :fetch-suggestions="querySearchPerson" clearable class="inline-input w-50"
                                    placeholder="请输入联系人" @select="handlePerson">
                   </el-autocomplete>
                 </el-form-item>
               </el-col>
               <el-col :span="16">
-                <el-form-item label=" " prop="buyContactNumber">
+                <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
                   <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
                 </el-form-item>
               </el-col>
             </el-row>
-          </div>
+          </el-form-item>
         </div>
       </template>
       <template #payment>
@@ -697,13 +683,13 @@ const formConfig = computed(() => {
     {
       type: "slot",
       slotName: "seller",
-      label: "卖方信息",
+      label: "",
       itemWidth: 50,
     },
     {
       type: "slot",
       slotName: "buyer",
-      label: "买方信息",
+      label: "",
       itemWidth: 50,
     },
 
@@ -780,6 +766,7 @@ const rules = ref({
   // contractTemplateId: [
   //   { required: true, message: "请选择合同模板", trigger: "change" },
   // ],
+
   sellCorporationId: [
     { required: true, message: "请选择公司", trigger: "change" },
   ],
@@ -789,9 +776,19 @@ const rules = ref({
   countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
   sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
   buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  sellContactName: [
+    { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
+  ],
   buyContactName: [
     { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
   ],
+  sellCountryName: [
+    { required: true, message: "请输入地址", trigger: ["change", "blur"] },
+  ],
+  sellContactNumber: [
+    { required: true, message: "请输入联系电话", trigger: "blur" },
+  ],
+
   buyContactNumber: [
     { required: true, message: "请输入联系电话", trigger: "blur" },
   ],

+ 23 - 47
src/components/product/treeList.vue

@@ -4,13 +4,7 @@
       {{ title }}
     </div>
     <div class="search">
-      <el-input
-        v-model="search"
-        placeholder="请输入搜索内容"
-        clearable
-        @clear="search = ''"
-        @keyup.enter="searchChange"
-      ></el-input>
+      <el-input v-model="search" placeholder="请输入搜索内容" clearable @clear="search = ''" @keyup.enter="searchChange"></el-input>
       <!-- <el-button type="primary" @click="searchChange">搜索</el-button> -->
       <el-button type="primary" plain @click="add({ id: 0 })">
         <el-icon :size="20">
@@ -19,34 +13,19 @@
       </el-button>
     </div>
     <div class="box">
-      <el-tree
-        :data="data"
-        ref="tree"
-        node-key="id"
-        @node-click="treeChange"
-        default-expand-all
-        :expand-on-click-node="false"
-        :filter-node-method="filterNode"
-      >
+      <el-tree :data="data" ref="tree" node-key="id" @node-click="treeChange" default-expand-all :expand-on-click-node="false"
+               :filter-node-method="filterNode">
         <template #default="{ node, data }">
           <div class="custom-tree-node">
             <div style="flex: 1">{{ node.label }}</div>
             <div style="float: right; width: 71px; margin-left: 10px">
-              <el-icon :size="17" @click.stop="() => edit(node, data)">
+              <el-icon :size="17" @click.stop="() => edit(node, data)" v-if="getShowIcon(data)">
                 <Edit />
               </el-icon>
-              <el-icon
-                :size="17"
-                style="margin-left: 10px"
-                @click.stop="() => add(data)"
-              >
+              <el-icon :size="17" style="margin-left: 10px" @click.stop="() => add(data)">
                 <Plus />
               </el-icon>
-              <el-icon
-                :size="17"
-                style="margin-left: 10px"
-                @click.stop="() => del(data)"
-              >
+              <el-icon :size="17" style="margin-left: 10px" @click.stop="() => del(data)" v-if="getShowIcon(data)">
                 <Delete />
               </el-icon>
             </div>
@@ -55,28 +34,12 @@
       </el-tree>
     </div>
 
-    <el-dialog
-      :title="treeModalType == 'add' ? '添加分类' : '编辑分类'"
-      v-model="treeModal"
-      width="400"
-      v-loading="loading"
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="byform"
-      >
+    <el-dialog :title="treeModalType == 'add' ? '添加分类' : '编辑分类'" v-model="treeModal" width="400" v-loading="loading">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
       </byForm>
       <template #footer>
         <el-button @click="treeModal = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm('byform')"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">
           确 定
         </el-button>
       </template>
@@ -159,6 +122,7 @@ const formOption = reactive({
 });
 let rules = ref({
   name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
+  sort: [{ required: true, message: "请输入分类排序", trigger: "blur" }],
 });
 const formConfig = computed(() => {
   return [
@@ -166,7 +130,13 @@ const formConfig = computed(() => {
       type: "input",
       prop: "name",
       label: "分类名称",
-      required: true,
+    },
+    {
+      type: "number",
+      prop: "sort",
+      label: "分类排序",
+      precision: 0,
+      min: 0,
     },
   ];
 });
@@ -182,6 +152,7 @@ const add = (data) => {
 };
 
 const edit = (node, data) => {
+  console.log(node, data, "sssdd");
   treeModal.value = true;
   treeModalType.value = "edit";
   formData.data = {
@@ -248,6 +219,11 @@ const handleMouseOver = (data) => {
   console.log(data, "sss");
   // currentNode.id = toRaw(data).id;
 };
+
+const getShowIcon = (data) => {
+  let ids = [100, 200, 300];
+  return !ids.includes(data.id);
+};
 </script>
 
 <style lang="scss">

+ 2 - 2
src/lang/en.js

@@ -103,7 +103,7 @@ export const lang = {
 		deviceInformation: "设备信息",
 		switchLanguage: 'switch English',
 		logOut: '退出登录',
-		title: "三梵管理系统",
+		title: "三梵MES制造执行系统管理系统",
 		form: {
 			tenantId: "请输入租户ID",
 			username: "请输入账号",
@@ -113,7 +113,7 @@ export const lang = {
 		loginText: '登录',
 		demo: "demo",
 		agreement: {
-			text: "已阅读并同意:三梵",
+			text: "已阅读并同意:三梵MES制造执行系统",
 			clause: "服务条款",
 			agreement: "隐私协议",
 			and: "和"

+ 1 - 1
src/layout/components/Sidebar/Logo.vue

@@ -28,7 +28,7 @@ defineProps({
   },
 });
 
-const title = ref("三梵");
+const title = ref("三梵MES制造执行系统");
 const settingsStore = useSettingsStore();
 const sideTheme = computed(() => settingsStore.sideTheme);
 </script>

+ 173 - 286
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="user">
+  <div class="box">
     <div class="tree">
       <treeList title="产品分类" submitType="1" :data="treeListData" v-model="sourceList.pagination.productClassifyId" @change="treeChange"
                 @changeTreeList="getTreeList">
@@ -7,20 +7,13 @@
     </div>
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
-               :selectConfig="selectConfig" :table-events="{
-          //element talbe事件都能传
-          select: select,
-        }" :action-list="[
-          props.selectStatus
-            ? {}
-            : {
+               :selectConfig="selectConfig" :action-list="[
+               {
                 text: 'Excel导入',
                 action: () => openExcel(),
                 disabled: false,
               },
-          props.selectStatus
-            ? {}
-            : {
+      {
                 text: '添加',
                 action: () => openModal('add'),
                 disabled: false,
@@ -57,52 +50,54 @@
       </byTable>
     </div>
 
-    <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="80%" v-loading="submitLoading" destroy-on-close>
+    <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="80%" destroy-on-close>
       <div class="public_height_dialog">
-        <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+        <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
           <template #nameEnglish>
             <div style="width: 100%">
               <el-input v-model="formData.data.nameEnglish" placeholder="请输入" onkeyup="value=value.replace(/[^\x00-\xff]/g, '')"></el-input>
-              <!-- @input="(val) => handleKeyup(val)" -->
+            </div>
+          </template>
+          <template #productionFile>
+            <div style="width: 100%">
+              <!-- <a href="ftp://192.168.1.13/" target="_blank" style="color:#409eff">点击上传</a> -->
+              <span style="color:#409eff;cursor:pointer" @click="handleClickUpload">点击上传</span>
+            </div>
+          </template>
+          <template #productionFileOne>
+            <div style="width: 100%">
+              <span style="color:#409eff;cursor:pointer" @click="handleClickUpload">点击上传</span>
             </div>
           </template>
           <template #productLong>
             <div style="width: 100%">
-              <el-row :gutter="10">
+              <el-row>
                 <el-col :span="8">
-                  <el-form-item prop="productLong" label-width="0px" class="margin-b-0">
-                    <el-input v-model="formData.data.productLong" placeholder="请输入"></el-input>
+                  <el-form-item prop="productLong" label-width="0px" class="margin-b-0 wid100">
+                    <el-input-number v-model="formData.data.productLong" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                     :min="0" onmousewheel="return false;" />
                   </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                  <el-form-item prop="productWide" label-width="0px" class="margin-b-0">
-                    <el-input v-model="formData.data.productWide" placeholder="请输入"></el-input>
+                  <el-form-item prop="productWide" label-width="0px" class="margin-b-0 wid100">
+                    <el-input-number v-model="formData.data.productWide" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                     :min="0" onmousewheel="return false;" />
                   </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                  <el-form-item prop="productHigh" label-width="0px" class="margin-b-0">
-                    <el-input v-model="formData.data.productHigh" placeholder="请输入"></el-input>
+                  <el-form-item prop="productHigh" label-width="0px" class="margin-b-0 wid100">
+                    <el-input-number v-model="formData.data.productHigh" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                     :min="0" onmousewheel="return false;" />
                   </el-form-item>
                 </el-col>
               </el-row>
             </div>
           </template>
-          <template #productPic>
-            <div>
-              <el-upload v-model:fileList="fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
-                         list-type="picture-card" :on-remove="handleRemove" :before-upload="handleBeforeUpload" :on-preview="handlePreview"
-                         accept=".gif, .jpeg, .jpg, .png">
-                <el-icon>
-                  <Plus />
-                </el-icon>
-              </el-upload>
-            </div>
-          </template>
         </byForm>
       </div>
       <template #footer>
         <el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
-        <el-button type="primary" @click="submitForm('byform')" size="defualt" :loading="submitLoading" v-debounce>确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="defualt" v-debounce>确 定</el-button>
       </template>
     </el-dialog>
 
@@ -116,29 +111,28 @@
       </template>
     </el-dialog>
 
-    <el-dialog v-if="productContractDialog" v-model="productContractDialog" :title="'外销合同'" width="80%" append-to-body>
-      <ProductContract :currentProductId="currentProductId"></ProductContract>
-    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
-import { getToken } from "@/utils/auth";
-import ProductContract from "@/components/contractCom/productContract.vue";
-
-const headers = ref({ Authorization: "Bearer " + getToken() });
+const { proxy } = getCurrentInstance();
 const actionUrl = import.meta.env.VITE_APP_BASE_API;
 const loading = ref(false);
 const submitLoading = ref(false);
 const treeListData = ref([]);
-const innerMethon = ref([]);
-const outsideMethon = ref([]);
-const productUnit = ref([]);
-const accountCurrency = ref([]);
+const innerMethon = computed(
+  () => proxy.useUserStore().allDict["inner_packaging_method_ehsd"]
+);
+const outsideMethon = computed(
+  () => proxy.useUserStore().allDict["outside_packaging_method_ehsd"]
+);
+const productUnit = computed(() => proxy.useUserStore().allDict["unit"]);
+const currencyData = computed(
+  () => proxy.useUserStore().allDict["account_currency"]
+);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -151,11 +145,11 @@ const sourceList = ref({
     definition: "1",
   },
 });
-let dialogVisible = ref(false);
-let openExcelDialog = ref(false);
-let excelLoading = ref(false);
-let modalType = ref("add");
-let rules = ref({
+const dialogVisible = ref(false);
+const openExcelDialog = ref(false);
+const excelLoading = ref(false);
+const modalType = ref("add");
+const rules = ref({
   productClassifyId: [
     { required: true, message: "请选择产品分类", trigger: "change" },
   ],
@@ -179,7 +173,6 @@ let rules = ref({
     { required: true, message: "请选择外包装方式", trigger: "change" },
   ],
 });
-const { proxy } = getCurrentInstance();
 const props = defineProps({
   selectStatus: Boolean,
 });
@@ -203,7 +196,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "产品编码",
-        prop: "code",
+        prop: "customCode",
       },
     },
     {
@@ -223,16 +216,10 @@ const config = computed(() => {
       attrs: {
         label: "销售指导价",
         slot: "price",
-        width: 150,
-      },
-    },
-    {
-      attrs: {
-        label: "成本价",
-        slot: "costPrice",
-        width: 150,
+        width: 100,
       },
     },
+
     {
       attrs: {
         label: "操作",
@@ -275,29 +262,19 @@ const config = computed(() => {
                 },
                 el: "button",
                 click() {
-                  // 弹窗提示是否删除
-                  ElMessageBox.confirm(
-                    "此操作将永久删除该数据, 是否继续?",
-                    "提示",
-                    {
-                      confirmButtonText: "确定",
-                      cancelButtonText: "取消",
-                      type: "warning",
-                    }
-                  ).then(() => {
-                    // 删除
-                    proxy
-                      .post("/productInfo/delete", {
-                        id: row.id,
-                      })
-                      .then((res) => {
-                        ElMessage({
-                          message: "删除成功",
-                          type: "success",
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/productInfo/delete", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("删除成功", 1);
+                          getList();
                         });
-                        getList();
-                      });
-                  });
+                    })
+                    .catch((err) => {});
                 },
               },
         ];
@@ -309,7 +286,7 @@ const config = computed(() => {
 const uploadData = ref({});
 const fileList = ref([]);
 const fileListCopy = ref([]);
-let formData = reactive({
+const formData = reactive({
   data: {},
 });
 const formOption = reactive({
@@ -319,7 +296,7 @@ const formOption = reactive({
   itemWidth: 100,
   rules: [],
 });
-const byform = ref(null);
+const formDom = ref(null);
 const formConfig = computed(() => {
   return [
     {
@@ -331,11 +308,8 @@ const formConfig = computed(() => {
       prop: "productClassifyId",
       label: "产品分类",
       data: treeListData.value,
-      itemWidth: 50,
+      itemWidth: 100,
       disabled: false,
-      style: {
-        width: "100%",
-      },
     },
     {
       type: "input",
@@ -351,10 +325,30 @@ const formConfig = computed(() => {
       itemWidth: 50,
     },
     {
-      type: "slot",
-      slotName: "productPic",
+      type: "input",
+      prop: "customCode",
+      label: "产品编号",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "upload",
+      listType: "picture-card",
+      accept: ".gif, .jpeg, .jpg, .png",
       prop: "fileList",
-      label: "产品图片",
+      label: "产品缩略图",
+    },
+    {
+      type: "slot",
+      slotName: "productionFileOne",
+      label: "产品原图",
+      itemWidth: 100,
+    },
+    {
+      type: "slot",
+      slotName: "productionFile",
+      label: "生产文件",
+      itemWidth: 100,
     },
     {
       type: "title1",
@@ -364,24 +358,36 @@ const formConfig = computed(() => {
       type: "selectInput",
       prop: "price",
       selectProp: "currency",
-      label: "销售指导价",
+      label: "销售价",
       itemWidth: 50,
-      style: {
-        width: "100%",
-      },
-      data: accountCurrency.value,
+      disabledSelect: true,
+      data: currencyData.value,
     },
     {
-      type: "selectInput",
-      prop: "costPrice",
-      selectProp: "costCurrency",
-      label: "成本价",
+      type: "title1",
+      title: "工艺",
+    },
+    {
+      type: "select",
+      prop: "sss",
+      label: "工艺选择",
       itemWidth: 50,
-      style: {
-        width: "100%",
-      },
-      data: accountCurrency.value,
+      data: [],
+      filterable: true,
+      // placeholder: "",
+      disabled: false,
     },
+    // {
+    //   type: "selectInput",
+    //   prop: "costPrice",
+    //   selectProp: "costCurrency",
+    //   label: "成本价",
+    //   itemWidth: 50,
+    //   style: {
+    //     width: "100%",
+    //   },
+    //   data: currencyData.value,
+    // },
     {
       type: "title1",
       title: "属性信息",
@@ -399,59 +405,45 @@ const formConfig = computed(() => {
       prop: "productLong",
       label: "尺寸",
       itemWidth: 50,
-      // placeholder: "长(cm)",
       disabled: false,
     },
     // {
-    //   type: "input",
-    //   prop: "productWide",
-    //   label: "",
-    //   itemWidth: 33.33,
-    //   placeholder: "宽(cm)",
+    //   type: "select",
+    //   prop: "innerPackMethod",
+    //   label: "内包装方式",
+    //   required: true,
+    //   itemWidth: 50,
+    //   multiple: true,
+    //   data: innerMethon.value,
+    //   filterable: true,
+    //   placeholder: "内包装方式",
+    //   style: {
+    //     width: "100%",
+    //   },
     //   disabled: false,
     // },
     // {
-    //   type: "input",
-    //   prop: "productHigh",
-    //   label: "",
-    //   itemWidth: 33.33,
-    //   placeholder: "高(cm)",
+    //   type: "select",
+    //   prop: "outerPackMethod",
+    //   label: "外包装方式",
+    //   required: true,
+    //   itemWidth: 50,
+    //   multiple: true,
+    //   data: outsideMethon.value,
+    //   filterable: true,
+    //   placeholder: "外包装方式",
+    //   style: {
+    //     width: "100%",
+    //   },
     //   disabled: false,
     // },
     {
-      type: "select",
-      prop: "innerPackMethod",
-      label: "内包装方式",
-      required: true,
-      itemWidth: 50,
-      multiple: true,
-      data: innerMethon.value,
-      filterable: true,
-      placeholder: "内包装方式",
-      style: {
-        width: "100%",
-      },
-      disabled: false,
-    },
-    {
-      type: "select",
-      prop: "outerPackMethod",
-      label: "外包装方式",
-      required: true,
-      itemWidth: 50,
-      multiple: true,
-      data: outsideMethon.value,
-      filterable: true,
-      placeholder: "外包装方式",
-      style: {
-        width: "100%",
-      },
-      disabled: false,
-    },
-    {
-      type: "input",
+      type: "number",
       prop: "netWeight",
       label: "净重(kg)",
+      precision: 2,
+      min: 0,
+      controls: false,
       itemWidth: 50,
     },
     {
@@ -471,23 +463,22 @@ const formConfig = computed(() => {
   ];
 });
 
-const getList = async (req) => {
+const getList = (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
     .post("/productInfo/getConditionProductList", sourceList.value.pagination)
     .then(
-      (message) => {
-        sourceList.value.data = message.rows.map((x) => ({
+      (res) => {
+        sourceList.value.data = res.rows.map((x) => ({
           ...x,
           fileList: [],
-          ...JSON.parse(x.ehsdJson),
         }));
-        sourceList.value.pagination.total = message.total;
+        sourceList.value.pagination.total = res.total;
         setTimeout(() => {
           loading.value = false;
         }, 200);
-        const productIdList = message.rows.map((x) => x.id);
+        let productIdList = res.rows.map((x) => x.id);
         // 请求文件数据并回显
         if (productIdList.length > 0) {
           proxy
@@ -496,8 +487,8 @@ const getList = async (req) => {
             })
             .then((fileObj) => {
               for (let i = 0; i < sourceList.value.data.length; i++) {
-                const e = sourceList.value.data[i];
-                for (const key in fileObj) {
+                let e = sourceList.value.data[i];
+                for (let key in fileObj) {
                   if (e.id === key) {
                     e.fileList = fileObj[key];
                   }
@@ -522,78 +513,39 @@ const openModal = () => {
   modalType.value = "add";
   formData.data = {
     definition: "1",
-    outerPackMethod: [],
-    innerPackMethod: [],
     fileList: [],
-    fileListCopy: [],
     currency: "",
     costCurrency: "",
   };
-  if (accountCurrency.value && accountCurrency.value.length > 0) {
-    formData.data.currency = accountCurrency.value[0].value;
-    formData.data.costCurrency = accountCurrency.value[0].value;
+  if (currencyData.value && currencyData.value.length > 0) {
+    formData.data.currency = currencyData.value[0].dictKey;
+    formData.data.costCurrency = currencyData.value[0].dictKey;
   }
-  fileList.value = [];
-  fileListCopy.value = [];
 };
 
 const openExcel = () => {
   openExcelDialog.value = true;
 };
 
-const needAtt = [
-  "productClassifyId",
-  "name",
-  "spec",
-  "remark",
-  "fileList",
-  "id",
-  "unit",
-  "definition",
-];
 const submitForm = () => {
-  byform.value.handleSubmit((valid) => {
-    // if (!fileListCopy.value.length > 0) {
-    //   return ElMessage({
-    //     message: "请上传产品图片",
-    //     type: "info",
-    //   });
-    // }
-    let jsonObj = {};
-    formData.data.fileList = fileListCopy.value.map((x) => ({
-      id: x.id,
-      fileName: x.fileName,
-    }));
-    for (const key in formData.data) {
-      if (needAtt.includes(key)) {
-      } else {
-        jsonObj[key] = formData.data[key];
-        delete formData.data[key];
-      }
+  formDom.value.handleSubmit((valid) => {
+    if (!formData.data.fileList.length > 0) {
+      return proxy.msgTip("请上传图片", 2);
     }
-    jsonObj.innerPackMethod = jsonObj.innerPackMethod.join(",");
-    jsonObj.outerPackMethod = jsonObj.outerPackMethod.join(",");
-    jsonObj.type = "1"; //1为公司产品库
-    formData.data.ehsdJson = JSON.stringify(jsonObj);
+    // formData.data.fileList = formData.data.fileList.map((x) => ({
+    //   id: x.id,
+    //   fileName: x.fileName,
+    //   fileUrl: x.fileUrl,
+    // }));
     submitLoading.value = true;
     proxy.post(`/productInfo/${modalType.value}ByEhsd`, formData.data).then(
       (res) => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
+        proxy.msgTip("操作成功", 1);
         dialogVisible.value = false;
         submitLoading.value = false;
         getList();
       },
       (err) => {
-        for (const key in jsonObj) {
-          formData.data[key] = jsonObj[key];
-        }
-        formData.data.innerPackMethod =
-          formData.data.innerPackMethod.split(",");
-        formData.data.outerPackMethod =
-          formData.data.outerPackMethod.split(",");
         submitLoading.value = false;
       }
     );
@@ -609,50 +561,25 @@ const getTreeList = () => {
 const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/productInfo/detailByEhsd", { id: row.id }).then((res) => {
-    res.definition = "1"; //产品
-    let jsonObj = JSON.parse(res.ehsdJson);
-    res = {
-      ...res,
-      currency: jsonObj.currency
-        ? jsonObj.currency
-        : accountCurrency.value[0].value,
-      costCurrency: jsonObj.costCurrency
-        ? jsonObj.costCurrency
-        : accountCurrency.value[0].value,
-      ...jsonObj,
-    };
-    if (res.innerPackMethod) {
-      res.innerPackMethod = res.innerPackMethod.split(",");
-    } else {
-      res.innerPackMethod = [];
-    }
-    if (res.outerPackMethod) {
-      res.outerPackMethod = res.outerPackMethod.split(",");
-    } else {
-      res.outerPackMethod = [];
-    }
+    res.definition = "1";
     formData.data = res;
     dialogVisible.value = true;
     proxy
       .post("/fileInfo/getList", { businessIdList: [row.id] })
       .then((fileObj) => {
         if (fileObj[row.id]) {
-          fileList.value = fileObj[row.id].map((x) => ({
-            ...x,
-            url: x.fileUrl,
-          }));
-          fileListCopy.value = fileObj[row.id].map((x) => ({
+          formData.data.fileList = fileObj[row.id].map((x) => ({
             ...x,
             url: x.fileUrl,
+            name: x.fileName,
           }));
         } else {
-          fileList.value = [];
-          fileListCopy.value = [];
+          formData.data.fileList = [];
         }
       });
   });
 };
-const isdisabled = ["price", "costPrice", "remark", "netWeight"];
+
 // watch(modalType, (val) => {
 //   if (val) {
 //     for (let i = 0; i < formConfig.value.length; i++) {
@@ -665,23 +592,7 @@ const isdisabled = ["price", "costPrice", "remark", "netWeight"];
 //     }
 //   }
 // });
-const handleBeforeUpload = async (file) => {
-  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
-  uploadData.value = res.uploadBody;
-  fileListCopy.value.push({
-    id: res.id,
-    fileName: res.fileName,
-    path: res.fileUrl,
-    url: res.fileUrl,
-    uid: file.uid,
-  });
-};
-const handleRemove = (file) => {
-  const index = fileListCopy.value.findIndex(
-    (x) => x.uid === file.uid || x.id === file.id
-  );
-  fileListCopy.value.splice(index, 1);
-};
+
 const handleClickFile = (file) => {
   window.open(file.fileUrl, "_blank");
 };
@@ -712,34 +623,7 @@ const handleSuccess = (res) => {
     getList();
   }
 };
-const getDict = () => {
-  proxy
-    .getDictOne([
-      "inner_packaging_method_ehsd",
-      "outside_packaging_method_ehsd",
-      "unit",
-      "account_currency",
-    ])
-    .then((res) => {
-      innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      outsideMethon.value = res["outside_packaging_method_ehsd"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      productUnit.value = res["unit"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      accountCurrency.value = res["account_currency"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    });
-};
-getDict();
+
 getTreeList();
 getList();
 const clickSelect = (item) => {
@@ -766,16 +650,19 @@ const handlePreview = (file) => {
     window.open(file.fileUrl, "_black");
   }
 };
-const productContractDialog = ref(false);
-const currentProductId = ref("");
-const handleOpenProductContract = (row) => {
-  currentProductId.value = row.id;
-  productContractDialog.value = true;
+
+const handleClickUpload = () => {
+  let a = document.createElement("a");
+  a.href = "printer://" + "ftp://192.168.1.13/123/";
+  a.style.display = "none";
+  document.body.appendChild(a);
+  a.click();
+  document.body.removeChild(a);
 };
 </script>
 
 <style lang="scss" scoped>
-.user {
+.box {
   padding: 20px;
   display: flex;
   justify-content: space-between;

+ 4 - 2
src/views/login.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="login">
-    <h1>三梵</h1>
+    <h1>三梵MES制造执行系统</h1>
     <div class="content">
       <div class="warp-bg">
         <div class="left-bg">
@@ -27,7 +27,9 @@
           <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
             <div class="form" style="margin-top: 300px">
               <div class="">{{ $t("login.welcomeToLogin") }}~</div>
-              <h2>三梵 {{ $t("login.managementSystem") }}</h2>
+              <h2>三梵MES制造执行系统
+                <!-- {{ $t("login.managementSystem") }} -->
+              </h2>
               <el-form-item prop="tenantId" style="margin-top: 30px">
                 <!-- <el-input :placeholder="$t('login.pleaseEnterTheTenantId')" prefix-icon="user" @keyup.enter="handleLogin" autocomplete="email"
                           v-model="loginForm.tenantId">

+ 185 - 154
src/views/product/material/index.vue

@@ -1,29 +1,15 @@
 <template>
   <div class="user">
     <div class="tree">
-      <treeList
-        title="物料分类"
-        submitType="2"
-        :data="treeListData"
-        v-model="sourceList.pagination.productClassifyId"
-        @change="treeChange"
-        @changeTreeList="getTreeList"
-      >
+      <treeList title="物料分类" submitType="2" :data="treeListData" v-model="sourceList.pagination.productClassifyId" @change="treeChange"
+                @changeTreeList="getTreeList">
       </treeList>
     </div>
     <div class="content">
-      <byTable
-        :source="sourceList.data"
-        :pagination="sourceList.pagination"
-        :config="config"
-        :loading="loading"
-        highlight-current-row
-        :selectConfig="selectConfig"
-        :table-events="{
-          //element talbe事件都能传
-          select: select,
-        }"
-        :action-list="[
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{
+     
+        }" :action-list="[
           props.selectStatus
             ? {}
             : {
@@ -38,82 +24,56 @@
                 action: () => openModal('add'),
                 disabled: false,
               },
-        ]"
-        @get-list="getList"
-      >
+        ]" @get-list="getList">
         <template #pic="{ item }">
           <div v-if="item.fileList.length > 0">
-            <img
-              :src="item.fileList[0].fileUrl"
-              class="pic"
-              @click="handleClickFile(item.fileList[0])"
-            />
+            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
           </div>
           <div v-else></div>
         </template>
       </byTable>
     </div>
-    <el-dialog
-      :title="modalType == 'add' ? '添加' : '编辑'"
-      v-model="dialogVisible"
-      width="500"
-      v-loading="loading"
-      destroy-on-close
-    >
+    <el-dialog :title="modalType == 'add' ? '添加物料' : '编辑物料'" v-model="dialogVisible" width="80%" destroy-on-close>
       <div class="public_height_dialog">
-        <byForm
-          :formConfig="formConfig"
-          :formOption="formOption"
-          v-model="formData.data"
-          :rules="rules"
-          ref="byform"
-        >
-          <template #productPic>
-            <div>
-              <el-upload
-                v-model:fileList="fileList"
-                action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-                :data="uploadData"
-                list-type="picture-card"
-                :on-remove="handleRemove"
-                :on-success="handleSuccess"
-                :before-upload="handleBeforeUpload"
-              >
-                <el-icon><Plus /></el-icon>
-              </el-upload>
+        <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
+          <template #productLong>
+            <div style="width: 100%">
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item prop="productLong" label-width="0px" class="margin-b-0 wid100">
+                    <el-input-number v-model="formData.data.productLong" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                     :min="0" onmousewheel="return false;" />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item prop="productWide" label-width="0px" class="margin-b-0 wid100">
+                    <el-input-number v-model="formData.data.productWide" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                     :min="0" onmousewheel="return false;" />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item prop="productHigh" label-width="0px" class="margin-b-0 wid100">
+                    <el-input-number v-model="formData.data.productHigh" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                     :min="0" onmousewheel="return false;" />
+                  </el-form-item>
+                </el-col>
+              </el-row>
             </div>
           </template>
         </byForm>
       </div>
 
       <template #footer>
-        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm('byform')"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="defualt" :loading="submitLoading">
           确 定
         </el-button>
       </template>
     </el-dialog>
-    <el-dialog
-      title="Excel导入"
-      v-model="openExcelDialog"
-      width="400"
-      v-loading="loading"
-    >
+    <el-dialog title="Excel导入" v-model="openExcelDialog" width="400" v-loading="loading">
       <template #footer>
-        <el-button @click="openExcelDialog = false" size="large"
-          >取 消</el-button
-        >
-        <el-button
-          type="primary"
-          @click="submitExcel()"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button @click="openExcelDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitExcel()" size="large" :loading="submitLoading">
           确 定
         </el-button>
       </template>
@@ -122,13 +82,13 @@
 </template>
 
 <script setup>
-/* eslint-disable vue/no-unused-components */
-import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
-
-import { computed, defineComponent, ref } from "vue";
+const { proxy } = getCurrentInstance();
+const currencyData = computed(
+  () => proxy.useUserStore().allDict["account_currency"]
+);
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -143,13 +103,13 @@ const sourceList = ref({
     definition: "2",
   },
 });
-let dialogVisible = ref(false);
-let openExcelDialog = ref(false);
-let modalType = ref("add");
+const dialogVisible = ref(false);
+const openExcelDialog = ref(false);
+const modalType = ref("add");
 const materialUnit = ref([]);
 const materialType = ref([]);
 const treeData = ref([]);
-let rules = ref({
+const rules = ref({
   productClassifyId: [
     { required: true, message: "请选择物料分类", trigger: "change" },
   ],
@@ -157,17 +117,11 @@ let rules = ref({
   name: [{ required: true, message: "请输入物料名称", trigger: "blur" }],
   unit: [{ required: true, message: "请选择单位", trigger: "change" }],
 });
-const { proxy } = getCurrentInstance();
+
 const props = defineProps({
   selectStatus: Boolean,
 });
-const selectConfig = reactive([
-  {
-    label: "物料类型",
-    prop: "type",
-    data: [],
-  },
-]);
+const selectConfig = computed(() => []);
 const config = computed(() => {
   return [
     {
@@ -228,19 +182,19 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          props.selectStatus
-            ? {}
-            : {
-                attrs: {
-                  label: "复制",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  getDtlOne(row);
-                },
-              },
+          // props.selectStatus
+          //   ? {}
+          //   : {
+          //       attrs: {
+          //         label: "复制",
+          //         type: "primary",
+          //         text: true,
+          //       },
+          //       el: "button",
+          //       click() {
+          //         getDtlOne(row);
+          //       },
+          //     },
           props.selectStatus
             ? {
                 attrs: {
@@ -274,27 +228,19 @@ const config = computed(() => {
                 },
                 el: "button",
                 click() {
-                  ElMessageBox.confirm(
-                    "此操作将永久删除该数据, 是否继续?",
-                    "提示",
-                    {
-                      confirmButtonText: "确定",
-                      cancelButtonText: "取消",
-                      type: "warning",
-                    }
-                  ).then(() => {
-                    proxy
-                      .post("/productInfo/delete", {
-                        id: row.id,
-                      })
-                      .then(() => {
-                        ElMessage({
-                          message: "删除成功",
-                          type: "success",
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/productInfo/delete", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("删除成功", 1);
+                          getList();
                         });
-                        getList();
-                      });
-                  });
+                    })
+                    .catch((err) => {});
                 },
               },
         ];
@@ -303,7 +249,7 @@ const config = computed(() => {
   ];
 });
 
-let formData = reactive({
+const formData = reactive({
   data: {},
 });
 const formOption = reactive({
@@ -312,37 +258,74 @@ const formOption = reactive({
   itemWidth: 100,
   rules: [],
 });
-const byform = ref(null);
+const formDom = ref(null);
 const treeListData = ref([]);
 const formConfig = computed(() => {
   return [
     {
+      type: "title1",
+      title: "基本信息",
+    },
+    {
       type: "treeSelect",
       prop: "productClassifyId",
       label: "物料分类",
       data: treeData.value,
+      itemWidth: 100,
+      disabled: false,
     },
     {
-      type: "select",
-      prop: "type",
-      label: "物料类型",
-      required: true,
-      data: materialType.value,
+      type: "input",
+      prop: "name",
+      label: "物料名称",
+      itemWidth: 50,
+      disabled: false,
     },
     {
       type: "input",
       prop: "name",
-      label: "物料名称",
+      label: "物料编码",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "upload",
+      listType: "picture-card",
+      accept: ".gif, .jpeg, .jpg, .png",
+      prop: "fileList",
+      label: "物料缩略图",
+    },
+    {
+      type: "title1",
+      title: "材质特征",
     },
     {
       type: "input",
       prop: "spec",
-      label: "规格型号",
+      label: "材质",
+      itemWidth: 50,
     },
     {
       type: "input",
       prop: "barCode",
-      label: "条码编号",
+      label: "型号",
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "unit",
+      label: "正面纹路",
+      required: true,
+      data: materialUnit.value,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "unit",
+      label: "背面纹路",
+      required: true,
+      data: materialUnit.value,
+      itemWidth: 50,
     },
     {
       type: "select",
@@ -350,19 +333,72 @@ const formConfig = computed(() => {
       label: "单位",
       required: true,
       data: materialUnit.value,
+      itemWidth: 50,
     },
     {
-      type: "slot",
-      slotName: "productPic",
-      prop: "fileList",
-      label: "产品图片",
+      type: "select",
+      prop: "unit",
+      label: "色层",
+      required: true,
+      data: materialUnit.value,
+      itemWidth: 50,
+    },
+    // {
+    //   type: "input",
+    //   prop: "remark",
+    //   label: "备注",
+    //   itemType: "textarea",
+    // },
+    {
+      type: "title1",
+      title: "规格",
+    },
+    {
+      type: "input",
+      prop: "barCode",
+      label: "颜色",
+      itemWidth: 50,
     },
-
     {
       type: "input",
-      prop: "remark",
-      label: "备注",
-      itemType: "textarea",
+      prop: "barCode",
+      label: "安全库存",
+      itemWidth: 50,
+    },
+    {
+      type: "selectInput",
+      prop: "price",
+      selectProp: "currency",
+      label: "成本价",
+      itemWidth: 50,
+      disabledSelect: true,
+      data: currencyData.value,
+    },
+    {
+      type: "selectInput",
+      prop: "price",
+      selectProp: "currency",
+      label: "销售价",
+      itemWidth: 50,
+      disabledSelect: true,
+      data: currencyData.value,
+    },
+    {
+      type: "slot",
+      slotName: "productLong",
+      prop: "productLong",
+      label: "尺寸",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "number",
+      prop: "netWeight",
+      label: "净重(kg)",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
     },
   ];
 });
@@ -448,19 +484,14 @@ const select = (_selection, row) => {
 
 const tree = ref(null);
 const submitForm = () => {
-  console.log(byform.value);
-  byform.value.handleSubmit((valid) => {
-    formData.data.fileList = fileListCopy.value.map((x) => ({
-      id: x.id,
-      fileName: x.fileName,
-    }));
+  formDom.value.handleSubmit((valid) => {
+    if (!formData.data.fileList.length > 0) {
+      return proxy.msgTip("请上传图片", 2);
+    }
     submitLoading.value = true;
     proxy.post("/productInfo/" + modalType.value, formData.data).then(
       (res) => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
+        proxy.msgTip("操作成功", 1);
         dialogVisible.value = false;
         submitLoading.value = false;
         getList();

+ 1 - 1
src/views/register.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="register">
     <el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form">
-      <h3 class="title">三梵</h3>
+      <h3 class="title">三梵MES制造执行系统</h3>
       <el-form-item prop="username">
         <el-input v-model="registerForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
           <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>