出库单-整单分配,取消分配
parent
9c86b08e0c
commit
ff99e3ed28
|
|
@ -23,5 +23,19 @@ export function edit(data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function allocate(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/pick/allocate',
|
||||||
|
method: 'post',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default { add, edit, del }
|
export function cancelAllocate(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/pick/cancelAllocate',
|
||||||
|
method: 'post',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, allocate ,cancelAllocate }
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,31 @@
|
||||||
<rrOperation :crud="crud"/>
|
<rrOperation :crud="crud"/>
|
||||||
</div>
|
</div>
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
<crudOperation :permission="permission" :tableKey="tableKey"/>
|
<crudOperation :permission="permission" :tableKey="tableKey">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="crud.selections.length !== 1 || this.crud.selections[0].orderQty<=this.crud.selections[0].allocatedQty"
|
||||||
|
@click="allocate(crud.selections)"
|
||||||
|
>
|
||||||
|
分配
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:loading="crud.delAllLoading"
|
||||||
|
:disabled="crud.selections.length !== 1 || this.crud.selections[0].status!=='ALLOCATE' || this.crud.selections[0].status!=='PICKUP'"
|
||||||
|
@click="cancelAllocate(crud.selections)"
|
||||||
|
>
|
||||||
|
取消分配
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
<!--表单组件-->
|
<!--表单组件-->
|
||||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||||
|
|
@ -97,12 +121,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudPick from '@/api/pick'
|
import crudPick, { allocate,cancelAllocate } from '@/api/pick'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
|
import crudPickDetail from "@/api/pickDetail";
|
||||||
|
|
||||||
const defaultForm = { id: null, deptId: null, billType: null, orderOrigin: null, priority: null, owner: null, relatedBill1: null, relatedBill2: null, sourceName: null, status: null, address: null, dispatchDate: null, erTime: null, createBy: null, updateBy: null, createTime: null, updateTime: null, orderDate: null }
|
const defaultForm = { id: null, deptId: null, billType: null, orderOrigin: null, priority: null, owner: null, relatedBill1: null, relatedBill2: null, sourceName: null, status: null, address: null, dispatchDate: null, erTime: null, createBy: null, updateBy: null, createTime: null, updateTime: null, orderDate: null }
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -131,6 +156,48 @@ export default {
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
|
},
|
||||||
|
allocate(datas) {
|
||||||
|
this.$confirm(`选中的${datas.length}条数据分配确认?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const ids = []
|
||||||
|
for (let i = 0; i < datas.length; i++) {
|
||||||
|
ids.push(datas[i].id)
|
||||||
|
}
|
||||||
|
crudPick.allocate(ids).then(res => {
|
||||||
|
this.crud.notify(res.message, res.status)
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.crud.notify('取消成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancelAllocate(datas) {
|
||||||
|
this.$confirm(`选中的${datas.length}条数据取消分配确认?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const ids = []
|
||||||
|
for (let i = 0; i < datas.length; i++) {
|
||||||
|
ids.push(datas[i].id)
|
||||||
|
}
|
||||||
|
crudPick.cancelAllocate(ids).then(res => {
|
||||||
|
this.crud.notify(res.message, res.status)
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.crud.notify('取消成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue