|
@@ -115,6 +115,18 @@
|
|
|
>批量删除
|
|
>批量删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleImport"
|
|
|
|
|
+ v-hasPermi="['iscs:materials:import']"
|
|
|
|
|
+ >导入</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-col>
|
|
|
<right-toolbar
|
|
<right-toolbar
|
|
|
:showSearch.sync="showSearch"
|
|
:showSearch.sync="showSearch"
|
|
|
@queryTable="getList"
|
|
@queryTable="getList"
|
|
@@ -135,15 +147,11 @@
|
|
|
align="center"
|
|
align="center"
|
|
|
prop="materialsTypeName"
|
|
prop="materialsTypeName"
|
|
|
/>
|
|
/>
|
|
|
- <el-table-column
|
|
|
|
|
- label="物资RFID"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="materialsRfid"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-table-column label="物资RFID" align="center" prop="materialsRfid" />
|
|
|
<el-table-column label="所属柜" align="center" prop="cabinetName" />
|
|
<el-table-column label="所属柜" align="center" prop="cabinetName" />
|
|
|
- <el-table-column label="可用寿命" align="center" prop="serviceLife" >
|
|
|
|
|
|
|
+ <el-table-column label="可用寿命" align="center" prop="serviceLife">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{formatDateserviceLife(scope.row.serviceLife)}}
|
|
|
|
|
|
|
+ {{ formatDateserviceLife(scope.row.serviceLife) }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="物资状态" align="center" prop="loanState">
|
|
<el-table-column label="物资状态" align="center" prop="loanState">
|
|
@@ -272,30 +280,30 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="可用寿命" prop="serviceLife">
|
|
<el-form-item label="可用寿命" prop="serviceLife">
|
|
|
-<!-- <el-input-->
|
|
|
|
|
-<!-- v-model="form.serviceLife"-->
|
|
|
|
|
-<!-- placeholder="请输入可用寿命"-->
|
|
|
|
|
-<!-- />-->
|
|
|
|
|
|
|
+ <!-- <el-input-->
|
|
|
|
|
+ <!-- v-model="form.serviceLife"-->
|
|
|
|
|
+ <!-- placeholder="请输入可用寿命"-->
|
|
|
|
|
+ <!-- />-->
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
v-model="form.serviceLife"
|
|
v-model="form.serviceLife"
|
|
|
type="date"
|
|
type="date"
|
|
|
- placeholder="选择日期">
|
|
|
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="物资RFID" prop="materialsRfid">
|
|
|
|
|
|
|
+ <el-form-item label="物资RFID" prop="materialsRfid">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.materialsRfid"
|
|
v-model="form.materialsRfid"
|
|
|
placeholder="请输入物资RFID(纯数字)"
|
|
placeholder="请输入物资RFID(纯数字)"
|
|
|
maxlength="128"
|
|
maxlength="128"
|
|
|
- oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
|
|
|
|
+ oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
-
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
@@ -313,6 +321,52 @@
|
|
|
<el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
<el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 物资导入对话框 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ :title="upload.title"
|
|
|
|
|
+ :visible.sync="upload.open"
|
|
|
|
|
+ width="400px"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <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">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
|
|
+ <div class="el-upload__tip" slot="tip">
|
|
|
|
|
+ <el-checkbox v-model="upload.updateSupport" />
|
|
|
|
|
+ 是否更新已经存在的用户数据
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ style="font-size: 12px; vertical-align: baseline"
|
|
|
|
|
+ @click="importTemplate"
|
|
|
|
|
+ >下载模板</el-link
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button v-no-more-click type="primary" @click="submitFileForm"
|
|
|
|
|
+ >确 定</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button v-no-more-click @click="upload.open = false"
|
|
|
|
|
+ >取 消</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -329,8 +383,8 @@ import { listType } from "@/api/mes/material/typeindex";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import { genCode } from "@/api/system/autocode/rule";
|
|
import { genCode } from "@/api/system/autocode/rule";
|
|
|
-import Template from '@/views/print/printtemplate/list.vue'
|
|
|
|
|
-
|
|
|
|
|
|
|
+import Template from "@/views/print/printtemplate/list.vue";
|
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
export default {
|
|
export default {
|
|
|
name: "Team",
|
|
name: "Team",
|
|
|
components: {
|
|
components: {
|
|
@@ -413,6 +467,21 @@ export default {
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
|
|
|
+ // 用户导入参数
|
|
|
|
|
+ upload: {
|
|
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
|
|
+ title: "",
|
|
|
|
|
+ // 是否禁用上传
|
|
|
|
|
+ isUploading: false,
|
|
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
|
|
+ updateSupport: 0,
|
|
|
|
|
+ // 设置上传的请求头部
|
|
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
+ // 上传的地址
|
|
|
|
|
+ url: process.env.VUE_APP_BASE_API + "iscs/materials/importMaterials",
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
@@ -441,8 +510,8 @@ export default {
|
|
|
formatDateserviceLife(dateString) {
|
|
formatDateserviceLife(dateString) {
|
|
|
const date = new Date(dateString);
|
|
const date = new Date(dateString);
|
|
|
const year = date.getFullYear();
|
|
const year = date.getFullYear();
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
- const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
|
|
|
+ const day = String(date.getDate()).padStart(2, "0");
|
|
|
return `${year}-${month}-${day}`;
|
|
return `${year}-${month}-${day}`;
|
|
|
},
|
|
},
|
|
|
/** 转换数据结构 */
|
|
/** 转换数据结构 */
|
|
@@ -589,6 +658,47 @@ export default {
|
|
|
this.optType = "edit";
|
|
this.optType = "edit";
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 导入按钮操作
|
|
|
|
|
+ /** 导入按钮操作 */
|
|
|
|
|
+ handleImport() {
|
|
|
|
|
+ this.upload.title = "物资信息导入";
|
|
|
|
|
+ this.upload.open = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 导入按钮操作 */
|
|
|
|
|
+ handleImport() {
|
|
|
|
|
+ this.upload.title = "物资导入";
|
|
|
|
|
+ this.upload.open = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 下载模板操作 */
|
|
|
|
|
+ importTemplate() {
|
|
|
|
|
+ this.download(
|
|
|
|
|
+ "iscs/materials/importTemplate",
|
|
|
|
|
+ {},
|
|
|
|
|
+ `md_item_template${new Date().getTime()}.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() {
|
|
|
|
|
+ this.$refs.upload.submit();
|
|
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
this.$refs["form"].validate((valid) => {
|