Explorar o código

资产台账导出、证照管理静态页面

LAPTOP-16IUEB3P\Lenovo %!s(int64=2) %!d(string=hai) anos
pai
achega
80d79904b7

+ 9 - 3
src/api/ledgerAssets/index.js

@@ -68,8 +68,14 @@ export async function getCount (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-// 导出设备
+// 导出实体
 export async function downloadAsset (params, fileName) {
-  const res = await request.post('/main/asset/page/export',  params);
-  download(res.data, fileName);
+  const res = await request.post('/main/asset/page/export',  params, {responseType:'blob'} );
+  download(res.data, fileName)
+}
+
+// 导出类别
+export async function downloadCategory (params, fileName) {
+  const res = await request.post('/main/category/pageSubstance/export',  params, {responseType:'blob'} );
+  download(res.data, fileName)
 }

+ 2 - 1
src/enum/dict.js

@@ -29,7 +29,8 @@ export default {
   产量目标单位: 'target_unit',
   产能计划状态: 'capacity_status',
   分类层级: 'bom_level',
-  周转车材质: 'turnover_material'
+  周转车材质: 'turnover_material',
+  证件类型: 'id_type'
 };
 
 export const numberList = [

+ 156 - 0
src/views/documentManagement/certificateManagement/components/add-dialog.vue

@@ -0,0 +1,156 @@
+<template>
+  <!-- 上传 -->
+  <el-dialog title="新增" :visible.sync="dialogVisible" width="50%">
+      <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+        <el-row :gutter="15">
+          <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+            <el-form-item prop="code" label="证照编号">
+              <el-input
+                placeholder="请输入"
+                v-model="form.code"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+             <el-form-item prop="typeValue" label="证件类型">
+                <DictSelection v-model="form.typeValue" dictName="证件类型"></DictSelection>
+             </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+            <el-form-item prop="status" label="状态">
+               <DictSelection v-model="form.status" dictName="规则状态"></DictSelection>
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+             <el-form-item prop="owner" label="持证人">
+               <el-input
+                 placeholder="请输入"
+                 v-model="form.owner"
+               ></el-input>
+             </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+            <el-form-item prop="salary" label="颁发时间">
+              <el-date-picker
+                style="width:100%"
+                v-model="form.awardTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择日期"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+             <el-form-item prop="date" label="有效期至">
+                <el-date-picker
+                  style="width:100%"
+                  v-model="form.date"
+                  type="daterange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  :default-time="['00:00:00', '23:59:59']"
+                >
+                </el-date-picker>
+             </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
+             <el-form-item prop="image" label="证照图片">
+               <fileUpload
+                 v-model="form.image"
+                 module="main"
+                 :showLib="true"
+               />
+             </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
+            <el-form-item prop="remark" label="备注">
+               <el-input
+                 placeholder="请输入"
+                 v-model="form.remark"
+                 type="textarea"
+                 :rows="3"
+                 :resize="`none`"
+               ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button size="small" @click="submit" type="primary">提 交</el-button>
+      <el-button size="small" @click="dialogVisible = false">关 闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  // import { uploadBatch } from '@/api/system/file/index.js';
+  import fileUpload from '@/components/upload/fileUpload';
+  import imgUpload from '@/components/upload/imgUpload';
+  export default {
+    components: {
+      fileUpload,
+      imgUpload
+    },
+    //注册组件
+    data () {
+      return {
+        dialogVisible: false,
+        rules: {
+          code: [{ required: true, trigger: 'blur', message: '请输入证照编号' }],
+          typeValue: [{ required: true, trigger: 'change' , message: '请选择证件类型'}],
+          date: [{ required: true, trigger: 'change', message: '请选择有效期' }],
+          owner: [{ required: true, trigger: 'blur', message: '请输入持证人' }],
+          status: [{ required: true, trigger: 'change', message: '请选择状态' }],
+          image: [{ required: true, trigger: 'change' , message: '请选择证照图片'}]
+        },
+        form: { },
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created () {},
+    methods: {
+      open () {
+        this.$refs.form && this.$refs.form.clearValidate();
+        this.form = { };
+        this.dialogVisible = true;
+      },
+      submit(){
+         this.$refs.form.validate((valid) => {
+           if (!valid) {
+             return false;
+           }
+           this.loading = true;
+           const data = {
+             ...this.form,
+             parentId: this.form.parentId || 0
+           };
+           saveOrUpdate(data)
+             .then((msg) => {
+               this.loading = false;
+               this.$message.success(msg);
+               this.updateVisible(false);
+               this.$emit('done');
+             })
+             .catch((e) => {
+               this.loading = false;
+             });
+         });
+
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+ .el-form-item{
+    margin-bottom:20px!important;
+ }
+</style>

+ 20 - 15
src/views/documentManagement/certificateManagement/components/certificate-search.vue

@@ -7,18 +7,8 @@
     @submit.native.prevent
   >
     <el-row :gutter="10">
-      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 5 }">
+      <el-col v-bind="styleResponsive ? { md:7 } : { span: 7 }">
         <el-form-item label="有效期至">
-          <el-input clearable v-model="where.name" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 5 }">
-        <el-form-item label="证件编号">
-          <el-input clearable v-model="where.module" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 5 }">
-        <el-form-item label="持证人">
           <el-date-picker
             type="daterange"
             class="ele-fluid"
@@ -31,22 +21,37 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="证件编号">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6}">
+        <el-form-item label="持证人">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { md: 5 } : { span: 5 }">
         <el-form-item label="证件类型">
-          <el-input clearable v-model="where.module" placeholder="请输入" />
+          <DictSelection
+            dictName="证件类型"
+            clearable
+            v-model="where.type"
+          >
+          </DictSelection>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
-        <el-form-item>
+      <el-col v-bind="styleResponsive ? { md: 24 } : { span: 24 }">
+        <el-form-item label-width="0">
           <el-button
             type="primary"
             icon="el-icon-search"
             class="ele-btn-icon"
             @click="search"
+            size="medium"
           >
             查询
           </el-button>
-
           <el-button
             @click="reset"
             icon="el-icon-refresh"

+ 0 - 117
src/views/documentManagement/certificateManagement/components/upload-dialog.vue

@@ -1,117 +0,0 @@
-<template>
-  <!-- 上传 -->
-  <el-dialog title="文件上传" :visible.sync="dialogVisible" width="40%">
-    <el-form label-width="110px" class="zw-criterion">
-      <el-form-item label="选择文件">
-        <el-upload
-          class="avatar-uploader"
-          action="#"
-          :show-file-list="false"
-          :http-request="handlSuccess"
-          :before-upload="beforeUpload"
-        >
-          <el-button icon="el-icon-plus" size="small" type="primary"
-            >文件上传</el-button
-          >
-        </el-upload>
-      </el-form-item>
-      <el-form-item label="模块名">
-        <DictSelection v-model="module" dictName="文件模块"></DictSelection>
-      </el-form-item>
-      <el-form-item label="">
-        <div class="imgs-box">
-          <p v-for="(item, index) in attaments" :key="index" class="imgs-p">
-            <span> {{ item.name }}</span>
-            <el-link @click="delFileList(index)" type="primary">删除</el-link>
-          </p>
-        </div>
-      </el-form-item>
-    </el-form>
-    <div slot="footer" class="dialog-footer">
-      <el-button size="small" @click="dialogVisible = false">关 闭</el-button>
-      <el-button size="small" @click="upload" type="primary">上 传</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-  import { uploadBatch } from '@/api/system/file/index.js';
-
-  export default {
-    //注册组件
-    data () {
-      return {
-        showViewer: false, // 显示查看器
-        dialogVisible: false,
-        uploadShow: false,
-        attaments: [], //上传文件
-        module: '',
-        file: ''
-      };
-    },
-    created () {},
-    methods: {
-      open () {
-        this.attaments = [];
-        this.module = '';
-        this.dialogVisible = true;
-      },
-      //删除附件
-      delFileList (index) {
-        this.attaments.splice(index, 1);
-      },
-      //上传限制
-      beforeUpload (file) {
-        const isLt10M = file.size / 1024 / 1024 < 10;
-        if (!isLt10M) {
-          this.$message.error('上传文件大小不能超过 10MB!');
-        }
-        return isLt10M;
-      },
-      //图片上传
-      handlSuccess (param) {
-        this.file = param.file;
-        this.attaments.push(param.file);
-      },
-      // 文件上传
-      async upload () {
-        if (this.attaments.length == 0) {
-          return this.$message.warning('文件不能为空!');
-        }
-        if (!this.module) {
-          return this.$message.warning('模块名不能为空!');
-        }
-        await uploadBatch({
-          module: this.module,
-          multiPartFiles: this.attaments
-        });
-        this.$message.success('操作成功!');
-        this.dialogVisible = false;
-        this.$emit('success');
-      }
-    }
-  };
-</script>
-
-<style lang="scss">
-  .zw-table-header {
-    float: right;
-  }
-
-  .imgs-box .imgs-p {
-    height: 30px;
-    background: #f0f3f3;
-    line-height: 30px;
-    width: 372px;
-    margin-bottom: 5px;
-    padding: 0 10px;
-    display: flex;
-    justify-content: space-between;
-  }
-  .zw-criterion-normal {
-    padding: 20px 0 0 0;
-  }
-  .el-main {
-    overflow: hidden;
-  }
-</style>

+ 6 - 8
src/views/documentManagement/certificateManagement/index.vue

@@ -12,10 +12,9 @@
       >
         <!-- 工具栏 -->
         <template v-slot:toolbar>
-          <el-button type="primary" @click="handleUpload">新建</el-button>
-          <el-button type="primary" @click="handleUpload">导入</el-button>
+          <el-button type="primary" icon="el-icon-plus" @click="handleUpload">新建</el-button>
+          <!-- <el-button type="primary" @click="handleUpload">导入</el-button> -->
         </template>
-
         <template v-slot:code="{ row }">
           <el-link>2222</el-link>
           <p class="ele-text-info">身份证</p>
@@ -38,17 +37,16 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <uploadDialog ref="uploadDialogRef" @success="reload" />
+    <addDialog ref="addDialogRef" @success="reload" />
   </div>
 </template>
 
 <script>
   import { getFile, getFileList } from '@/api/system/file/index.js';
-
   import certificateSearch from './components/certificate-search';
-  import uploadDialog from './components/upload-dialog.vue';
+  import addDialog from './components/add-dialog.vue';
   export default {
-    components: { certificateSearch, uploadDialog },
+    components: { certificateSearch, addDialog },
     data () {
       return {
         columns: [
@@ -107,7 +105,7 @@
         this.$refs.table.reload({ where });
       },
       handleUpload () {
-        this.$refs.uploadDialogRef.open();
+        this.$refs.addDialogRef.open();
       },
       handleDownload (row) {
         getFile({ objectName: row.storePath }, row.name);

+ 12 - 8
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -1,6 +1,9 @@
 <template>
   <div>
-    <boat-search @search="reload">
+    <boat-search 
+      @search="reload"
+      ref="searchRef"
+    >
     </boat-search>
     <!-- 数据表格 -->
     <ele-pro-table
@@ -36,7 +39,7 @@
 
 <script>
   import BoatSearch from './boat-search.vue';
-  import { getBoatList } from '@/api/ledgerAssets';
+  import { getBoatList , downloadCategory } from '@/api/ledgerAssets';
   // import { downloadAction } from '@/api/flowable/manage';
   import dictMixins from '@/mixins/dictMixins';
   export default {
@@ -168,12 +171,13 @@
 
       // 导出
       btnExport() {
-        // downloadAction(
-        //   '/flowable/processDefinition/xml',
-        //   'get',
-        //   { processDefinitionId: row.id },
-        //   '舟皿台账'
-        // );
+        let params = {
+          ...this.$refs.searchRef.where,
+          exportType:1,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId:this.rootId
+        }
+        downloadCategory(params, '舟皿台账导出数据');
       },
     },
     watch: {

+ 2 - 1
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -195,7 +195,8 @@
         let params = {
           ...this.$refs.search.where,
           exportType:1,
-          categoryLevelId: this.categoryId
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId:this.rootId
         }
         downloadAsset(params, '设备台账导出数据');
       }

+ 19 - 3
src/views/ledgerAssets/material/components/material-list.vue

@@ -1,6 +1,9 @@
 <template>
   <div>
-    <material-search @search="reload">
+    <material-search 
+      @search="reload"
+      ref="searchRef"
+    >
     </material-search>
     <!-- 数据表格 -->
     <ele-pro-table
@@ -19,6 +22,7 @@
             type="primary"
             icon="el-icon-download"
             class="ele-btn-icon"
+            @click="btnExport"
           >
             导出
           </el-button>
@@ -36,7 +40,8 @@
 <script>
   import MaterialSearch from './material-search.vue';
   import {
-    getBoatList
+    getBoatList,
+    downloadCategory
   } from '@/api/ledgerAssets';
 
   export default {
@@ -136,7 +141,18 @@
             id
           }
         })
-      }
+      },
+      
+      // 导出
+      btnExport() {
+        let params = {
+          ...this.$refs.searchRef.where,
+          exportType:2,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId:this.rootId
+        }
+        downloadCategory(params, '原料台账导出数据');
+      },
     },
     watch: {
       // 监听类别id变化

+ 16 - 2
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -1,6 +1,7 @@
 <template>
   <div>
     <mould-search 
+      ref="searchRef"
       @search="reload"
       :isConsumer="isConsumer"
     >
@@ -23,6 +24,7 @@
            type="primary"
            icon="el-icon-download"
            class="ele-btn-icon"
+           @click="btnExport"
          >
            导出
          </el-button>
@@ -70,7 +72,8 @@
 <script>
   import MouldSearch from './mould-search.vue';
   import {
-    getAssetList
+    getAssetList,
+    downloadAsset
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   export default {
@@ -208,7 +211,18 @@
             id
           }
         })
-      }
+      },
+      
+      // 导出
+      btnExport() {
+        let params = {
+          ...this.$refs.searchRef.where,
+          exportType:3,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId:this.rootId
+        }
+        downloadAsset(params, '模具台账导出数据');
+      },
 
     },
     watch: {

+ 16 - 2
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -3,6 +3,7 @@
     <sparepart-search 
       @search="reload"
       :isConsumer="isConsumer"
+      ref="searchRef"
     >
     </sparepart-search>
     <!-- 数据表格 -->
@@ -23,6 +24,7 @@
            type="primary"
            icon="el-icon-download"
            class="ele-btn-icon"
+           @click="btnExport"
          >
            导出
          </el-button>
@@ -70,7 +72,8 @@
 <script>
   import SparepartSearch from './sparepart-search.vue';
   import {
-    getAssetList
+    getAssetList,
+    downloadAsset
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   export default {
@@ -208,7 +211,18 @@
             id
           }
         })
