From 1822fb1b8dc476bdb3270d0dd0cd79cbbc02ae2c Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期二, 12 十二月 2023 16:58:25 +0800
Subject: [PATCH] feat: 物品规格管理页面

---
 admin-web/src/views/foundation/material/index.vue |   61 ++++++++++++++++--------------
 1 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/admin-web/src/views/foundation/material/index.vue b/admin-web/src/views/foundation/material/index.vue
index 314fbb1..972c790 100644
--- a/admin-web/src/views/foundation/material/index.vue
+++ b/admin-web/src/views/foundation/material/index.vue
@@ -13,11 +13,13 @@
               <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/>
             </el-col>
           </el-row>
-          <!--娣诲姞/缂栬緫寮圭獥-->
-          <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/>
         </el-card>
       </el-container>
     </el-container>
+    <!--娣诲姞/缂栬緫寮圭獥-->
+    <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/>
+    <!--瑙勬牸-->
+    <specs v-if="specsSetting.show" :setting="specsSetting" @close="specsSetting.show = false" @search="search"></specs>
     <my-import
       :import-setting="importSetting"
       :dialog-show="importSetting.dialogShow"
@@ -33,13 +35,14 @@
 import MyButton from "@/components/myButton/myButton";
 import SettingIplatform from '@/utils/settingIplatform';
 import edit from './edit'
-import * as finsystenant from '@/api/baseSetting/finsystenant'
+import {updStatus,delGoods} from '@/api/foudation/material'
 import myImport from '@/views/components/myImport'
 import {getBaseUrl} from '@/utils/base';
+import Specs from "@/views/foundation/material/specs/list.vue";
 
 export default {
   name: "index",
-  components: {MyButton, MyTableV2, edit, myTree, myImport},
+  components: {Specs, MyButton, MyTableV2, edit, myTree, myImport},
   data() {
     return {
       // 鎼滅储妗�
@@ -110,7 +113,7 @@
           dialogShow: false,
           fileSettings: {
               data: {},
-              uploadUrl: getBaseUrl()+"/pc/fin/sys/tenant/import", // 涓婁紶鍦板潃
+              uploadUrl: getBaseUrl()+"/pc/base/goods/template/import", // 涓婁紶鍦板潃
               accept: '.xls', // 鏍煎紡
               type: 'text', // 鍥炴樉褰㈠紡
               loading: false // 瀵煎叆鏁堟灉
@@ -118,7 +121,7 @@
           /* 妯℃澘涓嬭浇 */
           templateSettings: {
               templateName: '瀵煎叆妯℃澘.xls', // 鍚嶇О
-              templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate' // 涓嬭浇鍦板潃
+              templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate?type=goods' // 涓嬭浇鍦板潃
           },
           onSuccess: null
       },
@@ -126,6 +129,11 @@
         title: '',
         id: '',
         orgId: '',
+        show: false,
+      },
+      specsSetting: {
+        title: '',
+        id: '',
         show: false,
       },
       // 琛ㄦ牸鏁版嵁
@@ -159,12 +167,12 @@
         },
         // 鍒椾俊鎭�
         columns: [
-          {title: '鐗╁搧缂栧彿', field: 'goodsCode', align: 'center'},
-          {title: '鐗╁搧鍚嶇О', field: 'goodsName', align: 'center'},
-          {title: '鍒嗙被', field: 'categoryName', align: 'center'},
-          {title: '绫诲埆', field: 'classification', align: 'center'},
+          {title: '鐗╁搧缂栧彿', field: 'goodsCode', align: 'center', width: 120},
+          {title: '鐗╁搧鍚嶇О', field: 'goodsName', align: 'left', minWidth: 140},
+          {title: '鍒嗙被', field: 'categoryName', align: 'left', minWidth: 140},
+          {title: '绫诲埆', field: 'classification', align: 'center', width: 80},
           // {title: '閲囪喘绫诲瀷', field: 'categoryId', align: 'center'},
-          {title: '鎵�灞炴満鏋�', field: 'agencyName', align: 'center'},
+          {title: '鎵�灞炴満鏋�', field: 'agencyName', align: 'left', minWidth: 140},
           {
             title: '鍒涘缓鏃堕棿',
             field: 'createDate',
@@ -205,7 +213,7 @@
         // 鎿嶄綔淇℃伅
         operation: {
           show: true, // 鏄剧ず鎿嶄綔鍒�
-          width: '250', // 鍒楀
+          width: 250, // 鍒楀
           attr: [
             {
               title: '缂栬緫',
@@ -219,12 +227,13 @@
                 this.del(row);
               },
             },
-            // {
-            //   title: '瑙勬牸鍨嬪彿',
-            //   events: (row) => {
-            //     this.showAudit(row);
-            //   },
-            // },
+            {
+              title: '瑙勬牸鍨嬪彿',
+              type: 'primary',
+              events: (row) => {
+                this.showSpecs(row);
+              },
+            },
           ],
         },
         paging: {
@@ -262,7 +271,7 @@
       vm.$modal.confirm('纭瑕�' + text + '"' + row.goodsName + '"鍚楋紵').then(function () {
         let params = Object.assign({}, row)
         params.states = row.states == 1 ? 0 : 1
-        finsystenant.upcode(params).then(res => {
+        updStatus(params).then(res => {
           if (res) {
             row.states = row.states === 1 ? 0 : 1
             vm.$modal.msgSuccess(text + "鎴愬姛");
@@ -275,7 +284,7 @@
       this.$modal
         .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.goodsName + '"鐨勬満鏋勫悧锛�')
         .then(function () {
-          finsystenant.delCode({id: row.id}).then((res) => {
+          delGoods({id: row.id}).then((res) => {
           });
         })
         .then((res) => {
@@ -290,19 +299,13 @@
       //   this.$message.warning('璇峰厛閫夋嫨宸︿晶鏈烘瀯')
       // } else {
         this.editSetting.id = null;
-        this.editSetting.info = null;
         this.editSetting.title = '鏂板';
         this.editSetting.show = true;
       // }
     },
-    showAudit(row) {
-      finsystenant.editmaterial(row.id).then(res => {
-        // console.log(res,'res');
-        this.editSetting.id = res.id;
-        this.editSetting.info = JSON.stringify(res);
-        this.editSetting.title = '缂栬緫';
-        this.editSetting.show = true;
-      })
+    showSpecs(row) {
+      this.specsSetting.id = row.id;
+      this.specsSetting.show = true;
     },
     // 鏌ヨtable鍒楄〃
     search(pageNum) {

--
Gitblit v1.9.1