| | |
| | | <!-- |
| | | * @Date: 2024-05-12 20:02:31 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-15 22:46:30 |
| | | * @LastEditTime: 2024-06-16 16:18:18 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/tooling/Tray.vue |
| | | --> |
| | | <template> |
| | |
| | | <el-aside width="200px"> |
| | | <el-container> |
| | | <el-main> |
| | | <el-tree default-expand-all ref="group" node-key="id" :data="treeData" :props="{ |
| | | label: 'name', |
| | | disabled: 'isGroup' |
| | | }" @node-click="nodeClick"> |
| | | <el-tree :expand-on-click-node="false" default-expand-all ref="group" node-key="id" :data="treeData" |
| | | :props="{ |
| | | label: 'name', |
| | | disabled: 'isGroup' |
| | | }" @node-click="nodeClick"> |
| | | <template #default="{ node, data }"> |
| | | <div :class="data.isGroup ? 'active' : ''" class="custom-tree-node"> |
| | | <span>{{ node.label || data.code }}</span> |
| | |
| | | <el-container v-if="selectNode.id"> |
| | | <el-header> |
| | | <el-button @click="table_add" type="primary" icon="el-icon-plus"></el-button> |
| | | <import-table style="margin:0 8px" :exportUrl="exportUrl" :uploadUrl="uploadUrl"></import-table> |
| | | <import-table style="margin:0 8px" exportUrl="/api/smis/tray/excel/template" |
| | | uploadUrl="/api/smis/tray/import-tray"></import-table> |
| | | <el-button type="danger" plain icon="el-icon-delete" @click="batchDel"></el-button> |
| | | <el-input v-model="params.keyword" style="width: 240px;margin-left: auto;" placeholder="请输入检索内容" |
| | | clearable></el-input> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="托盘类别" prop="category"> |
| | | <el-select style="width: 240px" v-model="trayForm.category" placeholder=""> |
| | | <el-option label="激活" :value="1" /> |
| | | <el-option label="冻结" :value="0" /> |
| | | <el-option v-for="item in tray_category" :key="item.value" :label="item.label" |
| | | :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="托盘规格" prop="standardModel"> |
| | |
| | | ...data, |
| | | ...this.params |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/tray/page/${this.selectNode.id}`, {}, { params }).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/tray/page/${this.selectNode.id}`, {}, { params }).then(res => { |
| | | return res |
| | | }) |
| | | } |
| | |
| | | availability: [ |
| | | { required: true, message: '必填' } |
| | | ], |
| | | } |
| | | }, |
| | | tray_category: [] |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | created() { |
| | | this.init() |
| | | this.$HTTP.get(`/api/blade-system/dict/dictionary?code=tray_category`).then(res => { |
| | | this.tray_category = res.data.map(v => ({ |
| | | label: v.dictValue, |
| | | value: v.dictKey |
| | | })) |
| | | }) |
| | | }, |
| | | methods: { |
| | | addTrayGroup() { |
| | |
| | | this.visibleGroup = true |
| | | }, |
| | | delArea(data) { |
| | | this.$HTTP.delete(`/api/blade-cps/tray/remove-tree?id=${data.id}`).then(res => { |
| | | this.$HTTP.delete(`/api/smis/tray/remove-tree?id=${data.id}`).then(res => { |
| | | this.init() |
| | | }) |
| | | }, |
| | | saveGroup() { |
| | | if (!this.formGroup.id) { |
| | | this.$HTTP.post(`/api/blade-cps/group`, { |
| | | this.$HTTP.post(`/api/smis/group`, { |
| | | groupCategory: 1, |
| | | groupType: "group_tray", |
| | | parentId: this.selectNode.id, |
| | |
| | | this.init() |
| | | }) |
| | | } else { |
| | | this.$HTTP.put(`/api/blade-cps/group`, { |
| | | this.$HTTP.put(`/api/smis/group`, { |
| | | groupCategory: 1, |
| | | groupType: "group_tray", |
| | | parentId: this.selectNode.id, |
| | |
| | | this.trayForm.groupId = node.id |
| | | }, |
| | | confirm() { |
| | | this.$HTTP.post(`/api/blade-cps/tray/save`, { |
| | | this.$HTTP.post(`/api/smis/tray/save`, { |
| | | ...this.trayForm |
| | | }).then(res => { |
| | | this.dialog = false |
| | |
| | | }) |
| | | }, |
| | | init() { |
| | | this.$HTTP.post(`/api/blade-cps/tray/tooling-tree`, { |
| | | this.$HTTP.post(`/api/smis/tray/tooling-tree`, { |
| | | groupCategory: 1, |
| | | groupType: "group_tray" |
| | | }).then(res => { |
| | |
| | | queryInfo() { |
| | | if (!this.selectNode.id) return |
| | | this.$refs?.table?.reload() |
| | | // this.$HTTP.get(`/api/blade-cps/tray/${this.selectNode.id}`).then(res => { |
| | | // this.$HTTP.get(`/api/smis/tray/${this.selectNode.id}`).then(res => { |
| | | // this.info = res.data |
| | | // }) |
| | | // this.$HTTP.get(`/api/blade-cps/tray-surface/list/${this.selectNode.id}`).then(res => { |
| | | // this.$HTTP.get(`/api/smis/tray-surface/list/${this.selectNode.id}`).then(res => { |
| | | // this.info = res.data |
| | | // }) |
| | | }, |
| | |
| | | async queryChildInfo(id) { |
| | | if (!id) return |
| | | this.showLoading = true |
| | | await this.$HTTP.get(`/api/blade-cps/tray/${id}`).then(res => { |
| | | await this.$HTTP.get(`/api/smis/tray/${id}`).then(res => { |
| | | this.info = res.data |
| | | }) |
| | | await this.$HTTP.get(`/api/blade-cps/tray-surface/list/${id}`).then(res => { |
| | | await this.$HTTP.get(`/api/smis/tray-surface/list/${id}`).then(res => { |
| | | this.infoList = res.data |
| | | }) |
| | | this.showLoading = false |
| | |
| | | this.visible = true |
| | | }, |
| | | table_del1(row) { |
| | | this.$HTTP.delete(`/api/blade-cps/tray-surface/remove-face/${this.info.id}?faceId=${row.id}`).then(res => { |
| | | this.$HTTP.delete(`/api/smis/tray-surface/remove-face/${this.info.id}?faceId=${row.id}`).then(res => { |
| | | this.$message.success('操作成功') |
| | | this.queryChildInfo(this.info.id) |
| | | }) |
| | | }, |
| | | saveTray() { |
| | | if (this.form.id) { |
| | | return this.$HTTP.put(`/api/blade-cps/tray-surface/update`, this.form).then(res => { |
| | | return this.$HTTP.put(`/api/smis/tray-surface/update`, this.form).then(res => { |
| | | this.visible = false |
| | | this.queryChildInfo(this.info.id) |
| | | }) |
| | | } |
| | | this.$HTTP.post(`/api/blade-cps/tray-surface/save`, this.form).then(res => { |
| | | this.$HTTP.post(`/api/smis/tray-surface/save`, this.form).then(res => { |
| | | this.visible = false |
| | | this.queryChildInfo(this.info.id) |
| | | }) |