Browse Source

feat:[资源管理][供试品入库记录]导入

lkf
HanLong 2 months ago
parent
commit
c19ecc8f02
12 changed files with 159 additions and 4 deletions
  1. +5
    -0
      src/lang/en/business/resource/gsp.js
  2. +4
    -0
      src/lang/zh/business/resource/gsp.js
  3. +1
    -0
      src/views/business/archive/gsp/index.vue
  4. +1
    -1
      src/views/business/resource/gsp/comps/ffjl/Xq.vue
  5. +1
    -0
      src/views/business/resource/gsp/comps/gsp/Xq.vue
  6. +122
    -0
      src/views/business/resource/gsp/comps/rkjl/RkjlImport.vue
  7. +12
    -1
      src/views/business/resource/gsp/comps/rkjl/Xq.vue
  8. +9
    -2
      src/views/business/resource/gsp/comps/rkjlList.vue
  9. +1
    -0
      src/views/business/resource/yq/comps/detail.vue
  10. +1
    -0
      src/views/business/study/comp/syff/Xq.vue
  11. +1
    -0
      src/views/business/study/comp/syj/Detail.vue
  12. +1
    -0
      src/views/business/study/comp/wzlb.vue

+ 5
- 0
src/lang/en/business/resource/gsp.js View File

@ -139,4 +139,9 @@ export default {
tyjy:'Approve Check-out',
jjjy:'Reject Check-out',
qrgh:'Confirm Check-in',
xzmb: '下载模板',
wjgs: '仅允许导入xls、xlsx格式文件',
tzsc: '将文件拖到此处,或',
djsc: '点击上传',
}

+ 4
- 0
src/lang/zh/business/resource/gsp.js View File

@ -143,5 +143,9 @@ export default {
tyjy:'同意借阅',
jjjy:'拒绝借阅',
qrgh:'确认归还',
xzmb: '下载模板',
wjgs: '仅允许导入xls、xlsx格式文件',
tzsc: '将文件拖到此处,或',
djsc: '点击上传',
}

+ 1
- 0
src/views/business/archive/gsp/index.vue View File

