|
|
@@ -8,32 +8,28 @@
|
|
|
v-show="showSearch"
|
|
|
label-width="100px"
|
|
|
>
|
|
|
-<!-- <el-form-item label="物资编码" prop="materialsCode">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- v-model="queryParams.materialsCode"-->
|
|
|
-<!-- placeholder="请输入物资编码"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- @keyup.enter.native="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="物资名称" prop="materialsName">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- v-model="queryParams.materialsName"-->
|
|
|
-<!-- placeholder="请输入物资名称"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- @keyup.enter.native="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="状态" prop="loanState">-->
|
|
|
-<!-- <el-select v-model="queryParams.loanState" placeholder="状态">-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="dict in dict.type.material_status"-->
|
|
|
-<!-- :key="dict.value"-->
|
|
|
-<!-- :label="dict.label"-->
|
|
|
-<!-- :value="dict.value"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-select>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
+ <el-form-item label="物资柜" prop="materialsCabinetId">
|
|
|
+ <el-select
|
|
|
+ style="width: 215px"
|
|
|
+ v-model="queryParams.materialsCabinetId"
|
|
|
+ placeholder="请选择物资柜"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in cabinets"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物资名称" prop="materialsName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.materialsName"
|
|
|
+ placeholder="请输入物资名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="物资类型" prop="materialsTypeId">
|
|
|
<treeselect
|
|
|
style="width: 200px"
|
|
|
@@ -43,6 +39,14 @@
|
|
|
placeholder="请选择物资类型"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="RFID" prop="materialsRfid">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.materialsRfid"
|
|
|
+ placeholder="请输入RFID"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="供应商" prop="supplier">
|
|
|
<el-input
|
|
|
v-model="queryParams.supplier"
|
|
|
@@ -51,8 +55,10 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="有效期" prop="">
|
|
|
+ <el-form-item label="有效期" prop="">
|
|
|
<el-date-picker
|
|
|
+ style="width: 215px"
|
|
|
+ :default-time="['00:00:00', '23:59:59']"
|
|
|
v-model="createTime"
|
|
|
type="datetimerange"
|
|
|
:picker-options="pickerOptions"
|
|
|
@@ -63,20 +69,16 @@
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
-<!-- <el-form-item label="所属柜" prop="materialsCabinetId">-->
|
|
|
-<!-- <el-select-->
|
|
|
-<!-- style="width: 215px"-->
|
|
|
-<!-- v-model="queryParams.materialsCabinetId"-->
|
|
|
-<!-- placeholder="请选择所属柜"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="dict in cabinets"-->
|
|
|
-<!-- :key="dict.value"-->
|
|
|
-<!-- :label="dict.label"-->
|
|
|
-<!-- :value="dict.value"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-select>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
+ <el-form-item label="状态" prop="loanState">
|
|
|
+ <el-select v-model="queryParams.loanState" placeholder="状态">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.material_status"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
@@ -85,14 +87,16 @@
|
|
|
icon="el-icon-search"
|
|
|
size="mini"
|
|
|
@click="handleQuery"
|
|
|
- >搜索</el-button
|
|
|
+ >搜索
|
|
|
+ </el-button
|
|
|
>
|
|
|
<el-button
|
|
|
v-no-more-click
|
|
|
icon="el-icon-refresh"
|
|
|
size="mini"
|
|
|
@click="resetQuery"
|
|
|
- >重置</el-button
|
|
|
+ >重置
|
|
|
+ </el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -107,7 +111,7 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['iscs:materials:add']"
|
|
|
- >新增
|
|
|
+ >新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -120,7 +124,7 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['iscs:materials:remove']"
|
|
|
- >批量删除
|
|
|
+ >批量删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -132,7 +136,8 @@
|
|
|
size="mini"
|
|
|
@click="handleImport"
|
|
|
v-hasPermi="['iscs:materials:import']"
|
|
|
- >导入</el-button
|
|
|
+ >导入
|
|
|
+ </el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<right-toolbar
|
|
|
@@ -146,19 +151,35 @@
|
|
|
:data="materialsList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
-<!-- <el-table-column label="物资编码" align="center" prop="materialsCode">-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
- <el-table-column label="物资名称" align="center" prop="materialsName" />
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="物资编号" align="center" prop="materialsId">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物资名称" align="center" prop="materialsName"/>
|
|
|
<el-table-column
|
|
|
label="物资类型"
|
|
|
align="center"
|
|
|
prop="materialsTypeName"
|
|
|
/>
|
|
|
- <el-table-column label="物资RFID" align="center" prop="materialsRfid" />
|
|
|
- <el-table-column label="所属柜" align="center" prop="cabinetName" />
|
|
|
+ <el-table-column
|
|
|
+ label="物资图片"
|
|
|
+ align="center"
|
|
|
+ prop="materialsTypePicture"
|
|
|
+
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <img
|
|
|
+ v-if="scope.row.materialsTypePicture"
|
|
|
+ :src="scope.row.materialsTypePicture"
|
|
|
+ alt=""
|
|
|
+ style="width: 50px; height: 50px"
|
|
|
+ />
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="RFID" align="center" prop="materialsRfid"/>
|
|
|
<el-table-column label="供应商" align="center" prop="supplier">
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column label="所属柜" align="center" prop="cabinetName" />-->
|
|
|
<el-table-column label="有效期" align="center" prop="expirationDate">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.expirationDate }}
|
|
|
@@ -166,12 +187,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="状态" align="center" prop="loanState">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.loanState == 0 ? "借出" : "柜中" }}</span>
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.material_status"
|
|
|
+ :value="scope.row.loanState"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
-<!-- <el-table-column label="创建时间" align="center" prop="createTime">-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
@@ -185,7 +206,7 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['iscs:materials:edit']"
|
|
|
- >编辑
|
|
|
+ >编辑
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-no-more-click
|
|
|
@@ -194,7 +215,7 @@
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['iscs:materials:remove']"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -237,7 +258,7 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="物资RFID" prop="materialsRfid">
|
|
|
+ <el-form-item label="RFID" prop="materialsRfid">
|
|
|
<el-input
|
|
|
v-model="form.materialsRfid"
|
|
|
placeholder="请输入物资RFID(纯数字)"
|
|
|
@@ -247,7 +268,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="所属柜" prop="materialsCabinetId">
|
|
|
+ <el-form-item label="物资柜" prop="materialsCabinetId">
|
|
|
<el-select
|
|
|
style="width: 348px"
|
|
|
v-model="form.materialsCabinetId"
|
|
|
@@ -264,7 +285,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
-
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="供应商" prop="supplier">
|
|
|
<el-input
|
|
|
@@ -283,47 +303,47 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-<!-- <el-form-item label="可用寿命" prop="serviceLife">-->
|
|
|
-<!-- -->
|
|
|
-<!-- <el-date-picker-->
|
|
|
-<!-- v-model="form.serviceLife"-->
|
|
|
-<!-- type="date"-->
|
|
|
-<!-- placeholder="选择日期"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- </el-date-picker>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
- <!-- <el-form-item label="可用次数" prop="serviceTimes">-->
|
|
|
- <!-- <el-input v-model="form.serviceTimes" placeholder="" disabled />-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- <el-row>-->
|
|
|
- <!-- <el-col :span="12">-->
|
|
|
- <!-- <el-form-item label="启用日期" prop="startTime">-->
|
|
|
- <!-- <el-input v-model="form.startTime" placeholder="" disabled />-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-col>-->
|
|
|
- <!-- <el-col :span="12">-->
|
|
|
- <!-- <el-form-item label="物资剩余次数" prop="availableTimes">-->
|
|
|
- <!-- <el-input-->
|
|
|
- <!-- v-model="form.availableTimes"-->
|
|
|
- <!-- placeholder="请输入物资剩余次数"-->
|
|
|
- <!-- />-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-col>-->
|
|
|
- <!-- </el-row>-->
|
|
|
- <!-- <el-form-item label="物资编码" prop="materialsCode">-->
|
|
|
- <!-- <el-input-->
|
|
|
- <!-- v-model="form.materialsCode"-->
|
|
|
- <!-- placeholder="请输入物资编码"-->
|
|
|
- <!-- style="width: 200px; margin-right: 10px"-->
|
|
|
- <!-- />-->
|
|
|
- <!-- <el-switch-->
|
|
|
- <!-- v-model="autoGenFlag"-->
|
|
|
- <!-- active-color="#13ce66"-->
|
|
|
- <!-- active-text="自动生成"-->
|
|
|
- <!-- @change="handleAutoGenChange(autoGenFlag)"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- </el-switch>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
+ <!-- <el-form-item label="可用寿命" prop="serviceLife">-->
|
|
|
+ <!-- -->
|
|
|
+ <!-- <el-date-picker-->
|
|
|
+ <!-- v-model="form.serviceLife"-->
|
|
|
+ <!-- type="date"-->
|
|
|
+ <!-- placeholder="选择日期"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </el-date-picker>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- <el-form-item label="可用次数" prop="serviceTimes">-->
|
|
|
+ <!-- <el-input v-model="form.serviceTimes" placeholder="" disabled />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col :span="12">-->
|
|
|
+ <!-- <el-form-item label="启用日期" prop="startTime">-->
|
|
|
+ <!-- <el-input v-model="form.startTime" placeholder="" disabled />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- <el-col :span="12">-->
|
|
|
+ <!-- <el-form-item label="物资剩余次数" prop="availableTimes">-->
|
|
|
+ <!-- <el-input-->
|
|
|
+ <!-- v-model="form.availableTimes"-->
|
|
|
+ <!-- placeholder="请输入物资剩余次数"-->
|
|
|
+ <!-- />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
+ <!-- <el-form-item label="物资编码" prop="materialsCode">-->
|
|
|
+ <!-- <el-input-->
|
|
|
+ <!-- v-model="form.materialsCode"-->
|
|
|
+ <!-- placeholder="请输入物资编码"-->
|
|
|
+ <!-- style="width: 200px; margin-right: 10px"-->
|
|
|
+ <!-- />-->
|
|
|
+ <!-- <el-switch-->
|
|
|
+ <!-- v-model="autoGenFlag"-->
|
|
|
+ <!-- active-color="#13ce66"-->
|
|
|
+ <!-- active-text="自动生成"-->
|
|
|
+ <!-- @change="handleAutoGenChange(autoGenFlag)"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </el-switch>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
@@ -335,10 +355,12 @@
|
|
|
type="primary"
|
|
|
@click="cancel"
|
|
|
v-if="optType == 'view'"
|
|
|
- >返回</el-button
|
|
|
+ >返回
|
|
|
+ </el-button
|
|
|
>
|
|
|
<el-button v-no-more-click type="primary" @click="submitForm" v-else
|
|
|
- >确 定</el-button
|
|
|
+ >确 定
|
|
|
+ </el-button
|
|
|
>
|
|
|
<el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
@@ -351,7 +373,6 @@
|
|
|
width="400px"
|
|
|
append-to-body
|
|
|
>
|
|
|
-<!-- -->
|
|
|
<el-upload
|
|
|
ref="upload"
|
|
|
:limit="1"
|
|
|
@@ -368,7 +389,7 @@
|
|
|
<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" />
|
|
|
+ <el-checkbox v-model="upload.updateSupport"/>
|
|
|
是否更新已经存在的用户数据
|
|
|
</div>
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
@@ -377,16 +398,19 @@
|
|
|
:underline="false"
|
|
|
style="font-size: 12px; vertical-align: baseline"
|
|
|
@click="importTemplate"
|
|
|
- >下载模板</el-link
|
|
|
+ >下载模板
|
|
|
+ </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
|
|
|
>
|
|
|
<el-button v-no-more-click @click="upload.open = false"
|
|
|
- >取 消</el-button
|
|
|
+ >取 消
|
|
|
+ </el-button
|
|
|
>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -400,21 +424,22 @@ import {
|
|
|
updateMaterials,
|
|
|
deleteMaterials,
|
|
|
selectMaterialsById,
|
|
|
- getIsMaterialsCabinets,
|
|
|
-} from "@/api/mes/material/information";
|
|
|
-import { listType } from "@/api/mes/material/typeindex";
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
-import { genCode } from "@/api/system/autocode/rule";
|
|
|
-import Template from "@/views/print/printtemplate/list.vue";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
+ getIsMaterialsCabinets
|
|
|
+} from '@/api/mes/material/information'
|
|
|
+import { listType } from '@/api/mes/material/typeindex'
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
+import { genCode } from '@/api/system/autocode/rule'
|
|
|
+import Template from '@/views/print/printtemplate/list.vue'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
+
|
|
|
export default {
|
|
|
- name: "Team",
|
|
|
+ name: 'Team',
|
|
|
components: {
|
|
|
Template,
|
|
|
- Treeselect,
|
|
|
+ Treeselect
|
|
|
},
|
|
|
- dicts: ["material_status"],
|
|
|
+ dicts: ['material_status'],
|
|
|
data() {
|
|
|
return {
|
|
|
//自动生成编码
|
|
|
@@ -436,77 +461,78 @@ export default {
|
|
|
// 班组表格数据
|
|
|
materialsList: [],
|
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
+ title: '',
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
|
|
|
// 查询参数
|
|
|
- createTime: "",
|
|
|
+ createTime: '',
|
|
|
queryParams: {
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
materialsCode: null,
|
|
|
materialsName: null,
|
|
|
+ materialsRfid:null,
|
|
|
loanState: null,
|
|
|
materialsCabinetId: null,
|
|
|
materialsTypeId: null,
|
|
|
- startExpirationDate: "",
|
|
|
- endExpirationDate: "",
|
|
|
+ startExpirationDate: '',
|
|
|
+ endExpirationDate: '',
|
|
|
supplier: null,
|
|
|
- expirationDate: null,
|
|
|
+ expirationDate: null
|
|
|
},
|
|
|
|
|
|
// 查询参数
|
|
|
queryParamsCabinets: {
|
|
|
current: 1,
|
|
|
- size: -1,
|
|
|
+ size: -1
|
|
|
},
|
|
|
pickerOptions: {
|
|
|
shortcuts: [
|
|
|
{
|
|
|
- text: "最近一周",
|
|
|
+ text: '最近一周',
|
|
|
onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
- },
|
|
|
+ const end = new Date()
|
|
|
+ const start = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
+ picker.$emit('pick', [start, end])
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- text: "最近一个月",
|
|
|
+ text: '最近一个月',
|
|
|
onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
- },
|
|
|
+ const end = new Date()
|
|
|
+ const start = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
|
+ picker.$emit('pick', [start, end])
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- text: "最近三个月",
|
|
|
+ text: '最近三个月',
|
|
|
onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
+ const end = new Date()
|
|
|
+ const start = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
|
|
+ picker.$emit('pick', [start, end])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
// 用户导入参数
|
|
|
upload: {
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
open: false,
|
|
|
// 弹出层标题(用户导入)
|
|
|
- title: "",
|
|
|
+ title: '',
|
|
|
// 是否禁用上传
|
|
|
isUploading: false,
|
|
|
// 是否更新已经存在的用户数据
|
|
|
updateSupport: 0,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ headers: { Authorization: 'Bearer ' + getToken() },
|
|
|
// 上传的地址
|
|
|
// url: process.env.VUE_APP_BASE_API + "/iscs/materials/importMaterials",
|
|
|
- url:process.env.VUE_APP_BASE_API + "/common/upload",
|
|
|
+ url: process.env.VUE_APP_BASE_API + '/common/upload'
|
|
|
},
|
|
|
|
|
|
// 表单参数
|
|
|
@@ -514,146 +540,141 @@ export default {
|
|
|
cabinets: [], //物资所属柜
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- materialsCode: [
|
|
|
- { required: true, message: "物资编码不能为空", trigger: "blur" },
|
|
|
- ],
|
|
|
materialsName: [
|
|
|
- { required: true, message: "物资名称不能为空", trigger: "blur" },
|
|
|
+ { required: true, message: '物资名称不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
- materialsTypeId:[
|
|
|
- { required: true, message: "物资类型不能为空", trigger: "blur" },
|
|
|
+ materialsTypeId: [
|
|
|
+ { required: true, message: '物资类型不能为空', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
|
|
|
- machinerytypeOptions: [],
|
|
|
- };
|
|
|
+ machinerytypeOptions: []
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
- this.getTreeselect();
|
|
|
+ this.getList()
|
|
|
+ this.getTreeselect()
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.materialsCabinets();
|
|
|
+ this.materialsCabinets()
|
|
|
},
|
|
|
methods: {
|
|
|
- formatDateserviceLife(dateString) {
|
|
|
- const date = new Date(dateString);
|
|
|
- const year = date.getFullYear();
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
|
- const day = String(date.getDate()).padStart(2, "0");
|
|
|
- return `${year}-${month}-${day}`;
|
|
|
- },
|
|
|
+
|
|
|
/** 转换数据结构 */
|
|
|
normalizer(node) {
|
|
|
if (node.children && !node.children.length) {
|
|
|
- delete node.children;
|
|
|
+ delete node.children
|
|
|
}
|
|
|
return {
|
|
|
id: node.materialsTypeId,
|
|
|
label: node.materialsTypeName,
|
|
|
- children: node.children,
|
|
|
- };
|
|
|
+ children: node.children
|
|
|
+ }
|
|
|
},
|
|
|
/** 查询物资类型下拉树结构 */
|
|
|
getTreeselect() {
|
|
|
const data = {
|
|
|
current: 1,
|
|
|
- size: 99999,
|
|
|
- };
|
|
|
+ size: 99999
|
|
|
+ }
|
|
|
|
|
|
listType(data).then((response) => {
|
|
|
this.machinerytypeOptions = this.handleTree(
|
|
|
response.data.records,
|
|
|
- "materialsTypeId",
|
|
|
- "parentId",
|
|
|
- "children"
|
|
|
- );
|
|
|
- });
|
|
|
+ 'materialsTypeId',
|
|
|
+ 'parentId',
|
|
|
+ 'children'
|
|
|
+ )
|
|
|
+ })
|
|
|
},
|
|
|
// 格式化日期查询数据
|
|
|
formatDate(date) {
|
|
|
if (date && date instanceof Date && !isNaN(date)) {
|
|
|
// 使用本地时间
|
|
|
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(
|
|
|
- 2,
|
|
|
- "0"
|
|
|
- )}-${String(date.getDate()).padStart(2, "0")}`;
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
+ const hours = String(date.getHours()).padStart(2, '0');
|
|
|
+ const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
+ const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
}
|
|
|
return null;
|
|
|
},
|
|
|
/** 查询物资信息列表 */
|
|
|
getList() {
|
|
|
- this.loading = true;
|
|
|
+ this.loading = true
|
|
|
// 格式化日期并更新 queryParams
|
|
|
- console.log(this.createTime,'this.createTime')
|
|
|
+ console.log(this.createTime, 'this.createTime')
|
|
|
if (Array.isArray(this.createTime) && this.createTime.length === 2) {
|
|
|
- this.queryParams.startExpirationDate = this.formatDate(this.createTime[0]);
|
|
|
- this.queryParams.endExpirationDate = this.formatDate(this.createTime[1]);
|
|
|
+ this.queryParams.startExpirationDate = this.formatDate(this.createTime[0])
|
|
|
+ this.queryParams.endExpirationDate = this.formatDate(this.createTime[1])
|
|
|
}
|
|
|
|
|
|
listMaterials(this.queryParams).then((response) => {
|
|
|
- console.log(response, "获取物资信息allList ");
|
|
|
- this.materialsList = response.data.records;
|
|
|
- this.total = response.data.total;
|
|
|
+ console.log(response, '获取物资信息allList ')
|
|
|
+ this.materialsList = response.data.records
|
|
|
+ this.total = response.data.total
|
|
|
this.machinerytypeList = this.handleTree(
|
|
|
response.data.records,
|
|
|
- "materialsTypeId",
|
|
|
- "parentId",
|
|
|
- "children"
|
|
|
- );
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ 'materialsTypeId',
|
|
|
+ 'parentId',
|
|
|
+ 'children'
|
|
|
+ )
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
//图片上传成功
|
|
|
handleImgUplaoded(imgUrl) {
|
|
|
- this.form.sipUrl = imgUrl;
|
|
|
+ this.form.sipUrl = imgUrl
|
|
|
},
|
|
|
//图片移除
|
|
|
handleImgRemoved(imgUrl) {
|
|
|
- this.form.sipUrl = null;
|
|
|
+ this.form.sipUrl = null
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- materialsName: "",
|
|
|
- createTime: "",
|
|
|
- materialsTypeId: "",
|
|
|
- materialsCabinetId: "",
|
|
|
- expirationDate: "",
|
|
|
- supplier:""
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- this.autoGenFlag = false;
|
|
|
+ materialsName: '',
|
|
|
+ createTime: '',
|
|
|
+ materialsTypeId: '',
|
|
|
+ materialsCabinetId: '',
|
|
|
+ expirationDate: '',
|
|
|
+ supplier: '',
|
|
|
+ }
|
|
|
+ this.resetForm('form')
|
|
|
+ this.autoGenFlag = false
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
-
|
|
|
- this.getList();
|
|
|
+ this.getList()
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.createTime = "";
|
|
|
- this.queryParams.materialsCode = null;
|
|
|
- this.queryParams.materialsName = null;
|
|
|
- this.queryParams.loanState = null;
|
|
|
- this.queryParams.materialsCabinetId = null;
|
|
|
- this.queryParams.materialsTypeId = null;
|
|
|
- this.queryParams.startTime = "";
|
|
|
- this.queryParams.endTime = "";
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
+ this.createTime = ''
|
|
|
+ this.queryParams.materialsCode = null
|
|
|
+ this.queryParams.materialsName = null
|
|
|
+ this.queryParams.loanState = null
|
|
|
+ this.queryParams.materialsCabinetId = null
|
|
|
+ this.queryParams.materialsTypeId = null
|
|
|
+ this.queryParams.startExpirationDate = null
|
|
|
+ this.queryParams.endExpirationDate = null
|
|
|
+ this.queryParams.materialsRfid = null
|
|
|
+ this.queryParams.supplier = null
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map((item) => item.materialsId);
|
|
|
- this.codes = selection.map((item) => item.materialsName);
|
|
|
- this.single = selection.length !== 1;
|
|
|
- this.multiple = !selection.length;
|
|
|
+ this.ids = selection.map((item) => item.materialsId)
|
|
|
+ this.codes = selection.map((item) => item.materialsName)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
},
|
|
|
|
|
|
// 物资所属柜
|
|
|
@@ -663,140 +684,140 @@ export default {
|
|
|
// 提取 cabinetId 和 cabinetName
|
|
|
this.cabinets = response.data.records.map((item) => ({
|
|
|
value: item.cabinetId,
|
|
|
- label: item.cabinetName,
|
|
|
- }));
|
|
|
+ label: item.cabinetName
|
|
|
+ }))
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "新增物资信息";
|
|
|
- this.optType = "add";
|
|
|
- this.form.materialsTypeId = undefined;
|
|
|
+ this.reset()
|
|
|
+ this.open = true
|
|
|
+ this.title = '新增物资信息'
|
|
|
+ this.optType = 'add'
|
|
|
+ this.form.materialsTypeId = undefined
|
|
|
},
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
+ this.reset()
|
|
|
selectMaterialsById(row.materialsId).then((response) => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "编辑物资信息";
|
|
|
- this.optType = "edit";
|
|
|
- });
|
|
|
+ this.form = response.data
|
|
|
+ this.open = true
|
|
|
+ this.title = '编辑物资信息'
|
|
|
+ this.optType = 'edit'
|
|
|
+ })
|
|
|
},
|
|
|
// 导入按钮操作
|
|
|
|
|
|
/** 导入按钮操作 */
|
|
|
handleImport() {
|
|
|
- this.upload.title = "物资导入";
|
|
|
- this.upload.open = true;
|
|
|
+ this.upload.title = '物资导入'
|
|
|
+ this.upload.open = true
|
|
|
},
|
|
|
/** 下载模板操作 */
|
|
|
importTemplate() {
|
|
|
this.download(
|
|
|
- "iscs/materials/importTemplate",
|
|
|
+ 'iscs/materials/importTemplate',
|
|
|
{},
|
|
|
`md_item_template${new Date().getTime()}.xlsx`
|
|
|
- );
|
|
|
+ )
|
|
|
},
|
|
|
// 文件上传中处理
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
- this.upload.isUploading = true;
|
|
|
+ this.upload.isUploading = true
|
|
|
},
|
|
|
// 文件上传成功处理
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
- this.upload.open = false;
|
|
|
- this.upload.isUploading = false;
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
+ 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>",
|
|
|
- "导入结果",
|
|
|
+ '<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' +
|
|
|
+ response.msg +
|
|
|
+ '</div>',
|
|
|
+ '导入结果',
|
|
|
{ dangerouslyUseHTMLString: true }
|
|
|
- );
|
|
|
- this.getList();
|
|
|
+ )
|
|
|
+ this.getList()
|
|
|
},
|
|
|
// 提交上传文件
|
|
|
submitFileForm() {
|
|
|
- this.$refs.upload.submit();
|
|
|
+ this.$refs.upload.submit()
|
|
|
},
|
|
|
// 有效期参数转换时间类型
|
|
|
formatDateExpirationDate(dateString) {
|
|
|
- const date = new Date(dateString);
|
|
|
-
|
|
|
- const year = date.getFullYear();
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并且补零
|
|
|
- const day = String(date.getDate()).padStart(2, '0'); // 补零
|
|
|
+ const date = new Date(dateString)
|
|
|
+ const year = date.getFullYear()
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,需要加1,并且补零
|
|
|
+ const day = String(date.getDate()).padStart(2, '0') // 补零
|
|
|
|
|
|
- return `${year}-${month}-${day}`;
|
|
|
+ return `${year}-${month}-${day}`
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.materialsId != null) {
|
|
|
updateMaterials(this.form).then((response) => {
|
|
|
- console.log(response, "修改返回");
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ console.log(response, '修改返回')
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.form.expirationDate=this.formatDateExpirationDate(this.form.expirationDate)
|
|
|
- console.log(this.form,'新增参数');
|
|
|
+ this.form.expirationDate = this.formatDateExpirationDate(this.form.expirationDate)
|
|
|
+ console.log(this.form, '新增参数')
|
|
|
addMaterials(this.form).then((response) => {
|
|
|
- console.log(response, "新增返回");
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ console.log(response, '新增返回')
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const materialsIds = row.materialsId || this.ids;
|
|
|
- const materialsCodes = row.materialsName || this.codes;
|
|
|
+ const materialsIds = row.materialsId || this.ids
|
|
|
+ const materialsCodes = row.materialsName || this.codes
|
|
|
this.$modal
|
|
|
.confirm('是否确认删除编号为"' + materialsCodes + '"的数据项?')
|
|
|
- .then(function () {
|
|
|
- return deleteMaterials(materialsIds);
|
|
|
+ .then(function() {
|
|
|
+ return deleteMaterials(materialsIds)
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
+ this.getList()
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
this.download(
|
|
|
- "cal/team/export",
|
|
|
+ 'cal/team/export',
|
|
|
{
|
|
|
- ...this.queryParams,
|
|
|
+ ...this.queryParams
|
|
|
},
|
|
|
`team_${new Date().getTime()}.xlsx`
|
|
|
- );
|
|
|
+ )
|
|
|
},
|
|
|
|
|
|
//自动生成编码
|
|
|
handleAutoGenChange(autoGenFlag) {
|
|
|
if (autoGenFlag) {
|
|
|
- genCode("MATERIALS_CODE").then((response) => {
|
|
|
- this.form.materialsCode = response;
|
|
|
- });
|
|
|
+ genCode('MATERIALS_CODE').then((response) => {
|
|
|
+ this.form.materialsCode = response
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.form.materialsCode = null;
|
|
|
+ this.form.materialsCode = null
|
|
|
}
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
|
|
|
.el-input-width {
|