From 07cbbd39cfb448b7b3a78388308cda727be34569 Mon Sep 17 00:00:00 2001
From: futian.liu <liufutianyoo@163.com>
Date: 星期二, 12 十二月 2023 17:22:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

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

diff --git a/admin-web/src/views/foundation/material/index.vue b/admin-web/src/views/foundation/material/index.vue
index 167fd9a..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"
@@ -27,81 +29,62 @@
 </template>
 
 <script>
+import * as DateFormatter from '@/utils/DateFormatter';
 import myTree from '@/components/myTree/index'
 import MyTableV2 from "@/components/myTable/myTableV2";
 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 {
       // 鎼滅储妗�
       items: [
         {
           type: 'text',
-          dataIndex: 'goods_Name',
+          dataIndex: 'goodsName',
           label: '鐗╁搧鍚嶇О',
           placeholder: '璇疯緭鍏�',
           defaultValue: ''
         },
         {
           type: 'text',
-          dataIndex: 'goods_Code',
+          dataIndex: 'goodsCode',
           label: '鐗╁搧缂栧彿',
           placeholder: '璇疯緭鍏�',
           defaultValue: ''
         },
         {
           type: 'select',
-          dataIndex: 'status',
+          dataIndex: 'classification',
           label: '绫诲埆',
           placeholder: '璇烽�夋嫨',
-          defaultValue: '1',
+          defaultValue: '',
           options: [
             {
               label: 'A',
-              value: '1'
+              value: 'A'
             },
             {
               label: 'B',
-              value: '2'
+              value: 'B'
             },
             {
               label: 'C',
-              value: '3'
+              value: 'C'
             }
           ]
         },
         {
           type: 'select',
-          dataIndex: 'status',
-          label: '閲囪喘绫诲埆',
-          placeholder: '璇烽�夋嫨',
-          defaultValue: '1',
-          options: [
-            {
-              label: '鍏ㄩ儴',
-              value: '1'
-            },
-            {
-              label: '鑷噰',
-              value: '2'
-            },
-            {
-              label: '闆嗛噰',
-              value: '3'
-            }
-          ]
-        },
-        {
-          type: 'select',
-          dataIndex: 'status',
+          dataIndex: 'states',
           label: '鐘舵��',
           placeholder: '璇烽�夋嫨',
           defaultValue: '1',
@@ -122,7 +105,7 @@
         tenantId: null,
         userName: null,
         userPhone: null,
-        status: 1
+        states: 1
       },
       // 瀵煎叆
       importSetting: {
@@ -130,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 // 瀵煎叆鏁堟灉
@@ -138,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
       },
@@ -148,11 +131,16 @@
         orgId: '',
         show: false,
       },
+      specsSetting: {
+        title: '',
+        id: '',
+        show: false,
+      },
       // 琛ㄦ牸鏁版嵁
       table: {
         showIndex: true, // 鏄惁鏄剧ず搴忓彿
         expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁
-        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 璇锋眰鍦板潃
+        url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/list', // 璇锋眰鍦板潃
         // 宸ュ叿鏉�
         tools: {
           columnsCtrl: {// 鍒楁帶鍒舵寜閽�
@@ -179,19 +167,19 @@
         },
         // 鍒椾俊鎭�
         columns: [
-          {title: '鐗╁搧缂栧彿', field: 'goods_Code', align: 'center'},
-          {title: '鐗╁搧鍚嶇О', field: 'goods_Name', align: 'center'},
-          {title: '鍒嗙被', field: 'classification', align: 'center'},
-          {title: '绫诲埆', field: 'states', align: 'center'},
-          {title: '閲囪喘绫诲瀷', field: 'category_id', align: 'center'},
-          {title: '鎵�灞炴満鏋�', field: 'agency_Name', 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: 'left', minWidth: 140},
           {
             title: '鍒涘缓鏃堕棿',
-            field: 'create_Date',
+            field: 'createDate',
             align: 'center',
             width: 160,
             formatter: (row) => {
-              return {value: DateFormatter.LongToDateTime(row.create_Date)};
+              return {value: DateFormatter.LongToDateTime(row.createDate)};
             },
           },
           {
@@ -201,7 +189,7 @@
             width: 100,
             switch: row => {
               const result = {}
-              if (row.status == 1) {
+              if (row.states == 1) {
                 Object.assign(result, {
                   value: true, // 寮�
                   label: '鏄�', // 寮�鐨勬弿杩�
@@ -225,7 +213,7 @@
         // 鎿嶄綔淇℃伅
         operation: {
           show: true, // 鏄剧ず鎿嶄綔鍒�
-          width: '150', // 鍒楀
+          width: 250, // 鍒楀
           attr: [
             {
               title: '缂栬緫',
@@ -241,8 +229,9 @@
             },
             {
               title: '瑙勬牸鍨嬪彿',
+              type: 'primary',
               events: (row) => {
-                this.showAudit(row);
+                this.showSpecs(row);
               },
             },
           ],
@@ -278,13 +267,13 @@
     },
     updState(row) {
       let vm = this
-      let text = row.status == 0 ? "鍚敤" : "绂佺敤";
-      vm.$modal.confirm('纭瑕�' + text + '"' + row.name + '"鍚楋紵').then(function () {
+      let text = row.states == 0 ? "鍚敤" : "绂佺敤";
+      vm.$modal.confirm('纭瑕�' + text + '"' + row.goodsName + '"鍚楋紵').then(function () {
         let params = Object.assign({}, row)
-        params.status = row.status == 1 ? 0 : 1
-        finsystenant.edit(params).then(res => {
+        params.states = row.states == 1 ? 0 : 1
+        updStatus(params).then(res => {
           if (res) {
-            row.status = row.status === 1 ? 0 : 1
+            row.states = row.states === 1 ? 0 : 1
             vm.$modal.msgSuccess(text + "鎴愬姛");
             vm.search()
           }
@@ -293,9 +282,9 @@
     },
     del(row) {
       this.$modal
-        .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.name + '"鐨勬満鏋勫悧锛�')
+        .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.goodsName + '"鐨勬満鏋勫悧锛�')
         .then(function () {
-          finsystenant.del({id: row.id}).then((res) => {
+          delGoods({id: row.id}).then((res) => {
           });
         })
         .then((res) => {
@@ -310,16 +299,13 @@
       //   this.$message.warning('璇峰厛閫夋嫨宸︿晶鏈烘瀯')
       // } else {
         this.editSetting.id = null;
-        this.editSetting.info = null;
         this.editSetting.title = '鏂板';
         this.editSetting.show = true;
       // }
     },
-    showAudit(row) {
-      this.editSetting.id = row.id;
-      this.editSetting.info = JSON.stringify(row);
-      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