@ -43,6 +43,7 @@ export default {
changeTab(item) {
if (this.active !== item.key) {
this.active = item.key
this.saveSimpleLog({name:this.$t(item.name,'zh_CN'),nameEn:this.$t(item.name,'en_US'),jcmc:this.$t('system.enterPage','zh_CN'),jcmcEn:this.$t('system.enterPage','en_US')})
}
},
showDetailCallback(val) {

+ 1
- 1
src/views/business/resource/gsp/comps/ffjl/Xq.vue View File

@ -8,7 +8,7 @@
</div>
<div class="right-top">
<el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
<el-button @click="exportExcel()">{{ $t('form.export') }}</el-button>
<!-- <el-button @click="exportExcel()">{{ $t('form.export') }}</el-button> -->
</div>
</div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ $t('page.business.resource.mjy.ffjlxq')

+ 1
- 0
src/views/business/resource/gsp/comps/gsp/Xq.vue View File

@ -161,6 +161,7 @@ export default {
this.$modal.loading()
exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0] }).then(response => {
window.open(process.env.VUE_APP_FILE_DOMAIN +response.msg)
this.saveSimpleLog({name:this.form.bh,nameEn:this.form.bh,jcmc:'供试品导出',jcmcEn:'Test Item Export'})
this.$modal.closeLoading()
}).finally(() => {
this.$modal.closeLoading()

+ 122
- 0
src/views/business/resource/gsp/comps/rkjl/RkjlImport.vue View File

@ -0,0 +1,122 @@
<template>
<div>
<!-- 解锁弹窗 -->
<el-dialog :title="$t('page.business.resource.gsp.dr')" :visible.sync="open" width="400px" append-to-body
:close-on-click-modal="false">
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">{{ $t('page.business.resource.gsp.tzsc') }}<em>{{ $t('page.business.resource.gsp.djsc') }}</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>{{ $t('page.business.resource.gsp.wjgs') }}</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">{{ $t('page.business.resource.gsp.xzmb') }}</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">{{ $t('form.confirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { js } from "@/api/business/gsp/gspRkjl"
import { mapGetters } from 'vuex'
import { getToken } from "@/utils/auth"
export default {
name: "Js",
data() {
return {
open: false,
form: {},
rules: {
qmrmm: [{
required: true,
message: ' ',
trigger: 'blur'
}]
},
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/business/gspRkjl/importData"
},
}
},
computed: {
...mapGetters([
'nickName'
]),
},
created() {
},
methods: {
//
importTemplate() {
this.download('business/gspRkjl/importTemplate', {
}, `【模板】供试品入库记录.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
this.getList()
},
//
submitFileForm() {
const file = this.$refs.upload.uploadFiles
if (!file || file.length === 0 || !file[0].name.toLowerCase().endsWith('.xls') && !file[0].name.toLowerCase().endsWith('.xlsx')) {
this.$modal.msgError("请选择后缀为 “xls”或“xlsx”的文件。")
return
}
this.$refs.upload.submit()
},
cancel() {
this.open = false
},
reset() {
this.form = {
id: null,
ids: null,
mc: null,
bh: null,
qmyy: this.$t('page.business.resource.gsp.jsgsprkjl'),
qmrmm: null
}
this.resetForm("form")
},
show() {
this.reset()
this.open = true
},
save() {
this.$refs["form"].validate(valid => {
if (valid) {
js(this.form).then(response => {
this.open = false
this.$emit('callback')
})
}
})
}
}
}
</script>

+ 12
- 1
src/views/business/resource/gsp/comps/rkjl/Xq.vue View File

@ -8,7 +8,7 @@
</div>
<div class="right-top">
<el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
<el-button @click="exportExcel()">{{ $t('form.export') }}</el-button>
<!-- <el-button @click="exportExcel()">{{ $t('form.export') }}</el-button> -->
</div>
</div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ $t('page.business.resource.gsp.gsprkjl')
@ -50,6 +50,17 @@
</el-input>
</div>
<div class="right">
<div class="right-title">{{ $t('page.business.resource.gsp.cctj') }}</div>
<el-input type="text" :value="form.cctj" disabled />
</div>
</div>
<div class="pal">
<div class="left">
<div class="left-title">{{ $t('page.business.resource.gsp.yxq') }}</div>
<el-input type="text" :value="form.yxq" maxlength="50" disabled>
</el-input>
</div>
<div class="right">
<div class="right-title">{{ $t('page.business.resource.gsp.zysx') }}</div>
<el-input type="text" :value="form.zysx" disabled />
</div>

+ 9
- 2
src/views/business/resource/gsp/comps/rkjlList.vue View File

@ -62,7 +62,7 @@
</el-col>
<el-col :span="1.5">
<!-- 导入 -->
<el-button type="primary" @click="handleXz" v-hasPermi="['business:resource:gsp:rkdr']">{{
<el-button type="primary" @click="handleImport" v-hasPermi="['business:resource:gsp:rkdr']">{{
$t('page.business.resource.gsp.dr') }}</el-button>
</el-col>
<el-col :span="1.5">
@ -176,6 +176,9 @@
<Bj key="Bj" ref="Bj" @callback="handleQuery" />
<!-- 新增 -->
<Xz key="Xz" ref="Xz" @callback="handleQuery" />
<!-- 导入 -->
<RkjlImport key="RkjlImport" ref="RkjlImport" @callback="handleQuery"/>
</div>
</div>
</template>
@ -190,11 +193,12 @@ import Jd from "./rkjl/Jd";
import Xq from "./rkjl/Xq";
import Xz from "./rkjl/Xz";
import Bj from "./rkjl/Bj";
import RkjlImport from "./rkjl/RkjlImport"
import { deepClone } from "@/utils/index";
import { mapGetters } from 'vuex'
export default {
name: "FfjlList",
components: { Sd, Js, Gd, Jd, Jy, Xq, Xz, Bj },
components: { Sd, Js, Gd, Jd, Jy, Xq, Xz, Bj, RkjlImport },
data() {
return {
daterangeCk: [],
@ -232,6 +236,9 @@ export default {
this.getList()
},
methods: {
handleImport() {
this.$refs.RkjlImport.show()
},
//
exportExcel() {
let that = this

+ 1
- 0
src/views/business/resource/yq/comps/detail.vue View File

@ -129,6 +129,7 @@ export default {
this.form = response.data
this.open = true
})
this.saveSimpleLog({name:row.bh,nameEn:row.bh,jcmc:'仪器详情',jcmcEn:'Instrument Detail'})
this.queryParams.id = row.id
yqJcgj_list(this.queryParams).then((response) => {
this.qmList = response.rows

+ 1
- 0
src/views/business/study/comp/syff/Xq.vue View File

@ -176,6 +176,7 @@ export default {
studyMethod_export({ studyMethodId: this.form.id }).then(response => {
let fileUrl = response.data.fileUrl
this.$download.saveAs(process.env.VUE_APP_FILE_DOMAIN + fileUrl, this.form.ffmc + ".pdf");
this.saveSimpleLog({name:this.form.ffmc,nameEn:this.form.ffmc,jcmc:'方法导出',jcmcEn:'Method Export'})
})
}

+ 1
- 0
src/views/business/study/comp/syj/Detail.vue View File

@ -142,6 +142,7 @@ export default {
studyRoom_info({ id: row.id }).then(response => {
this.form = response.data
this.open = true
this.saveSimpleLog({name:row.syjh,nameEn:row.syjh,jcmc:'饲养间详情',jcmcEn:'Animal Room Detail'})
}).finally(() => {
this.$modal.closeLoading()
})

+ 1
- 0
src/views/business/study/comp/wzlb.vue View File

@ -114,6 +114,7 @@ export default {
changeTab(item) {
if (this.active !== item.key) {
this.active = item.key
this.saveSimpleLog({name:this.$t(item.name,'zh_CN'),nameEn:this.$t(item.name,'en_US'),jcmc:this.$t('system.enterPage','zh_CN'),jcmcEn:this.$t('system.enterPage','en_US')})
}
}
}

Loading…
Cancel
Save