diff --git a/src/views/base-data/box/index.vue b/src/views/base-data/box/index.vue index 7f6e0be..bd717f7 100644 --- a/src/views/base-data/box/index.vue +++ b/src/views/base-data/box/index.vue @@ -5,226 +5,122 @@
- - - - - + v-model="query.pointCode" + clearable + placeholder="请输入点位编码" + style="width: 185px;" + class="filter-item" + @keyup.enter.native="crud.toQuery"/> - - + - - - - - -
- - - - - 预装按钮盒绑定 - - - 按钮盒呼叫 - + - - - - + + - - + - - - + + - {{ point.code }} - {{ point.area.name }} - - - - - - - - - {{ item.code}} - {{ item.name }} - - - - - - - - - - - - - - + /> + - - - + + + border + ref="table" + v-loading="crud.loading" + :data="crud.data" + size="small" + style="width: 100%;" + @selection-change="crud.selectionChangeHandler"> - - + - - - - - - - - - - - - + - - -
@@ -241,38 +137,34 @@ import rrOperation from '@crud/RR.operation' import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' -import {getItemsList} from "@/api/item" -import pointUrl, {queryPointList} from "@/api/point" -import {getAres, queryAreaList} from "@/api/area" -import BindOrderNumber from "@/views/base-data/box/bindOrderNumber.vue" +import {getItems} from "@/api/item" +import crudPoint, {getPoints} from "@/api/point" import DonMessage from '@/utils/message' +import crudBillType from '@/api/billType' +import { mapGetters } from 'vuex' +import { getToken } from '@/utils/auth' const defaultForm = { - name:null, - code:null, id: null, + code: null, item: null, point: null, - orderNumber:null, createBy: null, updateBy: null, createTime: null, - updateTime: null, - iP:null, - lampStatus:null, - lampCode:null + updateTime: null } export default { name: 'Box', - components: {pagination, crudOperation, rrOperation, udOperation, BindOrderNumber}, + components: {pagination, crudOperation, rrOperation, udOperation}, mixins: [presenter(), header(), form(defaultForm), crud()], - dicts: ['base_staus','lamp_status','lamp_code'], + dicts: ['base_staus', 'bill_type'], cruds() { return CRUD({ - title: '按钮盒', + title: '工作站配置', url: 'api/box', idField: 'id', - sort: 'name', + sort: 'id,desc', crudMethod: {...crudBox}, optShow: { add: true, @@ -284,29 +176,32 @@ export default { }) }, + computed: { + ...mapGetters([ + 'baseApi', + 'boxUploadApi' + ]) + }, + mounted() { + this.getPoint() + }, data() { return { + headers: { 'Authorization': getToken() }, items: [], - points: [], - pointsUpdate:[], - pointsInsert:[], - areas: [], + pointList: [], params: { - type: 'BOX', - status:'FREE', - enabled:1 + type: '' }, permission: { add: ['admin', 'box:add'], edit: ['admin', 'box:edit'], - del: ['admin', 'box:del'] - }, - CallBox: { - id: '' + del: ['admin', 'box:del'], + callBox: ['admin', 'box:callBox'] }, rules: { - orderNumber: [ - {required: true, message: '工单号必填', trigger: 'blur'} + code: [ + {required: true, message: '编号必填', trigger: 'blur'} ], item: [ {required: true, message: '物料必填', trigger: 'blur'} @@ -317,24 +212,46 @@ export default { } } }, - mounted() { - //编辑下拉出现内容 - this.getItem(); - }, methods: { // 钩子:在获取表格数据之前执行,false 则代表不获取数据 [CRUD.HOOK.beforeRefresh]() { return true }, - getItem() { - getItemsList({}).then(res => { - this.items = res; + // 加载地标 + getPoint() { + crudPoint.getPoints({ }).then(res => { + this.pointList = res.map(function(obj) { + if (obj.hasChildren) { + obj.children = null + } + return obj + }) }) }, - getArea() { - queryAreaList({ }).then(res => { - this.areas= res; - }) + callBox(datas) { + if (this.$refs.table.selection.length >= 1) { + this.$confirm(`选中的${datas.length}条数据呼叫确认?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const ids = []; + for (let i = 0; i < datas.length; i++) { + ids.push(datas[i].id) + } + crudBox.callBox(ids).then(res => { + this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.SUCCESS) + this.crud.toQuery(); + }) + + }).catch(() => { + this.$refs.table.clearSelection() + DonMessage.info('取消成功!') + }); + } else { + DonMessage.error('请至少选中一条记录!') + } + }, changeEnabled(data, val) { this.$confirm('此操作将 "' + this.dict.label.base_staus[val] + '" ' + data.code + ', 是否继续?', '提示', { @@ -350,36 +267,6 @@ export default { }).catch(() => { data.enabled = !data.enabled }) - }, - bindOrder() { - this.$refs.bindOrderNumber.dialogVisible = true - }, - //呼叫按钮 - callBox(data) { - this.CallBox.id=data.id - crudBox.callBox(this.CallBox).then(res => { - if(res.status==200){ - this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.SUCCESS); - this.$parent.shuaxinContainerList() - this.$refs['form'].resetFields(); - }else{ - this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR); - } - }).catch(() => { - this.crud.notify("呼叫失败", CRUD.NOTIFICATION_TYPE.ERROR); - }) - }, - //单选时触发 - selectOneMethod(selection, row){ - if (selection.length===1){ - this.points=this.pointsUpdate; - }else { - this.points=this.pointsInsert; - } - }, - //全选时触发 - selectAllMethod(selection){ - this.points=this.pointsInsert; } } } diff --git a/src/views/base-data/point/index.vue b/src/views/base-data/point/index.vue index 06f3850..95f191d 100644 --- a/src/views/base-data/point/index.vue +++ b/src/views/base-data/point/index.vue @@ -187,7 +187,7 @@
- diff --git a/src/views/business-data/asn/index.vue b/src/views/business-data/asn/index.vue index 4c180f5..3017064 100644 --- a/src/views/business-data/asn/index.vue +++ b/src/views/business-data/asn/index.vue @@ -79,7 +79,7 @@ - +