|
|
@@ -38,7 +38,6 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<template v-slot:enabled="{ row }">
|
|
|
{{ dict.enabled[row.enabled] }}
|
|
|
</template>
|
|
|
@@ -77,181 +76,183 @@
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
- <edit
|
|
|
- ref="edit"
|
|
|
- @done="done"
|
|
|
-
|
|
|
- ></edit>
|
|
|
+ <edit ref="edit" @done="done"></edit>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
-import search from './components/search.vue';
|
|
|
-import edit from './components/edit.vue';
|
|
|
-import {
|
|
|
- deleteFactoryworkstation,
|
|
|
- getFactoryworkstation,
|
|
|
- getFactoryarea
|
|
|
-} from '@/api/factoryModel';
|
|
|
-import { listOrganizations } from '@/api/system/organization';
|
|
|
-export default {
|
|
|
- mixins: [tabMixins],
|
|
|
- components: {
|
|
|
- search,
|
|
|
- edit
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- columns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'index',
|
|
|
- columnKey: 'index',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '工位编码'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '工位名称',
|
|
|
- prop: 'name'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '责任人',
|
|
|
- prop: 'leaderName',
|
|
|
- slot: 'factory'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '所属区域',
|
|
|
- prop: 'areaName',
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '所属工厂',
|
|
|
- prop: 'factoryName',
|
|
|
-
|
|
|
- },
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import search from './components/search.vue';
|
|
|
+ import edit from './components/edit.vue';
|
|
|
+ import {
|
|
|
+ deleteFactoryworkstation,
|
|
|
+ getFactoryworkstation,
|
|
|
+ getFactoryarea
|
|
|
+ } from '@/api/factoryModel';
|
|
|
+ import { listOrganizations } from '@/api/system/organization';
|
|
|
+ export default {
|
|
|
+ mixins: [tabMixins],
|
|
|
+ components: {
|
|
|
+ search,
|
|
|
+ edit
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'index',
|
|
|
+ columnKey: 'index',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '工位编码'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '工位名称',
|
|
|
+ prop: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '责任人',
|
|
|
+ prop: 'leaderName',
|
|
|
+ slot: 'factory'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '所属区域',
|
|
|
+ prop: 'areaName'
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- label: '所属厂房',
|
|
|
- prop: 'workshopPlanName',
|
|
|
+ {
|
|
|
+ label: '所属工厂',
|
|
|
+ prop: 'factoryName'
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
- {
|
|
|
- label: '所属车间',
|
|
|
- prop: 'workshopName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '所属产线',
|
|
|
- prop: 'productionLineName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '节拍时间',
|
|
|
- prop: 'extInfo.meterTime',
|
|
|
- slot: 'meterTime'
|
|
|
- },
|
|
|
- {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
|
|
|
- label: '状态',
|
|
|
- prop: 'enabled',
|
|
|
- slot: 'enabled',
|
|
|
- filters: [
|
|
|
+ {
|
|
|
+ label: '所属厂房',
|
|
|
+ prop: 'workshopPlanName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '所属车间',
|
|
|
+ prop: 'workshopName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '所属产线',
|
|
|
+ prop: 'productionLineName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备名称',
|
|
|
+ prop: 'extInfo.assetName',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return typeof cellValue === 'string' ? cellValue :'';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '节拍时间',
|
|
|
+ prop: 'extInfo.meterTime',
|
|
|
+ slot: 'meterTime'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
|
|
|
+ label: '状态',
|
|
|
+ prop: 'enabled',
|
|
|
+ slot: 'enabled',
|
|
|
+ filters: [
|
|
|
{ value: 1, text: '生效' },
|
|
|
- { value: 0, text: '未生效' },
|
|
|
+ { value: 0, text: '未生效' }
|
|
|
],
|
|
|
- filterMultiple: false,
|
|
|
- columnKey: 'enabled'
|
|
|
+ filterMultiple: false,
|
|
|
+ columnKey: 'enabled'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 220,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ dict: {
|
|
|
+ groupId: [],
|
|
|
+ factory: [],
|
|
|
+ enabled: {
|
|
|
+ 1: '生效',
|
|
|
+ 0: '未生效'
|
|
|
+ }
|
|
|
},
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 220,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true
|
|
|
- }
|
|
|
- ],
|
|
|
- dict: {
|
|
|
- groupId: [],
|
|
|
- factory: [],
|
|
|
- enabled: {
|
|
|
- 1: '生效',
|
|
|
- 0: '未生效'
|
|
|
- }
|
|
|
- },
|
|
|
- pageSize: this.$store.state.tablePageSize,
|
|
|
- cacheKeyUrl: 'ef00833a-factoryModel-station'
|
|
|
- };
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.getGs();
|
|
|
- this.getFactoryarea();
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ pageSize: this.$store.state.tablePageSize,
|
|
|
+ cacheKeyUrl: 'ef00833a-factoryModel-station'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getGs();
|
|
|
+ this.getFactoryarea();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
selectType(value) {
|
|
|
- let where = {}
|
|
|
+ let where = {};
|
|
|
if (value.enabled.length > 0) {
|
|
|
- where['enable'] = value.enabled[0]
|
|
|
+ where['enable'] = value.enabled[0];
|
|
|
}
|
|
|
- this.search(where)
|
|
|
+ this.search(where);
|
|
|
+ },
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
+ return getFactoryworkstation({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit
|
|
|
+ });
|
|
|
+ },
|
|
|
+ search(where) {
|
|
|
+ this.$refs.table.reload({
|
|
|
+ where: where,
|
|
|
+ page: 1
|
|
|
+ });
|
|
|
+ },
|
|
|
+ openEdit(type, row) {
|
|
|
+ this.$refs.edit.open(type, row);
|
|
|
},
|
|
|
- datasource ({ page, where, limit }) {
|
|
|
- return getFactoryworkstation({
|
|
|
- ...where,
|
|
|
- pageNum: page,
|
|
|
- size: limit
|
|
|
- });
|
|
|
- },
|
|
|
- search (where) {
|
|
|
- this.$refs.table.reload({
|
|
|
- where: where,
|
|
|
- page: 1
|
|
|
- });
|
|
|
- },
|
|
|
- openEdit (type, row) {
|
|
|
- this.$refs.edit.open(type, row);
|
|
|
- },
|
|
|
|
|
|
- // 获取公司数据
|
|
|
- getGs () {
|
|
|
- listOrganizations().then((list) => {
|
|
|
- this.dict.groupId = JSON.parse(JSON.stringify(list));
|
|
|
- });
|
|
|
- },
|
|
|
- // 回显车间
|
|
|
- showWorkshop (row) {
|
|
|
- let result = row.parent.find((n) => n.id == row.parentId);
|
|
|
- if (result) {
|
|
|
- return result.name;
|
|
|
- } else {
|
|
|
- return '';
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取工厂数据
|
|
|
- getFactoryarea () {
|
|
|
- let par = {
|
|
|
- type: 1,
|
|
|
- size: 9999,
|
|
|
- type: 2,
|
|
|
- };
|
|
|
- getFactoryarea(par).then((res) => {
|
|
|
- this.dict.factory = res.list;
|
|
|
- });
|
|
|
- },
|
|
|
- remove (row) {
|
|
|
- deleteFactoryworkstation(row.id)
|
|
|
- .then((message) => {
|
|
|
- this.$message.success(message);
|
|
|
- this.done();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- this.$message.error(e.message);
|
|
|
+ // 获取公司数据
|
|
|
+ getGs() {
|
|
|
+ listOrganizations().then((list) => {
|
|
|
+ this.dict.groupId = JSON.parse(JSON.stringify(list));
|
|
|
});
|
|
|
- },
|
|
|
- done () {
|
|
|
- this.$refs.search.search();
|
|
|
+ },
|
|
|
+ // 回显车间
|
|
|
+ showWorkshop(row) {
|
|
|
+ let result = row.parent.find((n) => n.id == row.parentId);
|
|
|
+ if (result) {
|
|
|
+ return result.name;
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取工厂数据
|
|
|
+ getFactoryarea() {
|
|
|
+ let par = {
|
|
|
+ type: 1,
|
|
|
+ size: 9999,
|
|
|
+ type: 2
|
|
|
+ };
|
|
|
+ getFactoryarea(par).then((res) => {
|
|
|
+ this.dict.factory = res.list;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ remove(row) {
|
|
|
+ deleteFactoryworkstation(row.id)
|
|
|
+ .then((message) => {
|
|
|
+ this.$message.success(message);
|
|
|
+ this.done();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.$message.error(e.message);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ done() {
|
|
|
+ this.$refs.search.search();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|