diff --git a/src/components/Crud/crud.js b/src/components/Crud/crud.js index 3a237f5..7934088 100644 --- a/src/components/Crud/crud.js +++ b/src/components/Crud/crud.js @@ -379,7 +379,7 @@ function CRUD(options) { // 选中单条行 clickRow(row) { crud.getTable().clearSelection() - crud.getTable().toggleRowSelection(row,true) + crud.getTable().toggleRowSelection(row, true) crud.selections = crud.getTable().selections }, /** @@ -498,6 +498,18 @@ function CRUD(options) { return crud.vms.find(vm => vm && vm.type === type).vm }, notify(title, type = CRUD.NOTIFICATION_TYPE.INFO) { + if (type === 200) { + type = CRUD.NOTIFICATION_TYPE.SUCCESS + } + if (type === 201) { + type = CRUD.NOTIFICATION_TYPE.WARNING + } + if (type === 500) { + type = CRUD.NOTIFICATION_TYPE.ERROR + } + if (type === 400) { + type = CRUD.NOTIFICATION_TYPE.INFO + } crud.vms[0].vm.$notify({ title, type, diff --git a/src/views/business-data/pickDetail/index.vue b/src/views/business-data/pickDetail/index.vue index a5b6380..749b891 100644 --- a/src/views/business-data/pickDetail/index.vue +++ b/src/views/business-data/pickDetail/index.vue @@ -71,7 +71,7 @@ type="success" icon="el-icon-edit" size="mini" - :disabled="show_fp" + :disabled="crud.selections.length !== 1 || this.crud.selections[0].orderQty<=this.crud.selections[0].allocatedQty" @click="allocate(crud.selections)" > 分配 @@ -270,6 +270,7 @@ import pagination from '@crud/Pagination' import { getItems, getItemsList } from '@/api/item' import PickTask from '@/views/business-data/pickDetail/pickTicketTask.vue' import DateRangePicker from '@/components/DateRangePicker/index.vue' +import DonMessage from "@/utils/message"; const defaultForm = { id: null, @@ -324,7 +325,6 @@ export default { }, data() { return { - show_fp: true, show_jh: true, show_cancelfp: true, radio3: '全部', @@ -412,12 +412,11 @@ export default { for (let i = 0; i < datas.length; i++) { ids.push(datas[i].id) } - console.log('ids:' + ids) crudPickDetail.allocate(ids).then(res => { - this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) + this.crud.notify(res.message, res.status) this.crud.toQuery() }).catch(() => { - + this.crud.toQuery() }) }).catch(() => { this.$refs.table.clearSelection()