add:新增需求
This commit is contained in:
@@ -127,6 +127,42 @@
|
||||
强制完工
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="auditDialogVisible"
|
||||
title="审核"
|
||||
width="520px"
|
||||
>
|
||||
<el-form
|
||||
ref="auditForm"
|
||||
:model="auditForm"
|
||||
:rules="auditRules"
|
||||
size="mini"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="审核结果" prop="audit_result">
|
||||
<el-radio-group v-model="auditForm.audit_result">
|
||||
<el-radio :label="1">通过</el-radio>
|
||||
<el-radio :label="0">不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="remark">
|
||||
<el-input
|
||||
v-model="auditForm.remark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
placeholder="请输入审核原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="closeAuditDialog">取消</el-button>
|
||||
<el-button type="primary" @click="submitAudit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -320,6 +356,17 @@
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
style="width: 510px;"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="工单类型" prop="workorder_type">
|
||||
<el-input v-model="form.workorder_type" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
@@ -395,6 +442,12 @@
|
||||
label="批次号"
|
||||
:min-width="flexWidth('batch_no',crud.data,'批次号')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
:min-width="flexWidth('remark',crud.data,'备注', 40)"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="vehicle_type"
|
||||
label="载具类型"
|
||||
@@ -545,9 +598,15 @@ const defaultForm = {
|
||||
plan_weight: 0,
|
||||
guadansum: 0,
|
||||
ext_data: null,
|
||||
remark: null,
|
||||
priority: 1,
|
||||
show: false
|
||||
}
|
||||
const defaultAuditForm = {
|
||||
workorder_id: null,
|
||||
audit_result: 1,
|
||||
remark: ''
|
||||
}
|
||||
export default {
|
||||
name: 'PdmBdWorkorder',
|
||||
dicts: ['storagevehicle_type', 'pdm_workorder_status'],
|
||||
@@ -595,6 +654,14 @@ export default {
|
||||
{ required: true, message: '工单类型不能为空', trigger: 'blur' }
|
||||
]*/
|
||||
},
|
||||
auditRules: {
|
||||
audit_result: [
|
||||
{ required: true, message: '请选择审核结果', trigger: 'change' }
|
||||
],
|
||||
remark: [
|
||||
{ validator: this.validateAuditRemark, trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'workorder_code', display_name: '工单编号' },
|
||||
{ key: 'point_code', display_name: '设备编码' }
|
||||
@@ -607,6 +674,8 @@ export default {
|
||||
materialDialog: false,
|
||||
orderDialog: false,
|
||||
batchAdd: false,
|
||||
auditDialogVisible: false,
|
||||
auditForm: { ...defaultAuditForm },
|
||||
fullscreenLoading: false,
|
||||
materialCode: null,
|
||||
flag: 1
|
||||
@@ -762,19 +831,54 @@ export default {
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
validateAuditRemark(rule, value, callback) {
|
||||
if (this.auditForm.audit_result === 0 && !value) {
|
||||
callback(new Error('审核不通过时原因不能为空'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
closeAuditDialog() {
|
||||
this.auditDialogVisible = false
|
||||
this.auditForm = { ...defaultAuditForm }
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.auditForm) {
|
||||
this.$refs.auditForm.clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
audit(row) {
|
||||
if (String(row.workorder_status) !== '1') {
|
||||
this.$message.warning('仅工单状态为1时允许审核')
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
crudPdmBdWorkorder.audit(row).then(res => {
|
||||
this.crud.notify('审核成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
}).finally(() => {
|
||||
this.fullscreenLoading = false
|
||||
this.auditForm = {
|
||||
...defaultAuditForm,
|
||||
workorder_id: row.workorder_id,
|
||||
remark: row.remark || ''
|
||||
}
|
||||
this.auditDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.auditForm) {
|
||||
this.$refs.auditForm.clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
submitAudit() {
|
||||
this.$refs.auditForm.validate(valid => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
crudPdmBdWorkorder.audit(this.auditForm).then(res => {
|
||||
this.crud.notify('审核成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.closeAuditDialog()
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
}).finally(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
// 下发
|
||||
|
||||
258
lms/nladmin-ui/src/views/wms/st/ivt/index.vue
Normal file
258
lms/nladmin-ui/src/views/wms/st/ivt/index.vue
Normal file
@@ -0,0 +1,258 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属库区">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓位搜索">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="仓位编码或名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料搜索">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="物料编码、名称或规格"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="批次号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具号">
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="载具号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否锁定">
|
||||
<el-select
|
||||
v-model="query.is_lock"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="是否锁定"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option label="否" value="0" />
|
||||
<el-option label="是" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-lock"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="handleStockLock"
|
||||
>
|
||||
库存锁定
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="info"
|
||||
icon="el-icon-unlock"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="handleStockUnlock"
|
||||
>
|
||||
库存解锁
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="struct_code" label="仓位编码" :min-width="flexWidth('struct_code',crud.data,'仓位编码')" />
|
||||
<el-table-column prop="struct_name" label="仓位名称" :min-width="flexWidth('struct_name',crud.data,'仓位名称')" />
|
||||
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
|
||||
<el-table-column prop="sect_name" label="库区" :min-width="flexWidth('sect_name',crud.data,'库区')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="qty" label="总数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column label="可用数" :min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.qty - scope.row.frozen_qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="frozen_qty" label="冻结数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column label="锁定状态" :min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatLockStatus(scope.row.lock_type) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" :min-width="flexWidth('qty_unit_name',crud.data,'计量单位')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="create_time" label="入库时间" width="170" />
|
||||
<el-table-column prop="supp_code" label="供应商编码" :min-width="flexWidth('supp_code',crud.data,'供应商编码')" />
|
||||
<el-table-column prop="supp_name" label="供应商名称" :min-width="flexWidth('supp_name',crud.data,'供应商名称')" />
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import stockManageApi from '@/views/wms/st/ivt/stockManage'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'StockManage',
|
||||
components: { pagination, rrOperation, crudOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库存管理', url: 'api/stockManage', idField: 'stockrecord_id', sort: 'stockrecord_id,desc',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
showDtlLoading: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...stockManageApi }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudSectattr.getSect({ stor_id: '' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_code = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_code = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_code = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatLockStatus(lockType) {
|
||||
return String(lockType || '0') === '0' ? '否' : '是'
|
||||
},
|
||||
handleStockLock() {
|
||||
this.promptLockReason('库存锁定原因', '请输入锁定原因', reason => {
|
||||
this.changeStockLock('99', reason, '库存锁定成功')
|
||||
})
|
||||
},
|
||||
handleStockUnlock() {
|
||||
this.promptLockReason('库存解锁原因', '请输入解锁原因', reason => {
|
||||
this.changeStockLock('0', reason, '库存解锁成功')
|
||||
})
|
||||
},
|
||||
promptLockReason(title, inputPlaceholder, onConfirm) {
|
||||
this.$prompt('', title, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPlaceholder,
|
||||
inputValidator: value => {
|
||||
if (!value || !value.trim()) {
|
||||
return '原因不能为空'
|
||||
}
|
||||
return true
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
onConfirm(value.trim())
|
||||
}).catch(() => {})
|
||||
},
|
||||
changeStockLock(lockType, remark, message) {
|
||||
const selectedRows = this.crud.selections || []
|
||||
const structMap = new Map()
|
||||
selectedRows.forEach(row => {
|
||||
if (row.struct_code) {
|
||||
structMap.set(row.struct_code, {
|
||||
struct_code: row.struct_code,
|
||||
lock_type: lockType,
|
||||
remark
|
||||
})
|
||||
}
|
||||
})
|
||||
const payload = Array.from(structMap.values())
|
||||
if (payload.length === 0) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请选择需要操作的库存数据'
|
||||
})
|
||||
return
|
||||
}
|
||||
stockManageApi.updateLock(payload).then(() => {
|
||||
this.crud.notify(message, CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
11
lms/nladmin-ui/src/views/wms/st/ivt/stockManage.js
Normal file
11
lms/nladmin-ui/src/views/wms/st/ivt/stockManage.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function updateLock(data) {
|
||||
return request({
|
||||
url: 'api/stockManage/updateLock',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { updateLock }
|
||||
@@ -155,6 +155,42 @@
|
||||
强制确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="auditDialogVisible"
|
||||
title="审核"
|
||||
width="520px"
|
||||
>
|
||||
<el-form
|
||||
ref="auditForm"
|
||||
:model="auditForm"
|
||||
:rules="auditRules"
|
||||
size="mini"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="审核结果" prop="audit_result">
|
||||
<el-radio-group v-model="auditForm.audit_result">
|
||||
<el-radio :label="1">通过</el-radio>
|
||||
<el-radio :label="2">不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="remark">
|
||||
<el-input
|
||||
v-model="auditForm.remark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
placeholder="请输入审核原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="closeAuditDialog">取消</el-button>
|
||||
<el-button type="primary" @click="submitAudit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -234,6 +270,11 @@ import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const start = new Date()
|
||||
const defaultAuditForm = {
|
||||
iostorinv_id: null,
|
||||
audit_result: 1,
|
||||
remark: ''
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Checkoutbill',
|
||||
@@ -264,6 +305,16 @@ export default {
|
||||
},
|
||||
loadingConfirm: false,
|
||||
loadingAudit: false,
|
||||
auditDialogVisible: false,
|
||||
auditForm: { ...defaultAuditForm },
|
||||
auditRules: {
|
||||
audit_result: [
|
||||
{ required: true, message: '请选择审核结果', trigger: 'change' }
|
||||
],
|
||||
remark: [
|
||||
{ validator: this.validateAuditRemark, trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
divShow: false,
|
||||
audit_flag: true,
|
||||
dis_flag: true,
|
||||
@@ -405,14 +456,49 @@ export default {
|
||||
this.mstrow = this.currentRow
|
||||
})
|
||||
},
|
||||
validateAuditRemark(rule, value, callback) {
|
||||
if (this.auditForm.audit_result === 2 && !value) {
|
||||
callback(new Error('审核不通过时原因不能为空'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
closeAuditDialog() {
|
||||
this.auditDialogVisible = false
|
||||
this.auditForm = { ...defaultAuditForm }
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.auditForm) {
|
||||
this.$refs.auditForm.clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
audit() {
|
||||
this.loadingAudit = true
|
||||
checkoutbill.audit({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(() => {
|
||||
this.querytable()
|
||||
this.crud.notify('审核成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loadingAudit = false
|
||||
}).catch(() => {
|
||||
this.loadingAudit = false
|
||||
this.auditForm = {
|
||||
...defaultAuditForm,
|
||||
iostorinv_id: this.currentRow.iostorinv_id,
|
||||
remark: this.currentRow.remark || ''
|
||||
}
|
||||
this.auditDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.auditForm) {
|
||||
this.$refs.auditForm.clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
submitAudit() {
|
||||
this.$refs.auditForm.validate(valid => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
this.loadingAudit = true
|
||||
checkoutbill.audit(this.auditForm).then(() => {
|
||||
this.closeAuditDialog()
|
||||
this.querytable()
|
||||
this.crud.notify('审核成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loadingAudit = false
|
||||
}).catch(() => {
|
||||
this.loadingAudit = false
|
||||
})
|
||||
})
|
||||
},
|
||||
confirm() {
|
||||
|
||||
Reference in New Issue
Block a user