|
|
@@ -1,361 +1,70 @@
|
|
|
<template>
|
|
|
- <div class="content-height p20">
|
|
|
- <div class="page-title">
|
|
|
- <el-page-header @back="goBack">
|
|
|
- <div slot="content" class="pageContent">
|
|
|
- <div>{{ pageTitle }}</div>
|
|
|
- <el-form class="topform">
|
|
|
- <el-form-item label="物品类型" label-width="70px">
|
|
|
- <el-select
|
|
|
- v-model="defaultNum"
|
|
|
- placeholder="请选择"
|
|
|
- @change="chooseItem"
|
|
|
- :disabled="uneditable"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in typeList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.value"
|
|
|
- :value="item.prefix"
|
|
|
+ <div class="ele-body">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <div class="page-title">
|
|
|
+ <el-page-header @back="goBack">
|
|
|
+ <div slot="content" class="pageContent">
|
|
|
+ <div>{{ pageTitle }}</div>
|
|
|
+ <el-form class="topform">
|
|
|
+ <el-form-item label="物品类型" label-width="70px">
|
|
|
+ <el-select
|
|
|
+ v-model="defaultNum"
|
|
|
+ placeholder="请选择"
|
|
|
+ :disabled="uneditable"
|
|
|
>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- </el-page-header>
|
|
|
- </div>
|
|
|
- <div class="table-container">
|
|
|
- <div class="tree-col">
|
|
|
- <ItemForm
|
|
|
- ref="itemFormRef"
|
|
|
- :itemForm="itemForm"
|
|
|
- :defaultNum="defaultNum"
|
|
|
- :classList="[]"
|
|
|
- />
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.code"
|
|
|
+ @click.native="chooseItem(item)"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-page-header>
|
|
|
</div>
|
|
|
- <div class="attribute-row">
|
|
|
- <RowForm
|
|
|
- ref="customFormRef"
|
|
|
- :itemForm="itemForm"
|
|
|
- :defaultNum="defaultNum"
|
|
|
- />
|
|
|
- <div
|
|
|
- class="row-table"
|
|
|
- v-if="
|
|
|
- defaultNum != 'w08' && defaultNum != 'w02' && defaultNum != 'w03'
|
|
|
- "
|
|
|
- >
|
|
|
- <el-tabs v-model="activeName" type="card">
|
|
|
- <el-tab-pane
|
|
|
- label="匹配产品"
|
|
|
- name="product"
|
|
|
- v-if="defaultNum == 'w06' || defaultNum == 'w04'"
|
|
|
- >
|
|
|
- <el-button type="primary" @click="clickAdd([4], '选择产品')"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
- <el-table
|
|
|
- :data="productData"
|
|
|
- class="table-box"
|
|
|
- :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
|
|
|
- >
|
|
|
- <el-table-column type="index" label="序号" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="informationCode" label="物品编码">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationName"
|
|
|
- label="物品名称"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="brandNum" label="牌号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="modelType" label="型号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="物品类型"
|
|
|
- prop="classificationCode"
|
|
|
- :formatter="classificationCodeFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="classificationUrl"
|
|
|
- show-overflow-tooltip
|
|
|
- label="分类"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane
|
|
|
- label="匹配模具"
|
|
|
- name="mould"
|
|
|
- v-if="defaultNum == 'w01' || defaultNum == 'w07'"
|
|
|
- >
|
|
|
- <el-button type="primary" @click="clickAdd([6], '选择模具')"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
- <el-table
|
|
|
- :data="mouldData"
|
|
|
- class="table-box"
|
|
|
- :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
|
|
|
- >
|
|
|
- <el-table-column type="index" label="序号" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationCode"
|
|
|
- label="物品编码"
|
|
|
- width="120"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationName"
|
|
|
- label="物品名称"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="brandNum" label="牌号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="modelType" label="型号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="shrinkageCoefficient"
|
|
|
- label="收缩系数"
|
|
|
- :formatter="shrinkFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="dieBodyModel"
|
|
|
- width="120"
|
|
|
- label="大模体型号"
|
|
|
- :formatter="modleFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="物品类型"
|
|
|
- prop="classificationCode"
|
|
|
- :formatter="classificationCodeFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="classificationUrl"
|
|
|
- show-overflow-tooltip
|
|
|
- label="分类"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane
|
|
|
- label="匹配备品备件"
|
|
|
- name="part"
|
|
|
- v-if="defaultNum == 'w01'"
|
|
|
- >
|
|
|
- <el-button type="primary" @click="clickAdd([7], '选择备品备件')"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
- <el-table
|
|
|
- :data="partData"
|
|
|
- class="table-box"
|
|
|
- :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
|
|
|
- >
|
|
|
- <el-table-column type="index" label="序号" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="informationCode" label="物品编码">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationName"
|
|
|
- label="物品名称"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="modelType" label="型号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="物品类型"
|
|
|
- prop="classificationCode"
|
|
|
- :formatter="classificationCodeFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="classificationUrl"
|
|
|
- show-overflow-tooltip
|
|
|
- label="分类"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == 'w07'">
|
|
|
- <div class="bom-top">
|
|
|
- <el-button type="primary" @click="clickAdd([3], '选择物料')"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
- <div class="top-input">
|
|
|
- <span>基本数量</span>
|
|
|
- <el-input
|
|
|
- class="input-box"
|
|
|
- @input="handleEdit"
|
|
|
- v-model="itemForm.basicNum"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- <span>{{ itemForm.measuringUnit }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-table
|
|
|
- :data="bomData"
|
|
|
- class="table-box"
|
|
|
- :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
|
|
|
- >
|
|
|
- <el-table-column type="index" label="序号" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationCode"
|
|
|
- label="物品编码"
|
|
|
- width="120"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationName"
|
|
|
- label="物品名称"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="brandNum" label="牌号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="物品类型"
|
|
|
- prop="classificationCode"
|
|
|
- :formatter="classificationCodeFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="classificationUrl"
|
|
|
- label="分类"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="num" label="数量" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- type="number"
|
|
|
- v-model="scope.row.num"
|
|
|
- placeholder="请输入"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'')"
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="计量单位" prop="measuringUnit">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane
|
|
|
- label="匹配设备"
|
|
|
- name="facility"
|
|
|
- v-if="defaultNum == 'w04' || defaultNum == 'w05'"
|
|
|
- >
|
|
|
- <el-button type="primary" @click="clickAdd([1], '选择设备')"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
- <el-table
|
|
|
- :data="facilityData"
|
|
|
- class="table-box"
|
|
|
- :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
|
|
|
- >
|
|
|
- <el-table-column type="index" label="序号" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="informationCode" label="物品编码">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="informationName"
|
|
|
- label="物品名称"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="modelType" label="型号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="物品类型"
|
|
|
- prop="classificationCode"
|
|
|
- :formatter="classificationCodeFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="classificationUrl"
|
|
|
- label="分类"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ <div class="table-container">
|
|
|
+ <div class="tree-col">
|
|
|
+ <ItemForm
|
|
|
+ ref="itemFormRef"
|
|
|
+ :itemForm="itemForm"
|
|
|
+ :defaultNum="defaultNum"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <div class="page-footer-btn mt20">
|
|
|
- <el-button @click="goBack">取消</el-button>
|
|
|
- <el-button type="primary" @click="submit">确定</el-button>
|
|
|
+ <div class="attribute-row">
|
|
|
+ <RowForm
|
|
|
+ ref="customFormRef"
|
|
|
+ :itemForm="itemForm"
|
|
|
+ :defaultNum="defaultNum"
|
|
|
+ />
|
|
|
+ <div
|
|
|
+ class="row-table"
|
|
|
+ v-if="defaultNum != '8' && defaultNum != '2' && defaultNum != '5'"
|
|
|
+ >
|
|
|
+ <ItemMatch
|
|
|
+ ref="itemMatchRef"
|
|
|
+ :defaultNum="defaultNum"
|
|
|
+ :typeList="typeList"
|
|
|
+ ></ItemMatch>
|
|
|
+ </div>
|
|
|
+ <div class="page-footer-btn mt20">
|
|
|
+ <el-button @click="goBack">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submit">确定</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 选择添加 -->
|
|
|
- <AddDialog
|
|
|
- ref="addDialogRef"
|
|
|
- @submit="selectedEquipment"
|
|
|
- :typeValue="typeValue"
|
|
|
- :dialogTitle="dialogTitle"
|
|
|
- :mapList="mapList"
|
|
|
- />
|
|
|
+ </el-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import ItemForm from './components/ItemForm';
|
|
|
import RowForm from './components/RowForm';
|
|
|
- import AddDialog from './components/AddDialog.vue';
|
|
|
+ import ItemMatch from './components/item-match';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
import {
|
|
|
informationAdd,
|
|
|
getDetails,
|
|
|
@@ -363,38 +72,11 @@
|
|
|
getOrderNo
|
|
|
} from '@/api/classifyManage/itemInformation';
|
|
|
export default {
|
|
|
- components: { ItemForm, RowForm, AddDialog },
|
|
|
- data() {
|
|
|
+ components: { ItemForm, RowForm, ItemMatch },
|
|
|
+ mixins: [dictMixins],
|
|
|
+ data () {
|
|
|
return {
|
|
|
pageTitle: '',
|
|
|
- typeList: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- value: 'w01 生产设备',
|
|
|
- name: '生产设备',
|
|
|
- prefix: 'w01',
|
|
|
- code: 1
|
|
|
- },
|
|
|
- { id: 2, value: 'w02 舟皿', name: '舟皿', prefix: 'w02', code: 2 },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- value: 'w03 周转车',
|
|
|
- name: '周转车',
|
|
|
- prefix: 'w03',
|
|
|
- code: 5
|
|
|
- },
|
|
|
- { id: 4, value: 'w04 模具', name: '模具', prefix: 'w04', code: 6 },
|
|
|
- {
|
|
|
- id: 5,
|
|
|
- value: 'w05 备品备件',
|
|
|
- name: '备品备件',
|
|
|
- prefix: 'w05',
|
|
|
- code: 7
|
|
|
- },
|
|
|
- { id: 6, value: 'w06 原料', name: '物料', prefix: 'w06', code: 3 },
|
|
|
- { id: 7, value: 'w07 产品', name: '产品', prefix: 'w07', code: 4 },
|
|
|
- { id: 8, value: 'w08 耗材', name: '耗材', prefix: 'w08', code: 8 }
|
|
|
- ],
|
|
|
itemForm: {
|
|
|
classificationUrlId: [],
|
|
|
addList: [],
|
|
|
@@ -406,28 +88,36 @@
|
|
|
expirationDateUnit: 'minute',
|
|
|
takeStockPattern: 1
|
|
|
},
|
|
|
- activeName: 'mould',
|
|
|
- productData: [],
|
|
|
- mouldData: [],
|
|
|
- partData: [],
|
|
|
- bomData: [],
|
|
|
- facilityData: [],
|
|
|
- bomNumber: null,
|
|
|
- defaultNum: 'w01',
|
|
|
+ defaultNum: '1',
|
|
|
selectNode: null,
|
|
|
classList: [],
|
|
|
changeData: [],
|
|
|
urlIdList: [],
|
|
|
requestData: {},
|
|
|
- typeValue: [],
|
|
|
- mapList: [],
|
|
|
uneditable: false,
|
|
|
- currentItem: null,
|
|
|
- dialogTitle: '',
|
|
|
newCode: ''
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
+ computed: {
|
|
|
+ typeList () {
|
|
|
+ const noList = this.dict[this.dictEnum['分类编号']] || [];
|
|
|
+
|
|
|
+ return (this.dict[this.dictEnum['类型用途']] || []).map((item) => {
|
|
|
+ const obj =
|
|
|
+ noList.find((itm) => itm.dictCode === item.dictCode) || {};
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ value: `${obj.dictValue} ${item.dictValue}`,
|
|
|
+ name: item.dictValue,
|
|
|
+ prefix: obj.dictValue,
|
|
|
+ code: item.dictCode
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.requestDict('分类编号');
|
|
|
+ this.requestDict('类型用途');
|
|
|
this.pageTitle = this.$route.query.pageTitle;
|
|
|
if (this.pageTitle == '新建物品') {
|
|
|
this.selectNode = JSON.parse(this.$route.query.selectNode);
|
|
|
@@ -436,22 +126,10 @@
|
|
|
this.itemForm.classificationId = this.selectNode.id;
|
|
|
let code = 1;
|
|
|
if (this.selectNode.id != '0') {
|
|
|
- code = this.selectNode.type;
|
|
|
- this.typeList.map((item) => {
|
|
|
- if (item.code == code) {
|
|
|
- this.currentItem = item;
|
|
|
- this.defaultNum = item.prefix;
|
|
|
- this.setDefault(this.defaultNum);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.currentItem = {
|
|
|
- id: 1,
|
|
|
- value: 'w01 生产设备',
|
|
|
- prefix: 'w01',
|
|
|
- code: 1
|
|
|
- };
|
|
|
+ this.defaultNum = this.selectNode.type;
|
|
|
+ this.setDefault(this.defaultNum);
|
|
|
}
|
|
|
+ this.itemForm.urlIdList = this.selectNode.urlIdList;
|
|
|
this.getTreeData(code);
|
|
|
}
|
|
|
} else {
|
|
|
@@ -465,8 +143,8 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async getOrderCode() {
|
|
|
- const res = await getOrderNo({ prefix: this.defaultNum });
|
|
|
+ async getOrderCode () {
|
|
|
+ const res = await getOrderNo(this.defaultNum);
|
|
|
if (res.success) {
|
|
|
this.newCode = res.data;
|
|
|
this.$set(this.itemForm, 'itemCode', res.data.substring(3));
|
|
|
@@ -474,27 +152,18 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getCode(code) {
|
|
|
- this.typeList.map((item) => {
|
|
|
- if (item.code == code) {
|
|
|
- this.defaultNum = item.prefix;
|
|
|
- this.setDefault(this.defaultNum);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
// 在 Input 值改变时触发
|
|
|
- handleEdit(e) {
|
|
|
+ handleEdit (e) {
|
|
|
let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
|
|
|
value = value.replace(/(\d{15})\d*/, '$1'); // 最多保留15位整数
|
|
|
},
|
|
|
- goBack() {
|
|
|
+ goBack () {
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
|
|
|
// 获取详情
|
|
|
- async getDetilInfo(id) {
|
|
|
- const res = await getDetails({ id: id });
|
|
|
+ async getDetilInfo (id) {
|
|
|
+ const res = await getDetails(id);
|
|
|
if (res.success) {
|
|
|
this.defaultNum = res.data.classificationCode;
|
|
|
this.chooseItem(res.data.classificationCode);
|
|
|
@@ -533,31 +202,28 @@
|
|
|
: 'false';
|
|
|
this.itemForm.isUnpack = res.data.isUnpack ? 'true' : 'false';
|
|
|
for (const key in this.itemForm.informationRelationMap) {
|
|
|
- this.matchList(key, this.itemForm.informationRelationMap);
|
|
|
+ this.$refs.itemMatchRef &&
|
|
|
+ this.$refs.itemMatchRef.matchList(
|
|
|
+ key,
|
|
|
+ this.itemForm.informationRelationMap
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 改变物品类型
|
|
|
- chooseItem(val) {
|
|
|
- if (this.currentItem && this.currentItem.prefix != val) {
|
|
|
- this.initItemForm();
|
|
|
- this.$refs.itemFormRef.$refs.formName.resetFields();
|
|
|
- this.getOrderCode();
|
|
|
- }
|
|
|
- this.typeList.map((item) => {
|
|
|
- if (item.prefix == val) {
|
|
|
- this.currentItem = item;
|
|
|
- this.defaultNum = item.prefix;
|
|
|
- this.itemForm.classificationCode = this.defaultNum;
|
|
|
- this.selectNode = null;
|
|
|
- this.getTreeData(item.code);
|
|
|
- }
|
|
|
- });
|
|
|
- this.setDefault(this.defaultNum);
|
|
|
+ chooseItem (item) {
|
|
|
+ this.defaultNum = item.code;
|
|
|
+ this.initItemForm();
|
|
|
+ this.$refs.itemFormRef.$refs.formName.resetFields();
|
|
|
+ this.getOrderCode();
|
|
|
+ this.itemForm.classificationCode = item.prefix;
|
|
|
+ this.selectNode = null;
|
|
|
+ this.getTreeData(item.code);
|
|
|
+ this.setDefault(item.code);
|
|
|
},
|
|
|
|
|
|
- submit() {
|
|
|
+ submit () {
|
|
|
const a1 = new Promise((resolve, reject) => {
|
|
|
this.$refs.itemFormRef.validateForm((valid) => {
|
|
|
if (valid) resolve();
|
|
|
@@ -569,7 +235,8 @@
|
|
|
});
|
|
|
});
|
|
|
Promise.all([a1, a2]).then(() => {
|
|
|
- this.mapAddList();
|
|
|
+ this.$refs.itemMatchRef && this.$refs.itemMatchRef.mapAddList();
|
|
|
+
|
|
|
this.requestData = this.itemForm;
|
|
|
const { pathName, pathId } = this.$refs.itemFormRef.getText();
|
|
|
this.requestData.classificationUrl = pathName;
|
|
|
@@ -594,11 +261,10 @@
|
|
|
this.requestData.univalence = this.itemForm.univalence
|
|
|
? this.itemForm.univalence
|
|
|
: null;
|
|
|
- this.mapList.map((item) => {
|
|
|
- item.informationId = item.id;
|
|
|
- delete item.id;
|
|
|
- });
|
|
|
- this.requestData.informationRelation = this.mapList;
|
|
|
+ this.requestData.informationRelation =
|
|
|
+ (this.$refs.itemMatchRef && this.$refs.itemMatchRef.getMapList()) ||
|
|
|
+ [];
|
|
|
+
|
|
|
if (this.pageTitle == '编辑物品') {
|
|
|
this.requestData.mainInformationId = this.$route.query.id;
|
|
|
delete this.requestData.informationRelationMap;
|
|
|
@@ -636,77 +302,7 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- handleDelete(index, row) {
|
|
|
- this.$confirm(`确认删除[${row.informationName}]吗?`)
|
|
|
- .then(async () => {
|
|
|
- switch (this.activeName) {
|
|
|
- case 'product': {
|
|
|
- this.productData.splice(index, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'mould': {
|
|
|
- this.mouldData.splice(index, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'part': {
|
|
|
- this.partData.splice(index, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'bom': {
|
|
|
- this.bomData.splice(index, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'facility': {
|
|
|
- this.facilityData.splice(index, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- this.mapAddList();
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
-
|
|
|
- //点击添加打开弹窗
|
|
|
- clickAdd(val, name) {
|
|
|
- this.$refs.addDialogRef.equipmentdialog = true;
|
|
|
- if (val) {
|
|
|
- this.typeValue = val;
|
|
|
- this.dialogTitle = name;
|
|
|
- this.mapAddList();
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 选择的设备
|
|
|
- selectedEquipment(val) {
|
|
|
- switch (this.activeName) {
|
|
|
- case 'product': {
|
|
|
- this.productData = val;
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'mould': {
|
|
|
- this.mouldData = val;
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'part': {
|
|
|
- this.partData = val;
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'bom': {
|
|
|
- this.bomData = val;
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'facility': {
|
|
|
- this.facilityData = val;
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- async getTreeData(code) {
|
|
|
+ async getTreeData (code) {
|
|
|
// try {
|
|
|
// const res = await common.getClassify({
|
|
|
// type: code,
|
|
|
@@ -730,7 +326,7 @@
|
|
|
// } catch (error) {}
|
|
|
},
|
|
|
|
|
|
- convertTreeData(data) {
|
|
|
+ convertTreeData (data) {
|
|
|
this.changeData = data;
|
|
|
for (let i = 0; i < this.changeData.length; i++) {
|
|
|
if (this.changeData[i].children != undefined) {
|
|
|
@@ -742,7 +338,7 @@
|
|
|
},
|
|
|
|
|
|
// 子节点处理
|
|
|
- deepEach(parentId) {
|
|
|
+ deepEach (parentId) {
|
|
|
this.changeData.map((item, index) => {
|
|
|
if (item.id == parentId) {
|
|
|
this.urlIdList.push(item.id);
|
|
|
@@ -751,106 +347,11 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- setDefault(val) {
|
|
|
- switch (val) {
|
|
|
- case 'w06': {
|
|
|
- this.activeName = 'product';
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w01': {
|
|
|
- this.activeName = 'mould';
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w07': {
|
|
|
- this.activeName = 'mould';
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w04': {
|
|
|
- this.activeName = 'product';
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w05': {
|
|
|
- this.activeName = 'facility';
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 物品类型格式化
|
|
|
- classificationCodeFormatter(row) {
|
|
|
- let itemName = '';
|
|
|
- this.typeList.map((item) => {
|
|
|
- if (item.prefix == row.classificationCode) {
|
|
|
- itemName = item.name;
|
|
|
- }
|
|
|
- });
|
|
|
- return itemName;
|
|
|
- },
|
|
|
-
|
|
|
- // 收缩系数格式化
|
|
|
- shrinkFormatter(row) {
|
|
|
- let shrink = '';
|
|
|
- let extendField = JSON.parse(row.extendField);
|
|
|
- if (extendField.hasOwnProperty('shrinkageCoefficient')) {
|
|
|
- shrink = extendField.shrinkageCoefficient;
|
|
|
- }
|
|
|
- return shrink;
|
|
|
- },
|
|
|
-
|
|
|
- modleFormatter(row) {
|
|
|
- let modle = '';
|
|
|
- let extendField = JSON.parse(row.extendField);
|
|
|
- if (extendField.hasOwnProperty('dieBodyModel')) {
|
|
|
- modle = extendField.dieBodyModel;
|
|
|
- }
|
|
|
- return modle;
|
|
|
- },
|
|
|
-
|
|
|
- mapAddList() {
|
|
|
- this.mapList = [];
|
|
|
- if (this.defaultNum == 'w01') {
|
|
|
- this.mapList = this.partData.concat(this.mouldData);
|
|
|
- } else if (this.defaultNum == 'w04') {
|
|
|
- this.mapList = this.facilityData.concat(this.productData);
|
|
|
- } else if (this.defaultNum == 'w05') {
|
|
|
- this.mapList = this.facilityData;
|
|
|
- } else if (this.defaultNum == 'w06') {
|
|
|
- this.mapList = this.productData;
|
|
|
- } else if (this.defaultNum == 'w07') {
|
|
|
- this.mapList = this.mouldData.concat(this.bomData);
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- matchList(key, data) {
|
|
|
- switch (key) {
|
|
|
- case 'w01': {
|
|
|
- this.facilityData = data[key];
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w04': {
|
|
|
- this.mouldData = data[key];
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w05': {
|
|
|
- this.partData = data[key];
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w07': {
|
|
|
- this.productData = data[key];
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'w06': {
|
|
|
- this.bomData = data[key];
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+ setDefault (val) {
|
|
|
+ this.$refs.itemMatchRef && this.$refs.itemMatchRef.setDefault(val);
|
|
|
},
|
|
|
|
|
|
- initItemForm() {
|
|
|
+ initItemForm () {
|
|
|
this.itemForm = {
|
|
|
classificationUrlId: [],
|
|
|
addList: [],
|
|
|
@@ -866,90 +367,99 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- :deep(.page-title) {
|
|
|
- border-bottom: 1px solid #eaeefb;
|
|
|
- padding-bottom: 8px;
|
|
|
- margin-bottom: 16px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- .el-page-header__left {
|
|
|
+ .ele-body {
|
|
|
+ :deep(.page-title) {
|
|
|
+ border-bottom: 1px solid #eaeefb;
|
|
|
+ padding-bottom: 8px;
|
|
|
+ margin-bottom: 16px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ .el-page-header__left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .pageContent {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #303133;
|
|
|
+ .topform {
|
|
|
+ // margin: 5px 0 0 30px;
|
|
|
+ margin-left: 30px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .el-form-item {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .pageContent {
|
|
|
+ .table-container {
|
|
|
+ flex: 1;
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 18px;
|
|
|
- color: #303133;
|
|
|
- .topform {
|
|
|
- margin: 5px 0 0 30px;
|
|
|
+ overflow: hidden;
|
|
|
+ .tree-col {
|
|
|
+ margin-right: 10px;
|
|
|
+ width: 30%;
|
|
|
+ min-width: 250px;
|
|
|
+ overflow: auto;
|
|
|
+ padding: 20px 20px 20px 0px;
|
|
|
+ background-color: #fff;
|
|
|
+ margin-top: 10px;
|
|
|
+ border: 1px solid #e6ebf5;
|
|
|
+ border-radius: 4px;
|
|
|
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .table-container {
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- overflow: hidden;
|
|
|
- .tree-col {
|
|
|
- margin-right: 10px;
|
|
|
- width: 30%;
|
|
|
- min-width: 250px;
|
|
|
- overflow: auto;
|
|
|
- padding: 20px 20px 20px 0px;
|
|
|
- background-color: #fff;
|
|
|
+
|
|
|
+ :deep(.attribute-row) {
|
|
|
+ padding: 20px 5px;
|
|
|
+ background: #fff;
|
|
|
margin-top: 10px;
|
|
|
+ overflow: auto;
|
|
|
+ width: 70%;
|
|
|
border: 1px solid #e6ebf5;
|
|
|
border-radius: 4px;
|
|
|
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- :deep(.attribute-row) {
|
|
|
- padding: 20px 5px;
|
|
|
- background: #fff;
|
|
|
- margin-top: 10px;
|
|
|
- overflow: auto;
|
|
|
- width: 70%;
|
|
|
- border: 1px solid #e6ebf5;
|
|
|
- border-radius: 4px;
|
|
|
- box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
|
|
|
- position: relative;
|
|
|
- .row-table {
|
|
|
- width: 100%;
|
|
|
- margin: 20px auto 80px;
|
|
|
- .table-box {
|
|
|
- width: 100%;
|
|
|
- margin: 10px auto;
|
|
|
- // max-height:400px;
|
|
|
- // overflow-y: auto;
|
|
|
- }
|
|
|
- .bom-top {
|
|
|
+ position: relative;
|
|
|
+ .row-table {
|
|
|
width: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: flex-start;
|
|
|
- .top-input {
|
|
|
- margin-left: 20px;
|
|
|
+ margin: 20px auto 80px;
|
|
|
+ .table-box {
|
|
|
+ width: 100%;
|
|
|
+ margin: 10px auto;
|
|
|
+ // max-height:400px;
|
|
|
+ // overflow-y: auto;
|
|
|
+ }
|
|
|
+ .bom-top {
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: flex-start;
|
|
|
- .input-box {
|
|
|
- width: 150px;
|
|
|
- margin: 0 10px;
|
|
|
+ .top-input {
|
|
|
+ margin-left: 20px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ .input-box {
|
|
|
+ width: 150px;
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .page-footer-btn {
|
|
|
- background: #fff;
|
|
|
- z-index: 1;
|
|
|
- position: absolute;
|
|
|
- bottom: 20px;
|
|
|
- right: 0px;
|
|
|
- text-align: right;
|
|
|
- width: 100%;
|
|
|
- border-top: 1px solid #e6ebf5;
|
|
|
- padding: 20px 20px 0 0;
|
|
|
+ .page-footer-btn {
|
|
|
+ background: #fff;
|
|
|
+ z-index: 1;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 20px;
|
|
|
+ right: 0px;
|
|
|
+ text-align: right;
|
|
|
+ width: 100%;
|
|
|
+ border-top: 1px solid #e6ebf5;
|
|
|
+ padding: 20px 20px 0 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|