From 5524cfff956b81fcd1ebeb40ac57924a38be42d8 Mon Sep 17 00:00:00 2001
From: WangHan <wwh_work@126,com>
Date: 星期四, 19 十二月 2024 15:02:17 +0800
Subject: [PATCH] 问题修改

---
 admin-web/src/views/foundation/material/edit.vue |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/admin-web/src/views/foundation/material/edit.vue b/admin-web/src/views/foundation/material/edit.vue
index 37b9590..6485d85 100644
--- a/admin-web/src/views/foundation/material/edit.vue
+++ b/admin-web/src/views/foundation/material/edit.vue
@@ -9,10 +9,6 @@
                   style="width: 100%"/>
       </el-form-item>
       <el-form-item label="鐗╁搧鍒嗙被" prop="categoryId">
-        <!--        <el-select v-model="formData.categoryId" clearable placeholder="璇烽�夋嫨" style="width: 100%">
-                  <el-option v-for="item in categoryList" :key="item.id" :label="item.categoryName"
-                             :value="item.id"></el-option>
-                </el-select>-->
         <el-cascader
             clearable
             filterable
@@ -25,7 +21,7 @@
       <el-row :gutter="20" v-for="(m, i) in formData.models">
         <el-col :span="9">
           <el-form-item label="瑙勬牸鍨嬪彿" :prop="`models.${i}.modelName`" :rules="rules.modelName">
-            <el-input v-model="m.modelName" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙峰悕绉�" clearable maxlength="20" show-word-limit
+            <el-input :disabled="!!setting.id" v-model="m.modelName" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙峰悕绉�" clearable maxlength="20" show-word-limit
                       style="width: 100%"/>
           </el-form-item>
         </el-col>
@@ -57,7 +53,7 @@
 <script>
 import winMd from '@/components/win/win-md'
 import myButton from '@/components/myButton/myButton'
-import * as finsystenant from '@/api/baseSetting/finsystenant'
+import {addGoods,editGoods,goodsDetail} from "@/api/foudation/material";
 import {getTree} from '@/api/foudation/classification';
 import {mapGetters} from 'vuex'
 
@@ -111,7 +107,7 @@
   },
   async created() {
     if (this.setting.id) {
-      await finsystenant.editmaterial(this.setting.id).then(res => {
+      await goodsDetail(this.setting.id).then(res => {
         this.formData = res
         if (!this.formData.agencyId) {
           this.formData.agencyId = this.userInfo.tenantId
@@ -155,7 +151,7 @@
           this.loading = true
           if (this.setting.id) {
             // 缂栬緫鎺ュ彛
-            finsystenant.editcode(params).then(res => {
+            editGoods(params).then(res => {
               this.loading = false
               if (res) {
                 this.$message.success('淇濆瓨鎴愬姛锛�')
@@ -164,12 +160,13 @@
               } else {
                 this.$message.error('淇濆瓨澶辫触')
               }
-            }).catch(() => {
+            }).catch((err) => {
+              this.$message.warning(err.msg)
               this.loading = false
             });
           } else {
             params.orgId = this.setting.orgId
-            finsystenant.addcode(params).then(res => {
+            addGoods(params).then(res => {
               this.loading = false
               if (res) {
                 this.$message.success('淇濆瓨鎴愬姛锛�')
@@ -179,6 +176,7 @@
                 this.$message.error('淇濆瓨澶辫触')
               }
             }).catch(() => {
+              this.$message.warning(err.msg)
               this.loading = false
             });
           }

--
Gitblit v1.9.1