|
|
|
@ -19,6 +19,7 @@ |
|
|
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
|
|
|
<el-button @click="resetQuery()" type="default">重置</el-button> |
|
|
|
<el-button @click="openAddDialog()" type="primary" class="yzzButtonAn">新增</el-button> |
|
|
|
<el-button v-if="isAdmin" @click="openCheckDialog()" type="warning">校验测试</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -61,6 +62,60 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="partManualReservationControl" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="Part Manual Reservation Control" |
|
|
|
min-width="220" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="partOrderIssueControl" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="Part Order Issue Control" |
|
|
|
min-width="200" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="partNonOrderIssueControl" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="Part Non-Order Issue Control" |
|
|
|
min-width="220" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="partScrapControl" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="Part Scrap Control" |
|
|
|
min-width="170" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="partCountingControl" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="Part Counting Control" |
|
|
|
min-width="190" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="partMovementControl" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="Part Movement Control" |
|
|
|
min-width="170" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="createdBy" |
|
|
|
header-align="center" |
|
|
|
@ -137,6 +192,87 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="Part Manual Reservation Control"> |
|
|
|
<el-select v-model="formData.partManualReservationControl" placeholder="请选择" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in manualReservationControlOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="Part Order Issue Control"> |
|
|
|
<el-select v-model="formData.partOrderIssueControl" placeholder="请选择" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in orderIssueControlOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="Part Non-Order Issue Control"> |
|
|
|
<el-select v-model="formData.partNonOrderIssueControl" placeholder="请选择" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in nonOrderIssueControlOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="Part Scrap Control"> |
|
|
|
<el-select v-model="formData.partScrapControl" placeholder="请选择" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in scrapControlOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="Part Counting Control"> |
|
|
|
<el-select v-model="formData.partCountingControl" placeholder="请选择" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in countingControlOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="Part Movement Control"> |
|
|
|
<el-select v-model="formData.partMovementControl" placeholder="请选择" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in movementControlOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="状态"> |
|
|
|
@ -156,11 +292,60 @@ |
|
|
|
<el-button @click="dialogVisible = false" :disabled="saveLoading">取消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 物料操作权限校验弹窗(仅admin)- rqrq --> |
|
|
|
<el-dialog |
|
|
|
title="物料操作权限校验" |
|
|
|
:visible.sync="checkDialogVisible" |
|
|
|
:close-on-click-modal="false" |
|
|
|
v-drag |
|
|
|
width="520px"> |
|
|
|
|
|
|
|
<el-form :model="checkFormData" label-position="top" style="margin-top: 1px;"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="site" required> |
|
|
|
<el-input v-model="checkFormData.site" placeholder="请输入site"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="unitId" required> |
|
|
|
<el-input v-model="checkFormData.unitId" placeholder="请输入unitId"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="type" required> |
|
|
|
<el-select v-model="checkFormData.type" placeholder="请选择type" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="item in checkTypeOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="handleCheckOperationAllowed" :disabled="checkLoading"> |
|
|
|
{{ checkLoading ? '校验中...' : '校验' }} |
|
|
|
</el-button> |
|
|
|
<el-button @click="checkDialogVisible = false" :disabled="checkLoading">取消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { list, save, update, deleteById } from '@/api/warehouse/availabilityControlId' |
|
|
|
import { list, save, update, deleteById, checkPartOperationAllowed } from '@/api/warehouse/availabilityControlId' |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
@ -173,6 +358,8 @@ export default { |
|
|
|
dialogVisible: false, |
|
|
|
dialogType: 'add', // add 或 edit |
|
|
|
saveLoading: false, |
|
|
|
checkDialogVisible: false, |
|
|
|
checkLoading: false, |
|
|
|
|
|
|
|
// 数据列表 - rqrq |
|
|
|
dataList: [], |
|
|
|
@ -189,10 +376,66 @@ export default { |
|
|
|
id: null, |
|
|
|
availabilityControlId: '', |
|
|
|
availabilityControlDesc: '', |
|
|
|
partManualReservationControl: 'Manual Reservation', |
|
|
|
partOrderIssueControl: 'Order Issue', |
|
|
|
partNonOrderIssueControl: 'Non-Order Issue', |
|
|
|
partScrapControl: 'Scrappable', |
|
|
|
partCountingControl: 'Allow Reducing', |
|
|
|
partMovementControl: 'Allowed', |
|
|
|
active: 'Y' |
|
|
|
}, |
|
|
|
|
|
|
|
// 可用性控制选项(固定值)- rqrq |
|
|
|
manualReservationControlOptions: [ |
|
|
|
{ label: 'Not Manual Reservation', value: 'Not Manual Reservation' }, |
|
|
|
{ label: 'Manual Reservation', value: 'Manual Reservation' } |
|
|
|
], |
|
|
|
orderIssueControlOptions: [ |
|
|
|
{ label: 'Not Order Issue', value: 'Not Order Issue' }, |
|
|
|
{ label: 'Order Issue', value: 'Order Issue' } |
|
|
|
], |
|
|
|
nonOrderIssueControlOptions: [ |
|
|
|
{ label: 'Not Non-Order Issue', value: 'Not Non-Order Issue' }, |
|
|
|
{ label: 'Non-Order Issue', value: 'Non-Order Issue' } |
|
|
|
], |
|
|
|
scrapControlOptions: [ |
|
|
|
{ label: 'Not Scrappable', value: 'Not Scrappable' }, |
|
|
|
{ label: 'Scrappable', value: 'Scrappable' } |
|
|
|
], |
|
|
|
countingControlOptions: [ |
|
|
|
{ label: 'Not Allow Reducing', value: 'Not Allow Reducing' }, |
|
|
|
{ label: 'Allow Reducing', value: 'Allow Reducing' } |
|
|
|
], |
|
|
|
movementControlOptions: [ |
|
|
|
{ label: 'Not Allowed', value: 'Not Allowed' }, |
|
|
|
{ label: 'Allowed', value: 'Allowed' } |
|
|
|
], |
|
|
|
|
|
|
|
// 校验测试类型选项 - rqrq |
|
|
|
checkTypeOptions: [ |
|
|
|
{ label: 'part_manual_reservation_control', value: 'part_manual_reservation_control' }, |
|
|
|
{ label: 'part_order_issue_control', value: 'part_order_issue_control' }, |
|
|
|
{ label: 'part_non_order_issue_control', value: 'part_non_order_issue_control' }, |
|
|
|
{ label: 'part_scrap_control', value: 'part_scrap_control' }, |
|
|
|
{ label: 'part_counting_control', value: 'part_counting_control' }, |
|
|
|
{ label: 'part_movement_control', value: 'part_movement_control' } |
|
|
|
], |
|
|
|
|
|
|
|
// 校验测试表单 - rqrq |
|
|
|
checkFormData: { |
|
|
|
site: this.$store.state.user.site || '', |
|
|
|
unitId: '', |
|
|
|
type: 'part_manual_reservation_control' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 仅admin可见校验测试按钮 - rqrq |
|
|
|
isAdmin() { |
|
|
|
const userName = this.$store.state.user && this.$store.state.user.name |
|
|
|
return userName && userName.toLowerCase() === 'admin' |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight - 200 |
|
|
|
@ -234,6 +477,12 @@ export default { |
|
|
|
id: null, |
|
|
|
availabilityControlId: '', |
|
|
|
availabilityControlDesc: '', |
|
|
|
partManualReservationControl: 'Manual Reservation', |
|
|
|
partOrderIssueControl: 'Order Issue', |
|
|
|
partNonOrderIssueControl: 'Non-Order Issue', |
|
|
|
partScrapControl: 'Scrappable', |
|
|
|
partCountingControl: 'Allow Reducing', |
|
|
|
partMovementControl: 'Allowed', |
|
|
|
active: 'Y' |
|
|
|
} |
|
|
|
this.dialogVisible = true |
|
|
|
@ -246,6 +495,12 @@ export default { |
|
|
|
id: row.id, |
|
|
|
availabilityControlId: row.availabilityControlId, |
|
|
|
availabilityControlDesc: row.availabilityControlDesc, |
|
|
|
partManualReservationControl: row.partManualReservationControl || 'Manual Reservation', |
|
|
|
partOrderIssueControl: row.partOrderIssueControl || 'Order Issue', |
|
|
|
partNonOrderIssueControl: row.partNonOrderIssueControl || 'Non-Order Issue', |
|
|
|
partScrapControl: row.partScrapControl || 'Scrappable', |
|
|
|
partCountingControl: row.partCountingControl || 'Allow Reducing', |
|
|
|
partMovementControl: row.partMovementControl || 'Allowed', |
|
|
|
active: row.active |
|
|
|
} |
|
|
|
this.dialogVisible = true |
|
|
|
@ -298,6 +553,51 @@ export default { |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开物料操作权限校验弹窗 - rqrq |
|
|
|
openCheckDialog() { |
|
|
|
this.checkFormData = { |
|
|
|
site: this.$store.state.user.site || '', |
|
|
|
unitId: '', |
|
|
|
type: 'part_manual_reservation_control' |
|
|
|
} |
|
|
|
this.checkDialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 调用后端校验方法并弹窗显示true/false - rqrq |
|
|
|
handleCheckOperationAllowed() { |
|
|
|
if (!this.checkFormData.site) { |
|
|
|
this.$message.warning('请输入site') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.checkFormData.unitId) { |
|
|
|
this.$message.warning('请输入unitId') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.checkFormData.type) { |
|
|
|
this.$message.warning('请选择type') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.checkLoading = true |
|
|
|
checkPartOperationAllowed(this.checkFormData).then(({ data }) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
const resultText = String(data.row === true) |
|
|
|
this.checkDialogVisible = false |
|
|
|
this.$confirm(resultText, '校验结果', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
showCancelButton: false, |
|
|
|
type: data.row === true ? 'success' : 'warning' |
|
|
|
}).catch(() => {}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '校验失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$alert('校验失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
}).finally(() => { |
|
|
|
this.checkLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 格式化日期 - rqrq |
|
|
|
formatDate(dateStr) { |
|
|
|
if (!dateStr) return '' |
|
|
|
|