Explorar el Código

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into test

chencc hace 1 año
padre
commit
c933993edf

+ 23 - 0
src/components/jimureport/api.js

@@ -0,0 +1,23 @@
+import request from '@/utils/request';
+
+export async function getServiceurl () {
+  const res = await request.get('sys/jimureport/getServiceurl');
+  if (res.data.code == 0 && res.data.data) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getPrintMap () {
+  const res = await request.get('sys/jimureport/getPrintMap');
+  if (res.data.code == 0 && res.data.data) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getJmPrintViewUrl (code) {
+  const res = await request.get('sys/jimureport/getJmPrintViewUrl/'+code);
+  if (res.data.code == 0 && res.data.data) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 23 - 0
src/components/jimureport/browse.vue

@@ -0,0 +1,23 @@
+<template>
+  <iframe
+    :src="url"
+    width="100%"
+    style="height: calc(100vh - 100px)"
+    frameborder="0"
+    allowfullscreen="true"
+  ></iframe>
+</template>
+
+<script>
+  export default {
+    props: {
+      url: ''
+    },
+    data() {
+      return {};
+    },
+
+    methods: {}
+  };
+</script>
+<style scoped lang="scss"></style>

+ 52 - 0
src/components/jimureport/browseModal.vue

@@ -0,0 +1,52 @@
+<template>
+  <div>
+    <ele-modal
+      :visible.sync="showEditFlag"
+      :close-on-click-modal="false"
+      custom-class="ele-dialog-form"
+      append-to-body
+      :fullscreen="true"
+    >
+      <browse :url="fileUrl"></browse
+    ></ele-modal>
+    <el-link type="primary" @click="open">{{ text }}</el-link>
+  </div>
+</template>
+
+<script>
+  import { getToken } from '@/utils/token-util';
+  import { getJmPrintViewUrl } from './api.js';
+  import browse from './browse.vue';
+
+  export default {
+    components: {
+      browse
+    },
+    props: {
+      text: {
+        default: '打印预览'
+      },
+      businessId: {
+        default: ''
+      },
+      businessCode: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        fileUrl: '',
+        showEditFlag: false
+      };
+    },
+
+    methods: {
+      async open() {
+        this.showEditFlag = true;
+        let url = await getJmPrintViewUrl(this.businessCode);
+        this.fileUrl = `${url}?token=${getToken()}&id=${this.businessId}`;
+      }
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

+ 4 - 0
src/store/modules/user.js

@@ -18,6 +18,10 @@ const formatRouter = (list) => {
         authorities.push(p);
         authorities.push(p);
         p.hide = true;
         p.hide = true;
       }
       }
+      //报表菜单 source = 2 为报表时 extend 为报表id
+      if (p.source === 2 && p.extend) {
+        p.path = p.path + '/' + p.extend;
+      }
       //  else {
       //  else {
       if (p.children?.length) {
       if (p.children?.length) {
         p.children = fn(p.children);
         p.children = fn(p.children);

+ 12 - 4
src/views/factoryModel/qualificationManagement/components/vendorDialog.vue

@@ -2,7 +2,7 @@
   <ele-modal
   <ele-modal
     v-if="visible"
     v-if="visible"
     :visible.sync="visible"
     :visible.sync="visible"
-    title="供应商列表"
+    :title="title"
     width="70%"
     width="70%"
     :centered="true"
     :centered="true"
     :close-on-click-modal="false"
     :close-on-click-modal="false"
@@ -61,7 +61,7 @@
       >
       >
         <AssetTree
         <AssetTree
           @handleNodeClick="handleNodeClick"
           @handleNodeClick="handleNodeClick"
-          ids="19,20250317001"
+          :ids="ids"
           :isFirstRefreshTable="false"
           :isFirstRefreshTable="false"
           ref="treeList"
           ref="treeList"
         />
         />
@@ -135,6 +135,14 @@
       isAll: {
       isAll: {
         type: Boolean,
         type: Boolean,
         default: false
         default: false
+      },
+      title: {
+        type: String,
+        default: '选择供应商'
+      },
+      ids: {
+        type: String,
+        default: '19'
       }
       }
     },
     },
     computed: {
     computed: {
@@ -155,7 +163,7 @@
             show: this.isAll,
             show: this.isAll,
             reserveSelection: true,
             reserveSelection: true,
             selectable: (row, index) => {
             selectable: (row, index) => {
-              return !this.disabledId.includes(row.id)
+              return !this.disabledId.includes(row.id);
             }
             }
           },
           },
           {
           {
@@ -279,7 +287,7 @@
         return getVendorPageList({
         return getVendorPageList({
           pageNum: page,
           pageNum: page,
           size: limit,
           size: limit,
-          type: 2,
+          type:this.title=='选择供应商'?2:3,
           ...where
           ...where
         });
         });
       },
       },

+ 88 - 30
src/views/material/product/components/link-msg.vue

@@ -41,33 +41,64 @@
               添加供应商
               添加供应商
             </el-button>
             </el-button>
           </template>
           </template>
-            <!-- 操作列 -->
-            <template v-slot:action="{ row }">
-              <el-popconfirm
-                  class="ele-action"
-                  title="确定要删除此供应商吗?"
-                  @confirm="deleteSupplie(row)"
-                >
-                  <template v-slot:reference>
-                    <el-link
-                      type="danger"
-                      :underline="false"
-                      icon="el-icon-delete"
-                    >
-                      删除
-                    </el-link>
-                  </template>
-          
-                </el-popconfirm>
-            </template>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此供应商吗?"
+              @confirm="deleteSupplie(row)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="生产厂家">
+        <ele-pro-table
+          :columns="supplierColumn"
+          :datasource="manufacturerData"
+          :need-page="false"
+          ref="supplierRef"
+        >
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="handParent()"
+              v-if="id"
+            >
+              添加生产厂家
+            </el-button>
+          </template>
+          <!-- 操作列 -->
+          <!-- <template v-slot:action="{ row }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此供应商吗?"
+              @confirm="deleteSupplie(row)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template> -->
         </ele-pro-table>
         </ele-pro-table>
-        </el-tab-pane
-      >
+      </el-tab-pane>
     </el-tabs>
     </el-tabs>
     <vendorDialog
     <vendorDialog
       ref="vendorDialogRef"
       ref="vendorDialogRef"
       :is-all="true"
       :is-all="true"
       @success="success"
       @success="success"
+      :ids="ids"
+      :title="title"
     ></vendorDialog>
     ></vendorDialog>
   </div>
   </div>
 </template>
 </template>
@@ -310,11 +341,15 @@
             }
             }
           }
           }
         ],
         ],
