|
|
@ -3,6 +3,29 @@ |
|
|
|
<!--工具栏--> |
|
|
|
<div class="head-container"> |
|
|
|
<div v-if="crud.props.searchToggle"> |
|
|
|
<el-dialog |
|
|
|
title="选择异常出库原因" |
|
|
|
:visible.sync="reasonDialogVisible" |
|
|
|
width="30%" |
|
|
|
:before-close="closeReasonDialog" |
|
|
|
> |
|
|
|
<el-form ref="reasonForm" :model="reasonForm" label-width="80px"> |
|
|
|
<el-form-item label="原因" prop="reason"> |
|
|
|
<el-select v-model="reasonForm.reason" placeholder="请选择异常出库原因"> |
|
|
|
<el-option |
|
|
|
v-for="item in dict.reason" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="closeReasonDialog">取消</el-button> |
|
|
|
<el-button type="primary" @click="submitReason">确认</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-form |
|
|
|
:inline="true" |
|
|
|
class="demo-form-inline" |
|
|
@ -302,6 +325,15 @@ |
|
|
|
:data="scope.row" |
|
|
|
:permission="permission" |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
v-if="showQtyButton(scope.row.vehicle_qty,scope.row.region_code)" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-view" |
|
|
|
@click="openReasonDialog(scope.row)" |
|
|
|
> |
|
|
|
异常出库 |
|
|
|
</el-button> |
|
|
|
<!-- <el-button |
|
|
|
v-if="showButton(scope.row.point_status)" |
|
|
|
size="mini" |
|
|
@ -367,7 +399,7 @@ const defaultForm = { |
|
|
|
} |
|
|
|
export default { |
|
|
|
name: 'SchBasePoint', |
|
|
|
dicts: ['vehicle_type', 'TrueOrFalse'], |
|
|
|
dicts: ['vehicle_type', 'TrueOrFalse','reason'], |
|
|
|
components: { PointDialog, ViewDialog, pagination, crudOperation, rrOperation, udOperation }, |
|
|
|
mixins: [presenter(), header(), form(defaultForm), crud()], |
|
|
|
cruds() { |
|
|
@ -406,6 +438,9 @@ export default { |
|
|
|
region_code: [ |
|
|
|
{ required: true, message: '区域类型不能为空', trigger: 'blur' } |
|
|
|
] |
|
|
|
},reasonDialogVisible: false, |
|
|
|
reasonForm: { |
|
|
|
reason: "" |
|
|
|
}, |
|
|
|
workShopList: [], |
|
|
|
regionList: [], |
|
|
@ -483,6 +518,12 @@ export default { |
|
|
|
this.crud.toQuery() |
|
|
|
}) |
|
|
|
}, |
|
|
|
showQtyButton(vehicle_qty,region_code) { |
|
|
|
if (vehicle_qty === 1 && region_code === 'YL') { |
|
|
|
return true |
|
|
|
} |
|
|
|
return false |
|
|
|
}, |
|
|
|
showButton(point_status) { |
|
|
|
if (point_status && point_status === '2') { |
|
|
|
return true |
|
|
@ -505,6 +546,36 @@ export default { |
|
|
|
this.crud.query.point_type = null |
|
|
|
this.crud.query.point_status = null |
|
|
|
this.hand() |
|
|
|
},openReasonDialog(row) { |
|
|
|
// 打开选择原因的对话框 |
|
|
|
this.reasonDialogVisible = true; |
|
|
|
// 这里可以将row存储到data中,以便在提交时使用 |
|
|
|
this.selectedRow = row; |
|
|
|
},closeReasonDialog() { |
|
|
|
// 关闭选择原因的对话框 |
|
|
|
this.reasonDialogVisible = false; |
|
|
|
this.$refs["reasonForm"].resetFields(); |
|
|
|
},submitReason() { |
|
|
|
// 提交选择的原因到后端接口 |
|
|
|
const data = { |
|
|
|
reason: this.reasonForm.reason, |
|
|
|
device_code: this.selectedRow.point_code |
|
|
|
}; |
|
|
|
// 调用后端接口提交数据 |
|
|
|
// 这里假设使用axios库发送POST请求 |
|
|
|
this.$axios |
|
|
|
.post("/api/schBasePoint/outbound", data) |
|
|
|
.then(response => { |
|
|
|
// 处理后端返回的数据 |
|
|
|
console.log("提交成功", response); |
|
|
|
this.$message.success("提交成功"); |
|
|
|
this.closeReasonDialog(); |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
// 处理错误情况 |
|
|
|
console.error("提交失败,废包材位有货", error); |
|
|
|
this.$message.error("提交失败,废包材位有货"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|