-      }
+      },
+      
+      // 导出
+      btnExport() {
+        let params = {
+          ...this.$refs.searchRef.where,
+          exportType:4,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId:this.rootId
+        }
+        downloadAsset(params, '备品备件台账导出数据');
+      },
 
     },
     watch: {

+ 8 - 3
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -59,7 +59,7 @@
 
 <script>
   import TurnovercarSearch from './turnovercar-search.vue';
-  import {   getAssetList   } from '@/api/ledgerAssets';
+  import {   getAssetList  , downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   // import { downloadAction } from '@/api/flowable/manage';
 
@@ -208,8 +208,13 @@
 
       // 导出
       btnExport() {
-        const obj = this.$refs.searchRef.getForm()
-
+        let params = {
+          ...this.$refs.searchRef.where,
+          exportType:2,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId:this.rootId
+        }
+        downloadAsset(params, '周转车台账导出数据');
       },
 
     },

+ 3 - 2
src/views/workforceManagement/classes/components/edit.vue

@@ -155,8 +155,9 @@
             delete this.form.id;
           }
           this.$refs.timeTable.verification().then((res) => {
-            this.loading = true;
             this.form.details = this.$refs.timeTable.form.datasource;
+            if(!this.form.details.length) return this.$message.warning('工作时间段不能为空');
+            this.loading = true;
             let fn;
             switch (this.type) {
               case 'add':
@@ -178,7 +179,7 @@
               })
               .catch((e) => {
                 this.loading = false;
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           });
         });