+
         moduleData: [],
         moduleData: [],
         eqData: [],
         eqData: [],
         bomData: [],
         bomData: [],
         pathData: [],
         pathData: [],
-        supplierData: [] //供应商
+        supplierData: [], //供应商
+        manufacturerData: [], //生产厂家
+        ids: '',
+        title: ''
       };
       };
     },
     },
     watch: {
     watch: {
@@ -322,7 +357,8 @@
         handler(val) {
         handler(val) {
           if (val) {
           if (val) {
             this.getData();
             this.getData();
-            this.contactQueryByCategoryIdsAPI();
+            this.contactQueryByCategoryIdsAPI(2);
+            this.contactQueryByCategoryIdsAPI(3);
           }
           }
         },
         },
         immediate: true
         immediate: true
@@ -367,25 +403,47 @@
 
 
         this.moduleData = data;
         this.moduleData = data;
       },
       },
-      // 关联供应商
-      async contactQueryByCategoryIdsAPI() {
+      // 关联供应商/生产厂家
+      async contactQueryByCategoryIdsAPI(type) {
         const data = await storage.contactQueryByCategoryIdsAPI({
         const data = await storage.contactQueryByCategoryIdsAPI({
-          categoryIds: [this.id]
+          categoryIds: [this.id],
+          type
         });
         });
-
-        this.supplierData = data[this.id] || [];
+        if (type == 2) {
+          this.supplierData = data[this.id] || [];
+        }
+        if (type == 3) {
+          this.manufacturerData = data[this.id] || [];
+        }
       },
       },
       handParent() {
       handParent() {
+        console.log(this.activeTab,'his.activeTab')
+        if (this.activeTab == '4') {
+          this.ids = '19';
+          this.title = '选择供应商';
+        }
+        if (this.activeTab == '5') {
+          this.ids = '20250317001';
+          this.title = '选择生产厂家';
+
+        }
         this.$refs.vendorDialogRef.open(
         this.$refs.vendorDialogRef.open(
-          this.supplierData.map((item) => item.id)
+          this.activeTab == '4'
+            ? this.supplierData.map((item) => item.id)
+            : this.manufacturerData.map((item) => item.id)
         );
         );
       },
       },
+
       success(list) {
       success(list) {
         saveSupplier({
         saveSupplier({
           productId: this.id,
           productId: this.id,
           supplierIds: list.map((item) => item.id)
           supplierIds: list.map((item) => item.id)
         }).then((res) => {
         }).then((res) => {
-          this.contactQueryByCategoryIdsAPI();
+          if (this.activeTab == '4') {
+            this.contactQueryByCategoryIdsAPI(2);
+          } else {
+            this.contactQueryByCategoryIdsAPI(3);
+          }
         });
         });
       },
       },
       deleteSupplie(row) {
       deleteSupplie(row) {

+ 44 - 0
src/views/reportForms/sourceLink/index.vue

@@ -0,0 +1,44 @@
+<template>
+    <div class="ele-body">
+        <jimureportBrowse :url="fileUrl"></jimureportBrowse>
+    </div>
+  </template>
+  
+  <script>
+  import jimureportBrowse from '@/components/jimureport/browse.vue';
+  import { getServiceurl } from '@/components/jimureport/api.js';
+  import { getToken } from '@/utils/token-util';
+  export default {
+    components: {
+        jimureportBrowse
+    },
+  
+    data() {
+      return {
+        fileUrl: ''
+      };
+    },
+    computed: {},
+    watch: {
+      '$route'(to, from) {
+        if (to.path) {
+          this.getJmPrintBrowse();  // 重新加载数据
+        }
+      }
+    },
+    created() {
+        this.getJmPrintBrowse()
+    },
+    methods: {
+       async getJmPrintBrowse(){
+        let id = this.$route.path.split('/').pop()
+        let url = await getServiceurl();
+        this.fileUrl = `${url}/jmreport/view/${id}?token=${getToken()}`;
+       }
+    }
+  };
+  </script>
+  <style lang="scss" scoped>
+
+  </style>
+  

+ 2 - 4
src/views/system/menu/components/menu-edit.vue

@@ -54,15 +54,13 @@
         <el-col :span="12">
         <el-col :span="12">
           <el-form-item
           <el-form-item
             label="组件地址"
             label="组件地址"
-            prop="component"
+            :prop="form.source == 2 ? 'component' : ''"
           >
           >
             <el-input
             <el-input
               :disabled="form.source == 2"
               :disabled="form.source == 2"
               clearable
               clearable
               v-model="form.component"
               v-model="form.component"
-              :placeholder="
-                form.source == 1 ? '请输入组件地址' : '请输入外链地址'
-              "
+              placeholder="请输入组件地址"
             />
             />
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>