|
@@ -53,47 +53,46 @@
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<!-- deptCCO 区域的图标 -->
|
|
<!-- deptCCO 区域的图标 -->
|
|
|
- <img
|
|
|
|
|
- v-for="(cabinet, index) in COCOTicketListPage"
|
|
|
|
|
- :key="cabinet.cabinetId"
|
|
|
|
|
- :style="{
|
|
|
|
|
- width: '35px',
|
|
|
|
|
- height: '35px',
|
|
|
|
|
- position: 'absolute',
|
|
|
|
|
- cursor: 'pointer',
|
|
|
|
|
- // 图标垂直居中
|
|
|
|
|
- top: `${deptCCOCenter.top - 53}px`,
|
|
|
|
|
- // 图标水平居中,动态计算偏移
|
|
|
|
|
- left: `${
|
|
|
|
|
- deptCCOCenter.left -
|
|
|
|
|
- (COCOTicketListPage.length * 35 +
|
|
|
|
|
- (COCOTicketListPage.length - 1) * 5) /
|
|
|
|
|
- 2 +
|
|
|
|
|
- index * 40
|
|
|
|
|
- }px`,
|
|
|
|
|
- }"
|
|
|
|
|
- :src="require('@/assets/images/table_map2.jpg')"
|
|
|
|
|
- alt=""
|
|
|
|
|
- @click="handleCabinetClick(cabinet)"
|
|
|
|
|
- />
|
|
|
|
|
- <div class="deptXLG">R&R</div>
|
|
|
|
|
- <div class="deptCCO">CCO</div>
|
|
|
|
|
|
|
+ <!-- <img-->
|
|
|
|
|
+ <!-- v-for="(cabinet, index) in COCOTicketListPage"-->
|
|
|
|
|
+ <!-- :key="cabinet.cabinetId"-->
|
|
|
|
|
+ <!-- :style="{-->
|
|
|
|
|
+ <!-- width: '35px',-->
|
|
|
|
|
+ <!-- height: '35px',-->
|
|
|
|
|
+ <!-- position: 'absolute',-->
|
|
|
|
|
+ <!-- cursor: 'pointer',-->
|
|
|
|
|
+ <!-- // 图标垂直居中-->
|
|
|
|
|
+ <!-- top: `${deptCCOCenter.top - 53}px`,-->
|
|
|
|
|
+ <!-- // 图标水平居中,动态计算偏移-->
|
|
|
|
|
+ <!-- left: `${-->
|
|
|
|
|
+ <!-- deptCCOCenter.left - -->
|
|
|
|
|
+ <!-- (COCOTicketListPage.length * 35 +-->
|
|
|
|
|
+ <!-- (COCOTicketListPage.length - 1) * 5) /-->
|
|
|
|
|
+ <!-- 2 +-->
|
|
|
|
|
+ <!-- index * 40-->
|
|
|
|
|
+ <!-- }px`,-->
|
|
|
|
|
+ <!-- }"-->
|
|
|
|
|
+ <!-- :src="require('@/assets/images/table_map2.jpg')"-->
|
|
|
|
|
+ <!-- alt=""-->
|
|
|
|
|
+ <!-- @click="handleCabinetClick(cabinet)"-->
|
|
|
|
|
+ <!-- />-->
|
|
|
|
|
+ <div class="deptXLG">LD</div>
|
|
|
|
|
+ <!-- <div class="deptCCO">CCO</div>-->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 物资列表 -->
|
|
<!-- 物资列表 -->
|
|
|
- <div v-if="tabPosition == 'second'" class="materialsListcon">
|
|
|
|
|
|
|
+ <div v-if="tabPosition == 'second'" class="CabinetListcon">
|
|
|
<div class="left">
|
|
<div class="left">
|
|
|
<!-- 岗位树 -->
|
|
<!-- 岗位树 -->
|
|
|
<div class="deptTree">
|
|
<div class="deptTree">
|
|
|
<div class="head-container">
|
|
<div class="head-container">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="queryParamsEare.workstationName"
|
|
|
|
|
|
|
+ v-model="queryParams.workstationName"
|
|
|
placeholder="请输入区域名称"
|
|
placeholder="请输入区域名称"
|
|
|
clearable
|
|
clearable
|
|
|
size="small"
|
|
size="small"
|
|
|
prefix-icon="el-icon-search"
|
|
prefix-icon="el-icon-search"
|
|
|
style="margin-bottom: 20px"
|
|
style="margin-bottom: 20px"
|
|
|
- @input="handleInputChange"
|
|
|
|
|
@clear="handleClear"
|
|
@clear="handleClear"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -123,7 +122,7 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['iscs:cabinet:add']"
|
|
v-hasPermi="['iscs:cabinet:add']"
|
|
|
- >新增
|
|
|
|
|
|
|
+ >新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<right-toolbar
|
|
<right-toolbar
|
|
@@ -133,11 +132,11 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-table
|
|
<el-table
|
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
- :data="materialsList"
|
|
|
|
|
|
|
+ :data="CabinetList"
|
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
>
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
- <el-table-column label="物资柜编号" align="center" prop="cabinetCode">
|
|
|
|
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
|
|
+ <el-table-column label="物资柜编号" align="center" prop="cabinetId">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="物资柜名称"
|
|
label="物资柜名称"
|
|
@@ -147,12 +146,12 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="物资图片"
|
|
label="物资图片"
|
|
|
align="center"
|
|
align="center"
|
|
|
- prop="materialsTypePicture"
|
|
|
|
|
|
|
+ prop="cabinetPicture"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<img
|
|
<img
|
|
|
- v-if="scope.row.materialsTypePicture"
|
|
|
|
|
- :src="scope.row.materialsTypePicture"
|
|
|
|
|
|
|
+ v-if="scope.row.cabinetPicture"
|
|
|
|
|
+ :src="scope.row.cabinetPicture"
|
|
|
alt=""
|
|
alt=""
|
|
|
style="width: 50px; height: 50px"
|
|
style="width: 50px; height: 50px"
|
|
|
/>
|
|
/>
|
|
@@ -162,26 +161,21 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="物资柜状态"
|
|
label="物资柜状态"
|
|
|
align="center"
|
|
align="center"
|
|
|
- prop="cabinetName"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ prop="status"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <dict-tag :options="dict.type.cabinet_status" :value="scope.row.status"/>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="物资柜详情" align="center">
|
|
<el-table-column label="物资柜详情" align="center">
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
v-no-more-click
|
|
v-no-more-click
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
@click="handleLook(scope.row)"
|
|
@click="handleLook(scope.row)"
|
|
|
- >查看
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </template> -->
|
|
|
|
|
- <template>
|
|
|
|
|
- <el-button
|
|
|
|
|
- v-no-more-click
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="text"
|
|
|
|
|
- @click="handleLook"
|
|
|
|
|
- >查看
|
|
|
|
|
|
|
+ >查看
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -198,7 +192,7 @@
|
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['iscs:cabinet:edit']"
|
|
v-hasPermi="['iscs:cabinet:edit']"
|
|
|
- >编辑
|
|
|
|
|
|
|
+ >编辑
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-no-more-click
|
|
v-no-more-click
|
|
@@ -207,21 +201,21 @@
|
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['iscs:cabinet:remove']"
|
|
v-hasPermi="['iscs:cabinet:remove']"
|
|
|
- >删除
|
|
|
|
|
|
|
+ >删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- <!-- <pagination
|
|
|
|
|
|
|
+ <pagination
|
|
|
v-show="total > 0"
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
:total="total"
|
|
|
- :page.sync="queryParams.pages"
|
|
|
|
|
|
|
+ :page.sync="queryParams.current"
|
|
|
:limit.sync="queryParams.size"
|
|
:limit.sync="queryParams.size"
|
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
|
- /> -->
|
|
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- 添加或修改班组对话框 -->
|
|
|
|
|
|
|
+ <!-- 添加或修改物资柜对话框 -->
|
|
|
<el-dialog :visible.sync="open" width="510px" append-to-body>
|
|
<el-dialog :visible.sync="open" width="510px" append-to-body>
|
|
|
<div slot="title" class="dialog-title">
|
|
<div slot="title" class="dialog-title">
|
|
|
<i></i>
|
|
<i></i>
|
|
@@ -249,31 +243,24 @@
|
|
|
placeholder="请输入物资柜名称"
|
|
placeholder="请输入物资柜名称"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="硬件名称" prop="hardwareId">
|
|
|
|
|
- <el-select
|
|
|
|
|
|
|
+ <el-form-item label="所属区域" prop="workstationId">
|
|
|
|
|
+ <treeselect
|
|
|
style="width: 348px"
|
|
style="width: 348px"
|
|
|
- v-model="form.hardwareId"
|
|
|
|
|
- placeholder="请选择硬件名称"
|
|
|
|
|
- clearable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="dict in this.hardWareList"
|
|
|
|
|
- :key="dict.value"
|
|
|
|
|
- :label="dict.label"
|
|
|
|
|
- :value="dict.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ v-model="form.workstationId"
|
|
|
|
|
+ :options="marsOptions"
|
|
|
|
|
+ :normalizer="Marsnormalizer"
|
|
|
|
|
+ placeholder="选择所属区域"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="物资柜图片" prop="cabinetPicture">
|
|
|
|
|
+ <ImageUploadSingle
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :value="form.cabinetPicture"
|
|
|
|
|
+ :fileSize="5"
|
|
|
|
|
+ @onUploaded="handleIconUplaoded"
|
|
|
|
|
+ @onRemoved="handleIconRemoved"
|
|
|
|
|
+ ></ImageUploadSingle>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="工作区域" prop="workareaId">-->
|
|
|
|
|
- <!-- <treeselect-->
|
|
|
|
|
- <!-- style="width: 348px"-->
|
|
|
|
|
- <!-- v-model="form.workareaId"-->
|
|
|
|
|
- <!-- :options="workareaOptions"-->
|
|
|
|
|
- <!-- :normalizer="normalizer"-->
|
|
|
|
|
- <!-- placeholder="选择工作区域"-->
|
|
|
|
|
- <!-- />-->
|
|
|
|
|
- <!-- </el-form-item>-->
|
|
|
|
|
-
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.remark"
|
|
v-model="form.remark"
|
|
@@ -282,6 +269,7 @@
|
|
|
style="width: 348px"
|
|
style="width: 348px"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -290,10 +278,10 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="cancel"
|
|
@click="cancel"
|
|
|
v-if="optType == 'view'"
|
|
v-if="optType == 'view'"
|
|
|
- >返回
|
|
|
|
|
|
|
+ >返回
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button v-no-more-click type="primary" @click="submitForm" v-else
|
|
<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>
|
|
<el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -307,30 +295,27 @@ import {
|
|
|
addMaterialsCabinet,
|
|
addMaterialsCabinet,
|
|
|
updateMaterialsCabinet,
|
|
updateMaterialsCabinet,
|
|
|
deleteMaterialsCabinet,
|
|
deleteMaterialsCabinet,
|
|
|
- selectMaterialsCabinetById,
|
|
|
|
|
-} from "@/api/mes/material/lockers.js";
|
|
|
|
|
|
|
+ selectMaterialsCabinetById
|
|
|
|
|
+} from '@/api/mes/material/lockers.js'
|
|
|
|
|
|
|
|
-import { listWorkarea } from "@/api/mes/wa/workarea";
|
|
|
|
|
-import { listType } from "@/api/mes/material/typeindex";
|
|
|
|
|
-import { listHardware } from "@/api/mes/hw/hardwareinfo";
|
|
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
-import { genCode } from "@/api/system/autocode/rule";
|
|
|
|
|
-import { listMarsDept } from "@/api/system/marsdept";
|
|
|
|
|
-import { listLoto } from "@/api/mes/lotoStation/lotoStation";
|
|
|
|
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
+import { genCode } from '@/api/system/autocode/rule'
|
|
|
|
|
+import { listMarsDept } from '@/api/system/marsdept'
|
|
|
|
|
+import { listLoto } from '@/api/mes/lotoStation/lotoStation'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: "Team",
|
|
|
|
|
|
|
+ name: 'Team',
|
|
|
components: {
|
|
components: {
|
|
|
- Treeselect,
|
|
|
|
|
|
|
+ Treeselect
|
|
|
},
|
|
},
|
|
|
- dicts: ["material_status"],
|
|
|
|
|
|
|
+ dicts: ['material_status'],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
//自动生成编码
|
|
//自动生成编码
|
|
|
autoGenFlag: false,
|
|
autoGenFlag: false,
|
|
|
optType: undefined,
|
|
optType: undefined,
|
|
|
- tabPosition: "first", //顶部切换
|
|
|
|
|
|
|
+ tabPosition: 'first', //顶部切换
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
|
// 选中数组
|
|
// 选中数组
|
|
@@ -345,87 +330,63 @@ export default {
|
|
|
// 总条数
|
|
// 总条数
|
|
|
total: 0,
|
|
total: 0,
|
|
|
// 班组表格数据
|
|
// 班组表格数据
|
|
|
- materialsList: [],
|
|
|
|
|
|
|
+ CabinetList: [],
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
|
|
|
|
+ title: '',
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
-
|
|
|
|
|
// 查询参数
|
|
// 查询参数
|
|
|
- createTime: "",
|
|
|
|
|
|
|
+ createTime: '',
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
- pages: 1,
|
|
|
|
|
- size: 10,
|
|
|
|
|
- cabinetCode: null,
|
|
|
|
|
- cabinetName: null,
|
|
|
|
|
- },
|
|
|
|
|
- // 区域岗位查询参数
|
|
|
|
|
- queryParamsEare: {
|
|
|
|
|
current: 1,
|
|
current: 1,
|
|
|
size: 10,
|
|
size: 10,
|
|
|
workstationName: undefined,
|
|
workstationName: undefined,
|
|
|
- workstationId: undefined,
|
|
|
|
|
- },
|
|
|
|
|
- hardWareList: [],
|
|
|
|
|
- queryhwParams: {
|
|
|
|
|
- current: 1,
|
|
|
|
|
- size: -1,
|
|
|
|
|
- },
|
|
|
|
|
- // 查询参数
|
|
|
|
|
- queryParamsCabinets: {
|
|
|
|
|
- current: 1,
|
|
|
|
|
- size: -1,
|
|
|
|
|
|
|
+ workstationId: undefined
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
pickerOptions: {
|
|
pickerOptions: {
|
|
|
shortcuts: [
|
|
shortcuts: [
|
|
|
{
|
|
{
|
|
|
- text: "最近一周",
|
|
|
|
|
|
|
+ text: '最近一周',
|
|
|
onClick(picker) {
|
|
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) {
|
|
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) {
|
|
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])
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
},
|
|
},
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
rules: {
|
|
rules: {
|
|
|
cabinetCode: [
|
|
cabinetCode: [
|
|
|
- { required: true, message: "物资柜编码不能为空", trigger: "blur" },
|
|
|
|
|
|
|
+ { required: true, message: '物资柜编码不能为空', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
cabinetName: [
|
|
cabinetName: [
|
|
|
- { required: true, message: "物资柜名称不能为空", trigger: "blur" },
|
|
|
|
|
- ],
|
|
|
|
|
- hardwareId: [
|
|
|
|
|
- {
|
|
|
|
|
- require: true,
|
|
|
|
|
- message: "硬件名称不能为空",
|
|
|
|
|
- trigger: "blur",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ { required: true, message: '物资柜名称不能为空', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
|
- workareaOptions: [],
|
|
|
|
|
|
|
+ marsOptions: [],//岗位
|
|
|
TicketListPage: [], //R&R岗位
|
|
TicketListPage: [], //R&R岗位
|
|
|
COCOTicketListPage: [], //CCO岗位
|
|
COCOTicketListPage: [], //CCO岗位
|
|
|
scaleFactor: 1, // 缩放比例,初始值为1
|
|
scaleFactor: 1, // 缩放比例,初始值为1
|
|
@@ -433,469 +394,342 @@ export default {
|
|
|
left: 500,
|
|
left: 500,
|
|
|
top: 260,
|
|
top: 260,
|
|
|
width: 65,
|
|
width: 65,
|
|
|
- height: 25,
|
|
|
|
|
|
|
+ height: 25
|
|
|
},
|
|
},
|
|
|
deptCCOPosition: {
|
|
deptCCOPosition: {
|
|
|
left: 670,
|
|
left: 670,
|
|
|
top: 480,
|
|
top: 480,
|
|
|
width: 65,
|
|
width: 65,
|
|
|
- height: 25,
|
|
|
|
|
|
|
+ height: 25
|
|
|
},
|
|
},
|
|
|
workstationOptions: [], //岗位
|
|
workstationOptions: [], //岗位
|
|
|
defaultProps: {
|
|
defaultProps: {
|
|
|
- children: "children",
|
|
|
|
|
- label: "label",
|
|
|
|
|
- },
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ children: 'children',
|
|
|
|
|
+ label: 'label'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
deptXLGCenter() {
|
|
deptXLGCenter() {
|
|
|
return {
|
|
return {
|
|
|
left: this.deptXLGPosition.left + this.deptXLGPosition.width / 2,
|
|
left: this.deptXLGPosition.left + this.deptXLGPosition.width / 2,
|
|
|
- top: this.deptXLGPosition.top + this.deptXLGPosition.height / 2,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ top: this.deptXLGPosition.top + this.deptXLGPosition.height / 2
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
deptCCOCenter() {
|
|
deptCCOCenter() {
|
|
|
return {
|
|
return {
|
|
|
left: this.deptCCOPosition.left + this.deptCCOPosition.width / 2,
|
|
left: this.deptCCOPosition.left + this.deptCCOPosition.width / 2,
|
|
|
- top: this.deptCCOPosition.top + this.deptCCOPosition.height / 2,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ top: this.deptCCOPosition.top + this.deptCCOPosition.height / 2
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
- "form.workstationId": function (newVal, oldVal) {
|
|
|
|
|
- if (newVal !== oldVal && this.form.lotoId && !this.isEditing) {
|
|
|
|
|
- this.form.lotoId = "";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 'queryParams.workstationId': function(newVal, oldVal) {
|
|
|
if (newVal) {
|
|
if (newVal) {
|
|
|
const data = {
|
|
const data = {
|
|
|
- pasge: 1,
|
|
|
|
|
|
|
+ current: 1,
|
|
|
size: -1,
|
|
size: -1,
|
|
|
- workstationId: this.form.workstationId,
|
|
|
|
|
- };
|
|
|
|
|
- listLoto(data).then((response) => {
|
|
|
|
|
- this.LotoOptions = response.data.records.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- value: item.lotoId,
|
|
|
|
|
- label: item.lotoName,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ workstationId: this.queryParams.workstationId
|
|
|
|
|
+ }
|
|
|
|
|
+ getMaterialsCabinet(data).then((response) => {
|
|
|
|
|
+ this.CabinetList = response.data.records
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- tabPosition: function (newVal, oldVal) {
|
|
|
|
|
|
|
+ tabPosition: function(newVal, oldVal) {
|
|
|
if (newVal) {
|
|
if (newVal) {
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ this.getList()
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getList();
|
|
|
|
|
- this.getHardWare();
|
|
|
|
|
- this.getTreeselect();
|
|
|
|
|
- this.getOtherList();
|
|
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.getOtherList()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- // mars岗位树点击事件
|
|
|
|
|
- handleNodeClick(data) {
|
|
|
|
|
- this.queryParams.workstationId = data.id; //这里给查询传递参数
|
|
|
|
|
- this.queryParams.workstationName = data.label; //这里给回显框显示中文
|
|
|
|
|
- const data1 = {
|
|
|
|
|
- pasge: 1,
|
|
|
|
|
- size: -1,
|
|
|
|
|
- };
|
|
|
|
|
- listMarsDept(data1).then((response) => {
|
|
|
|
|
- // 新增岗位单选
|
|
|
|
|
- this.marsOptions = this.handleTree(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "workstationId",
|
|
|
|
|
- "parentId"
|
|
|
|
|
- );
|
|
|
|
|
- // mars岗位树数据
|
|
|
|
|
- this.workstationOptions = this.transformToTree(response.data.records);
|
|
|
|
|
- // 使用递归函数查找匹配的节点
|
|
|
|
|
- const selectedTreeNode = this.findNodeById(
|
|
|
|
|
- this.workstationOptions,
|
|
|
|
|
- this.queryParamsEare.workstationId
|
|
|
|
|
- );
|
|
|
|
|
- // 不再递归调用 handleNodeClick
|
|
|
|
|
- if (selectedTreeNode) {
|
|
|
|
|
- // 可以在这里执行其他逻辑,但不要再次调用 handleNodeClick
|
|
|
|
|
- console.log("找到匹配的节点:", selectedTreeNode);
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log("未找到匹配的节点");
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- listTechnology(this.queryParamsEare).then((response) => {
|
|
|
|
|
- debugger;
|
|
|
|
|
- let filteredData;
|
|
|
|
|
- if (this.tabPosition == "craft") {
|
|
|
|
|
- filteredData = this.filterByMachineryType(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "工艺"
|
|
|
|
|
- );
|
|
|
|
|
- console.log(filteredData, "工艺列表---a");
|
|
|
|
|
- } else {
|
|
|
|
|
- filteredData = this.filterByMachineryType(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "设备"
|
|
|
|
|
- );
|
|
|
|
|
- console.log(filteredData, "设备列表---v");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.deptList = this.handleTree(
|
|
|
|
|
- filteredData,
|
|
|
|
|
- "machineryId",
|
|
|
|
|
- "parentId"
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- // 岗位新增的下拉
|
|
|
|
|
- this.machineryOptions = this.handleTree(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "machineryId",
|
|
|
|
|
- "parentId"
|
|
|
|
|
- );
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- /** 转换mars岗位数据结构 */
|
|
|
|
|
- Marsnormalizer(node) {
|
|
|
|
|
- if (node.children && !node.children.length) {
|
|
|
|
|
- delete node.children;
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- id: node.workstationId,
|
|
|
|
|
- label: node.workstationName,
|
|
|
|
|
- children: node.children,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- // 筛选节点
|
|
|
|
|
- filterNode(value, data) {
|
|
|
|
|
- if (!value) return true;
|
|
|
|
|
- return data.label.indexOf(value) !== -1;
|
|
|
|
|
- },
|
|
|
|
|
- // mars树形输入框回显监听
|
|
|
|
|
- handleInputChange() {
|
|
|
|
|
- this.$refs.treeData.filter(this.queryParamsEare.workstationId); // 调用树的 filter 方法
|
|
|
|
|
- const data = {
|
|
|
|
|
- page: 1,
|
|
|
|
|
- size: -1,
|
|
|
|
|
- workstationId: null,
|
|
|
|
|
- workstationName: null,
|
|
|
|
|
- };
|
|
|
|
|
- listMarsDept(data).then((response) => {
|
|
|
|
|
- // 新增岗位单选
|
|
|
|
|
- this.marsOptions = this.handleTree(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "workstationId",
|
|
|
|
|
- "parentId"
|
|
|
|
|
- );
|
|
|
|
|
- // mars岗位树数据
|
|
|
|
|
- this.workstationOptions = this.transformToTree(response.data.records);
|
|
|
|
|
- // 使用递归函数查找匹配的节点
|
|
|
|
|
- // const selectedTreeNode = this.findNodeById(this.workstationOptions, this.queryParams.workstationId)
|
|
|
|
|
- // 不再递归调用 handleNodeClick
|
|
|
|
|
- // if (selectedTreeNode) {
|
|
|
|
|
- // // 可以在这里执行其他逻辑,但不要再次调用 handleNodeClick
|
|
|
|
|
- // console.log('找到匹配的节点:', selectedTreeNode)
|
|
|
|
|
- // } else {
|
|
|
|
|
- // console.log('未找到匹配的节点')
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- // 岗位查询 清除事件
|
|
|
|
|
- handleClear() {
|
|
|
|
|
- this.queryParamsEare.workstationId = "";
|
|
|
|
|
- this.queryParamsEare.workstationName = "";
|
|
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ /** 查询物资柜信息列表 */
|
|
|
|
|
+ getList() {
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ getMaterialsCabinet(this.queryParams).then((response) => {
|
|
|
|
|
+ this.CabinetList = response.data.records
|
|
|
|
|
+ console.log(response, '所有物资柜')
|
|
|
|
|
+ this.TicketListPage = response.data.records.filter((item) => {
|
|
|
|
|
+ return item.workstationId == '6'
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(this.TicketListPage, 'this.TicketListPage')
|
|
|
|
|
+ this.COCOTicketListPage = response.data.records.filter((item) => {
|
|
|
|
|
+ return item.workstationId == '7'
|
|
|
|
|
+ })
|
|
|
|
|
+ this.total = response.data.total
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
getOtherList() {
|
|
getOtherList() {
|
|
|
const data = {
|
|
const data = {
|
|
|
pasge: 1,
|
|
pasge: 1,
|
|
|
- size: -1,
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- listLoto(data).then((response) => {
|
|
|
|
|
- this.LotoOptions = response.data.records.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- value: item.lotoId,
|
|
|
|
|
- label: item.lotoName,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ size: -1
|
|
|
|
|
+ }
|
|
|
listMarsDept(data).then((response) => {
|
|
listMarsDept(data).then((response) => {
|
|
|
// 新增岗位单选
|
|
// 新增岗位单选
|
|
|
this.marsOptions = this.handleTree(
|
|
this.marsOptions = this.handleTree(
|
|
|
response.data.records,
|
|
response.data.records,
|
|
|
- "workstationId",
|
|
|
|
|
- "parentId"
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ 'workstationId',
|
|
|
|
|
+ 'parentId'
|
|
|
|
|
+ )
|
|
|
// mars岗位树数据
|
|
// mars岗位树数据
|
|
|
- this.workstationOptions = this.transformToTree(response.data.records);
|
|
|
|
|
|
|
+ this.workstationOptions = this.transformToTree(response.data.records)
|
|
|
// 使用递归函数查找匹配的节点
|
|
// 使用递归函数查找匹配的节点
|
|
|
const selectedTreeNode = this.findNodeById(
|
|
const selectedTreeNode = this.findNodeById(
|
|
|
this.workstationOptions,
|
|
this.workstationOptions,
|
|
|
- this.queryParamsEare.workstationId
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this.queryParams.workstationId
|
|
|
|
|
+ )
|
|
|
// 调用 handleNodeClick 方法
|
|
// 调用 handleNodeClick 方法
|
|
|
if (selectedTreeNode) {
|
|
if (selectedTreeNode) {
|
|
|
- this.handleNodeClick(selectedTreeNode);
|
|
|
|
|
|
|
+ this.handleNodeClick(selectedTreeNode)
|
|
|
} else {
|
|
} else {
|
|
|
- console.log("未找到匹配的节点");
|
|
|
|
|
|
|
+ console.log('未找到匹配的节点')
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // mars岗位树点击事件
|
|
|
|
|
+ handleNodeClick(data) {
|
|
|
|
|
+ this.queryParams.workstationId = data.id //这里给查询传递参数
|
|
|
|
|
+ this.queryParams.workstationName = data.label //这里给回显框显示中文
|
|
|
},
|
|
},
|
|
|
/** 转换mars岗位树数据为树形结构 */
|
|
/** 转换mars岗位树数据为树形结构 */
|
|
|
transformToTree(records) {
|
|
transformToTree(records) {
|
|
|
- const recordMap = {}; // 创建一个 Map 以存储所有记录
|
|
|
|
|
- const tree = []; // 最终返回的树形结构
|
|
|
|
|
|
|
+ const recordMap = {} // 创建一个 Map 以存储所有记录
|
|
|
|
|
+ const tree = [] // 最终返回的树形结构
|
|
|
|
|
|
|
|
// 初始化所有记录到 Map
|
|
// 初始化所有记录到 Map
|
|
|
records.forEach((record) => {
|
|
records.forEach((record) => {
|
|
|
recordMap[record.workstationId] = {
|
|
recordMap[record.workstationId] = {
|
|
|
id: record.workstationId,
|
|
id: record.workstationId,
|
|
|
label: record.workstationName,
|
|
label: record.workstationName,
|
|
|
- children: [],
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ children: []
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
// 遍历记录并构建树
|
|
// 遍历记录并构建树
|
|
|
records.forEach((record) => {
|
|
records.forEach((record) => {
|
|
|
- const parentId = record.parentId;
|
|
|
|
|
|
|
+ const parentId = record.parentId
|
|
|
|
|
|
|
|
- if (parentId === "0") {
|
|
|
|
|
|
|
+ if (parentId === '0') {
|
|
|
// 如果是顶层节点,直接添加到树中
|
|
// 如果是顶层节点,直接添加到树中
|
|
|
- tree.push(recordMap[record.workstationId]);
|
|
|
|
|
|
|
+ tree.push(recordMap[record.workstationId])
|
|
|
} else if (recordMap[parentId]) {
|
|
} else if (recordMap[parentId]) {
|
|
|
// 如果有父节点,则将当前节点加入父节点的 children 中
|
|
// 如果有父节点,则将当前节点加入父节点的 children 中
|
|
|
- recordMap[parentId].children.push(recordMap[record.workstationId]);
|
|
|
|
|
|
|
+ recordMap[parentId].children.push(recordMap[record.workstationId])
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- return tree;
|
|
|
|
|
|
|
+ return tree
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
// mars岗位数深层次遍历
|
|
// mars岗位数深层次遍历
|
|
|
findNodeById(nodes, targetId) {
|
|
findNodeById(nodes, targetId) {
|
|
|
for (let i = 0; i < nodes.length; i++) {
|
|
for (let i = 0; i < nodes.length; i++) {
|
|
|
- const node = nodes[i];
|
|
|
|
|
|
|
+ const node = nodes[i]
|
|
|
if (node.id === targetId) {
|
|
if (node.id === targetId) {
|
|
|
- return node;
|
|
|
|
|
|
|
+ return node
|
|
|
}
|
|
}
|
|
|
if (node.children && node.children.length > 0) {
|
|
if (node.children && node.children.length > 0) {
|
|
|
- const foundNode = this.findNodeById(node.children, targetId);
|
|
|
|
|
|
|
+ const foundNode = this.findNodeById(node.children, targetId)
|
|
|
if (foundNode) {
|
|
if (foundNode) {
|
|
|
- return foundNode;
|
|
|
|
|
|
|
+ return foundNode
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return null;
|
|
|
|
|
|
|
+ return null
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- getHardWare() {
|
|
|
|
|
- listHardware(this.queryhwParams).then((response) => {
|
|
|
|
|
- this.hardWareList = response.data.records.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- value: item.id,
|
|
|
|
|
- label: item.hardwareName,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- /** 查询物资类型下拉树结构 */
|
|
|
|
|
- getTreeselect() {
|
|
|
|
|
- const data = {
|
|
|
|
|
- current: 1,
|
|
|
|
|
- size: 99999,
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- listType(data).then((response) => {
|
|
|
|
|
- this.machinerytypeOptions = this.handleTree(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "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")}`;
|
|
|
|
|
|
|
+ /** 转换mars岗位数据结构 */
|
|
|
|
|
+ Marsnormalizer(node) {
|
|
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
|
|
+ delete node.children
|
|
|
}
|
|
}
|
|
|
- return null;
|
|
|
|
|
- },
|
|
|
|
|
- /** 查询物资信息列表 */
|
|
|
|
|
- getList() {
|
|
|
|
|
- this.loading = true;
|
|
|
|
|
- // 格式化日期并更新 queryParams
|
|
|
|
|
- if (Array.isArray(this.createTime) && this.createTime.length === 2) {
|
|
|
|
|
- this.queryParams.startTime = this.formatDate(this.createTime[0]);
|
|
|
|
|
- this.queryParams.endTime = this.formatDate(this.createTime[1]);
|
|
|
|
|
|
|
+ return {
|
|
|
|
|
+ id: node.workstationId,
|
|
|
|
|
+ label: node.workstationName,
|
|
|
|
|
+ children: node.children
|
|
|
}
|
|
}
|
|
|
- getMaterialsCabinet(this.queryParams).then((response) => {
|
|
|
|
|
- this.materialsList = response.data.records;
|
|
|
|
|
- console.log(response, "所有物资柜");
|
|
|
|
|
- this.TicketListPage = response.data.records.filter((item) => {
|
|
|
|
|
- return item.workstationId == "8";
|
|
|
|
|
- });
|
|
|
|
|
- this.COCOTicketListPage = response.data.records.filter((item) => {
|
|
|
|
|
- return item.workstationId == "7";
|
|
|
|
|
- });
|
|
|
|
|
- this.total = response.data.total;
|
|
|
|
|
- this.machinerytypeList = this.handleTree(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "cabinetId",
|
|
|
|
|
- "parentId",
|
|
|
|
|
- "children"
|
|
|
|
|
- );
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ // 筛选节点
|
|
|
|
|
+ filterNode(value, data) {
|
|
|
|
|
+ if (!value) return true
|
|
|
|
|
+ return data.label.indexOf(value) !== -1
|
|
|
|
|
+ },
|
|
|
|
|
+ // 岗位查询 清除事件
|
|
|
|
|
+ handleClear() {
|
|
|
|
|
+ this.queryParams.workstationId = ''
|
|
|
|
|
+ this.queryParams.workstationName = ''
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
// 物资柜跳转详情
|
|
// 物资柜跳转详情
|
|
|
handleCabinetClick(cabinet) {
|
|
handleCabinetClick(cabinet) {
|
|
|
- console.log(cabinet, "详情拿到的");
|
|
|
|
|
|
|
+ this.$router.push({ path:'/mes/material/lockers/DetailsIndex',query:{cabinetId:cabinet.cabinetId,cabinetName:cabinet.cabinetName} })
|
|
|
|
|
+ console.log(cabinet, '地图跳转详情拿到的')
|
|
|
},
|
|
},
|
|
|
// 物资柜列表跳转详情
|
|
// 物资柜列表跳转详情
|
|
|
- handleLook() {
|
|
|
|
|
- this.$router.push("/mes/material/lockers/DetailsIndex");
|
|
|
|
|
-
|
|
|
|
|
- console.log("详情tiaozhuan");
|
|
|
|
|
|
|
+ handleLook(row) {
|
|
|
|
|
+ this.$router.push({ path:'/mes/material/lockers/DetailsIndex',query:{cabinetId:row.cabinetId,cabinetName:row.cabinetName} })
|
|
|
|
|
+ console.log('列表详情')
|
|
|
},
|
|
},
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
cancel() {
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
|
|
- this.reset();
|
|
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.reset()
|
|
|
},
|
|
},
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
reset() {
|
|
reset() {
|
|
|
this.form = {
|
|
this.form = {
|
|
|
- cabinetCode: "",
|
|
|
|
|
- cabinetName: "",
|
|
|
|
|
- };
|
|
|
|
|
- this.resetForm("form");
|
|
|
|
|
- this.autoGenFlag = false;
|
|
|
|
|
|
|
+ cabinetCode: '',
|
|
|
|
|
+ cabinetName: '',
|
|
|
|
|
+ workstationId: '',
|
|
|
|
|
+ remark:'',
|
|
|
|
|
+ cabinetPicture: '',
|
|
|
|
|
+ }
|
|
|
|
|
+ this.resetForm('form')
|
|
|
|
|
+ this.autoGenFlag = false
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
- this.queryParams.pages = 1;
|
|
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ this.queryParams.current = 1
|
|
|
|
|
+ this.getList()
|
|
|
},
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
|
- this.createTime = "";
|
|
|
|
|
- this.queryParams.cabinetCode = null;
|
|
|
|
|
- this.queryParams.cabinetName = null;
|
|
|
|
|
- this.resetForm("queryForm");
|
|
|
|
|
- this.handleQuery();
|
|
|
|
|
|
|
+ this.createTime = ''
|
|
|
|
|
+ this.queryParams.cabinetCode = null
|
|
|
|
|
+ this.queryParams.cabinetName = null
|
|
|
|
|
+ this.resetForm('queryForm')
|
|
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
},
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map((item) => item.cabinetId);
|
|
|
|
|
- this.codes = selection.map((item) => item.cabinetCode);
|
|
|
|
|
- this.single = selection.length !== 1;
|
|
|
|
|
- this.multiple = !selection.length;
|
|
|
|
|
|
|
+ this.ids = selection.map((item) => item.cabinetId)
|
|
|
|
|
+ this.codes = selection.map((item) => item.cabinetCode)
|
|
|
|
|
+ this.single = selection.length !== 1
|
|
|
|
|
+ this.multiple = !selection.length
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "新增物资柜信息";
|
|
|
|
|
- this.optType = "add";
|
|
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ this.open = true
|
|
|
|
|
+ this.title = '新增物资柜信息'
|
|
|
|
|
+ this.optType = 'add'
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
|
|
|
|
+ this.reset()
|
|
|
selectMaterialsCabinetById(row.cabinetId).then((response) => {
|
|
selectMaterialsCabinetById(row.cabinetId).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'
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
|
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (this.form.cabinetId != null) {
|
|
if (this.form.cabinetId != null) {
|
|
|
updateMaterialsCabinet(this.form).then((response) => {
|
|
updateMaterialsCabinet(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 {
|
|
} else {
|
|
|
addMaterialsCabinet(this.form).then((response) => {
|
|
addMaterialsCabinet(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) {
|
|
handleDelete(row) {
|
|
|
- const cabinetIds = row.cabinetId || this.ids;
|
|
|
|
|
- const cabinetCodes = row.cabinetCode || this.codes;
|
|
|
|
|
|
|
+ const cabinetIds = row.cabinetId || this.ids
|
|
|
|
|
+ const cabinetCodes = row.cabinetCode || this.codes
|
|
|
this.$modal
|
|
this.$modal
|
|
|
.confirm('是否确认删除编号为"' + cabinetCodes + '"的数据项?')
|
|
.confirm('是否确认删除编号为"' + cabinetCodes + '"的数据项?')
|
|
|
- .then(function () {
|
|
|
|
|
- return deleteMaterialsCabinet(cabinetIds);
|
|
|
|
|
|
|
+ .then(function() {
|
|
|
|
|
+ return deleteMaterialsCabinet(cabinetIds)
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
- this.getList();
|
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
})
|
|
})
|
|
|
- .catch(() => {});
|
|
|
|
|
},
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
|
|
- handleExport() {
|
|
|
|
|
- this.download(
|
|
|
|
|
- "cal/team/export",
|
|
|
|
|
- {
|
|
|
|
|
- ...this.queryParams,
|
|
|
|
|
- },
|
|
|
|
|
- `team_${new Date().getTime()}.xlsx`
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ //图标上传成功
|
|
|
|
|
+ handleIconUplaoded(imgUrl) {
|
|
|
|
|
+ this.form.cabinetPicture = imgUrl[0].url
|
|
|
|
|
+ },
|
|
|
|
|
+ // 图标移除
|
|
|
|
|
+ handleIconRemoved(imgUrl) {
|
|
|
|
|
+ this.form.cabinetPicture = null
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
//自动生成编码
|
|
//自动生成编码
|
|
|
handleAutoGenChange(autoGenFlag) {
|
|
handleAutoGenChange(autoGenFlag) {
|
|
|
if (autoGenFlag) {
|
|
if (autoGenFlag) {
|
|
|
- genCode("MATERIALS_CABINET").then((response) => {
|
|
|
|
|
- this.form.cabinetCode = response;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ genCode('MATERIALS_CABINET').then((response) => {
|
|
|
|
|
+ this.form.cabinetCode = response
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- this.form.cabinetCode = null;
|
|
|
|
|
|
|
+ this.form.cabinetCode = null
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
|
|
<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
|
|
|
</style>
|
|
</style>
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
|
+.deptXLG {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ width: 65px;
|
|
|
|
|
+ height: 25px;
|
|
|
|
|
+ left: 500px;
|
|
|
|
|
+ top: 260px;
|
|
|
|
|
+ background: #70b26f;
|
|
|
|
|
+ line-height: 25px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.deptCCO {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ width: 65px;
|
|
|
|
|
+ height: 25px;
|
|
|
|
|
+ left: 670px;
|
|
|
|
|
+ top: 480px;
|
|
|
|
|
+ background: #70b26f;
|
|
|
|
|
+ line-height: 25px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.el-input-width {
|
|
.el-input-width {
|
|
|
width: 380px !important;
|
|
width: 380px !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.app-container {
|
|
.app-container {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
// background: green;
|
|
// background: green;
|
|
|
- .materialsListcon {
|
|
|
|
|
|
|
+ .CabinetListcon {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display: flex;
|
|
display: flex;
|