出库部分
This commit is contained in:
@@ -73,9 +73,9 @@ public class OutMydoJobController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('job:outmydoJob:pointOut')")
|
||||
@Log(title = "指定货位出库", businessType = BusinessType.INSERT)
|
||||
@RequestMapping("/pointOut")
|
||||
public AjaxResult pointOut(@RequestParam("stockIds")String[] stockIds)
|
||||
public AjaxResult pointOut(@RequestParam("stockIds")String[] stockIds,@RequestParam("exitId")String exitId)
|
||||
{
|
||||
return mydoJobService.pointOut(stockIds);
|
||||
return mydoJobService.pointOut(stockIds,exitId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public interface IMydoJobService
|
||||
*/
|
||||
AjaxResult OuthandInvalidation(String [] jobIds);
|
||||
|
||||
AjaxResult pointOut(String [] stockIds);
|
||||
AjaxResult pointOut(String [] stockIds,String exitId);
|
||||
|
||||
MydoJob selectMydoJobByTrayCode(String trayCode);
|
||||
}
|
||||
|
||||
@@ -480,14 +480,15 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult pointOut(String[] stockIds) {
|
||||
public AjaxResult pointOut(String[] stockIds,String exitId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
String msg = "";
|
||||
String Stringbuilder = "";
|
||||
for (String stockId : stockIds) {
|
||||
map.put("stockId", stockId);
|
||||
map.put("v_stock_id", stockId);
|
||||
map.put("v_exit_id", exitId);
|
||||
mydoJobMapper.pointOut(map);
|
||||
String result = map.get("result").toString();
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
msg = "操作成功!";
|
||||
} else {
|
||||
|
||||
@@ -217,8 +217,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="pointOut" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_point_out(
|
||||
#{stockId,jdbcType=VARCHAR,mode=IN},
|
||||
#{exitId,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_stock_id,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_exit_id,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
|
||||
@@ -28,12 +28,13 @@ export function hangInvalidJob(jobIds) {
|
||||
})
|
||||
}
|
||||
|
||||
export function pointOut(stockIds) {
|
||||
export function pointOut(stockIds,exitId) {
|
||||
return request({
|
||||
url: '/job/outmydoJob/pointOut',
|
||||
method: 'get',
|
||||
params: {
|
||||
stockIds: stockIds.join(',') // 将数组转换为逗号分隔的字符串
|
||||
stockIds: stockIds.join(',') ,// 将数组转换为逗号分隔的字符串
|
||||
exitId:exitId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item :label="$t('outJobManagement.status')" prop="status"> <!-- 状态 -->
|
||||
<el-select v-model="queryParams.status" :placeholder="$t('outJobManagement.selectStatus')" clearable>
|
||||
<el-select v-model="queryParams.status" :placeholder="$t('outJobManagement.selectStatus')" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.mydo_job_status"
|
||||
:key="dict.value"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('outStockoutManage.status')" prop="status"> <!-- 单据状态 -->
|
||||
<el-select v-model="queryParams.status" :placeholder="$t('outStockoutManage.selectStatus')" clearable>
|
||||
<el-select v-model="queryParams.status" :placeholder="$t('outStockoutManage.selectStatus')">
|
||||
<el-option
|
||||
v-for="dict in dict.type.out_bill_status"
|
||||
:key="dict.value"
|
||||
|
||||
@@ -27,16 +27,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.cargoSpaceStockStatus')" prop="cargoSpaceStockStatus"><!-- 货位状态 -->
|
||||
<el-select v-model="queryParams.cargoSpaceStockStatus" :placeholder="$t('stockManagement.cargoSpaceStockStatus')" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.cargo_space_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('stockManagement.cargoSpaceStockStatus')" prop="cargoSpaceStockStatus"><!– 货位状态 –>-->
|
||||
<!-- <el-select v-model="queryParams.cargoSpaceStockStatus" :placeholder="$t('stockManagement.cargoSpaceStockStatus')" clearable>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.cargo_space_status"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item :label="$t('stockManagement.productStatus')" prop="productStatus"><!-- 物料状态 -->
|
||||
<el-select v-model="queryParams.productStatus" :placeholder="$t('stockManagement.selectProductStatus')" clearable>
|
||||
<el-option
|
||||
@@ -202,6 +202,26 @@
|
||||
<el-button @click="cancel">{{$t('stockManagement.cancel')}} <!-- 取消 --></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 出口选择弹窗 -->
|
||||
<el-dialog :title="$t('stockManagement.selectExitTitle')" :visible.sync="exitDialogVisible" width="400px" append-to-body>
|
||||
<el-form ref="exitForm" :model="exitForm" :rules="exitRules" label-width="80px">
|
||||
<el-form-item :label="$t('stockManagement.selectExit')" prop="exitId">
|
||||
<el-select v-model="exitForm.exitId" :placeholder="$t('stockManagement.pleaseSelectExit')" clearable>
|
||||
<el-option
|
||||
v-for="item in exitOptions"
|
||||
:key="item.exitId"
|
||||
:label="item.exitName"
|
||||
:value="item.exitId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitPointOut">{{$t('stockManagement.confirmExit')}}</el-button>
|
||||
<el-button @click="cancelExit">{{$t('stockManagement.cancelExit')}}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -239,6 +259,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockId: null,
|
||||
cargoSpaceStockStatus:'2',
|
||||
cargoSpaceId: null,
|
||||
stockStatus: null,
|
||||
productStatus: null,
|
||||
@@ -270,7 +291,41 @@ export default {
|
||||
/*stockId: [
|
||||
{ required: true, message: this.$t('stockManagement.stockIdRequired'), trigger: "blur" } // 库存id不能为空
|
||||
]*/
|
||||
}
|
||||
},
|
||||
// 出口选择弹窗显示状态
|
||||
exitDialogVisible: false,
|
||||
// 出口表单数据
|
||||
exitForm: {
|
||||
exitId: null
|
||||
},
|
||||
// 出口表单验证规则
|
||||
exitRules: {
|
||||
exitId: [
|
||||
{ required: true, message: this.$t('stockManagement.pleaseSelectExit'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 出口选项
|
||||
exitOptions: [],
|
||||
// 所有出口数据(按仓库ID分组)
|
||||
allExitOptions: {
|
||||
'02': [
|
||||
{ exitId: "G1004", exitName: 'G1004' },
|
||||
{ exitId: 'G1010', exitName: 'G1010' },
|
||||
{ exitId: 'fluent1', exitName: 'fluent1' },
|
||||
{ exitId: 'fluent2', exitName: 'fluent2' },
|
||||
],
|
||||
'13': [
|
||||
{ exitId: 'G2001', exitName: 'G2001' },
|
||||
{ exitId: 'G3001', exitName: 'G3001' },
|
||||
{ exitId: 'G3010', exitName: 'G3010' },
|
||||
{ exitId: 'G4001', exitName: 'G4001' },
|
||||
{ exitId: 'G4010', exitName: 'G4010' },
|
||||
{ exitId: 'G5001', exitName: 'G5001' },
|
||||
{ exitId: 'G5010', exitName: 'G5010' },
|
||||
]
|
||||
},
|
||||
// 选中的库存数据
|
||||
selectedStockData: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -396,23 +451,73 @@ export default {
|
||||
this.$modal.msgError(this.$t('stockManagement.selectAtLeastOneRow')); // 请至少选择一行数据
|
||||
return;
|
||||
}
|
||||
const stockIds = this.ids;
|
||||
// 这里调用API将stockIds数组传给后端
|
||||
// 示例: pointOutApi(stockIds).then(response => {
|
||||
// this.$modal.msgSuccess("出库成功");
|
||||
// this.getList();
|
||||
// });
|
||||
console.log('Selected stockIds:', stockIds);
|
||||
this.$modal.confirm(this.$t('stockManagement.confirmPointOut')).then(() => {
|
||||
// 实际API调用需要根据后端接口进行调整
|
||||
pointOut(stockIds).then(response => {
|
||||
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList();
|
||||
});
|
||||
// 获取选中的完整数据
|
||||
const selectedData = this.managementList.filter(item => this.ids.includes(item.stockId));
|
||||
this.selectedStockData = selectedData;
|
||||
|
||||
// this.$modal.msgSuccess(this.$t('stockManagement.pointOutSuccess')); // 出库成功
|
||||
}).catch(() => {});
|
||||
// 根据选中数据的仓库ID设置出口选项
|
||||
this.setExitOptionsByWarehouse(selectedData);
|
||||
|
||||
// 显示出口选择弹窗
|
||||
this.exitDialogVisible = true;
|
||||
this.exitForm.exitId = null;
|
||||
},
|
||||
|
||||
/** 根据仓库ID设置出口选项 */
|
||||
setExitOptionsByWarehouse(selectedData) {
|
||||
try {
|
||||
// 获取选中数据的仓库ID集合,过滤掉空值和无效值
|
||||
const warehouseIds = [...new Set(
|
||||
selectedData
|
||||
.map(row => row.warehouseId)
|
||||
.filter(id => id !== null && id !== undefined && id !== '')
|
||||
)];
|
||||
|
||||
// 如果没有有效的仓库ID,清空出口选项
|
||||
if (warehouseIds.length === 0) {
|
||||
this.exitOptions = []
|
||||
return
|
||||
}
|
||||
|
||||
if (warehouseIds.length === 1) {
|
||||
// 如果所有选中数据都是同一个仓库,显示该仓库的出口
|
||||
const warehouseId = warehouseIds[0]
|
||||
this.exitOptions = this.allExitOptions[warehouseId] || []
|
||||
}
|
||||
|
||||
// 如果最终没有可用的出口选项,给出默认选项
|
||||
if (this.exitOptions.length === 0) {
|
||||
this.exitOptions=[{exitId: '0', exitName: '人工出口'}]
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('设置出口选项时发生错误:', error)
|
||||
// 发生错误时,设置为空数组,确保不会影响用户操作
|
||||
this.exitOptions = []
|
||||
}
|
||||
},
|
||||
|
||||
/** 提交指定货位出库 */
|
||||
submitPointOut() {
|
||||
this.$refs["exitForm"].validate(valid => {
|
||||
if (valid) {
|
||||
const stockIds = this.ids;
|
||||
// 调用API将stockIds数组和出口信息传给后端
|
||||
console.log("指定货位出库:", stockIds, this.exitForm.exitId)
|
||||
pointOut(stockIds, this.exitForm.exitId).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList();
|
||||
this.exitDialogVisible = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/** 取消出口选择 */
|
||||
cancelExit() {
|
||||
this.exitDialogVisible = false;
|
||||
this.exitForm.exitId = null;
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
||||
Reference in New Issue
Block a user