| | |
| | | |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick({ code }) { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'edit':{ |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'edit': { |
| | | |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | if (selectRecords.length > 0) { |
| | | const errMap = await $grid.validate(selectRecords) |
| | | console.log(errMap) |
| | | if (errMap) { |
| | | ElMessage.warning("数据校验失败") |
| | | return |
| | | } |
| | | } else { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | |
| | | let flowData = ref({ |
| | | |
| | | userId:userid, |
| | | userName:username, |
| | | userId: userid, |
| | | userName: username, |
| | | |
| | | orderDetail:selectRecords |
| | | orderDetail: selectRecords |
| | | }) |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryAllocate",flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryAllocate", flowData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | ElMessage.success("调拨成功") |
| | | location.reload(); |
| | | }else{ |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return; |
| | | } |
| | | case 'record':{ |
| | | case 'record': { |
| | | router.push({path: '/main/productStock/TransferRecord'}); |
| | | return; |
| | | break; |
| | | } |
| | | case 'rework':{ |
| | | case 'rework': { |
| | | router.push({path: '/main/productStock/FinishedProductRework'}); |
| | | return; |
| | | break; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | orderId: [ |
| | | { required: true, message: '请输入调拨的订单号' } |
| | | ], |
| | | orderNumber: [ |
| | | { required: true, message: '请输入调拨的订单序号' } |
| | | ], |
| | | quantity: [ |
| | | { required: true, message: '请输入调拨的数量' } |
| | | ] |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :edit-rules="validRules" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |