rev:修复单据更新库存变动逻辑?后续考虑库存变动统一在变动这边做现在只处理记录
This commit is contained in:
@@ -79,9 +79,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableEnum.st_ivt_bsrealstorattr"
|
||||
:key="item.stor_code"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_code"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -148,7 +148,12 @@
|
||||
<el-table-column prop="sect_code" sortable label="库区编码" />
|
||||
<el-table-column prop="sect_name" label="库区名称" width="150" />
|
||||
<el-table-column prop="simple_name" label="库区简称" width="150" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" width="150" />
|
||||
<el-table-column prop="stor_code" label="仓库编码" width="150" />
|
||||
<el-table-column prop="stor_code" label="仓库名称" width="150" >
|
||||
<template slot-scope="scope">
|
||||
{{ tableEnum.label.st_ivt_bsrealstorattr[scope.row.stor_code] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="capacity" label="容量" />
|
||||
<el-table-column prop="sect_manager_name" label="负责人" />
|
||||
<el-table-column prop="mobile_no" label="联系电话" width="100px" />
|
||||
|
||||
@@ -209,7 +209,11 @@
|
||||
-->
|
||||
<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="sect_name" label="所属库区" width="150" />
|
||||
<el-table-column prop="sect_code" label="所属库区" width="150" >
|
||||
<template slot-scope="scope">
|
||||
{{ tableEnum.label.st_ivt_sectattr[scope.row.sect_code] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stor_name" label="所属仓库" width="150" />
|
||||
<el-table-column prop="vehicle_code" label="载具号" :min-width="flexWidth('vehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="is_temp" label="是否临时" width="150" >
|
||||
@@ -322,7 +326,7 @@ export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_HEIGHT_TYPE', 'is_used', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'placement_type'],
|
||||
statusEnums: ['LOCK'],
|
||||
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#stor_code' ],
|
||||
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#stor_code','st_ivt_sectattr#sect_name#sect_code' ],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
:data="crud.data"
|
||||
row-key="proc_inst_id"
|
||||
border
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
:tree-props="{ children: 'children', hasChildren: 'has' }"
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
>
|
||||
@@ -296,15 +296,15 @@ export default {
|
||||
})
|
||||
},
|
||||
flowConfirm(proc_inst_id) {
|
||||
curdExecution.flowConfirm(proc_inst_id).then(res => {
|
||||
curdExecution.flowConfirm(proc_inst_id).then(res => {
|
||||
crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
this.crud.toQuery()
|
||||
},
|
||||
load(tree, treeNode, resolve) {
|
||||
setTimeout(() => {
|
||||
resolve(tree.children)
|
||||
}, 100)
|
||||
async load(tree, treeNode, resolve) {
|
||||
curdExecution.queryByParentId(tree.proc_inst_id).then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
},
|
||||
changeActive(row) {
|
||||
curdExecution.changeActive(row)
|
||||
|
||||
@@ -98,11 +98,16 @@
|
||||
<el-table-column prop="pcsn" label="批次" min-width="150" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="qty" label="总库存" min-width="150" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="frozen_qty" label="冻结库存" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="change_qty" label="变动库存" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="unit_name" label="单位" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="vehicle_form_data" label="物料扩展信息" width="300" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="source_form_type" label="单据编号" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="source_form_id" label="单据表名" min-width="120" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="task_type" label="变动类型" min-width="150" show-tooltip-when-overflow/>
|
||||
<el-table-column prop="task_type" show-overflow-tooltip show-tooltip-when-overflow label="变动类型">
|
||||
<template slot-scope="scope">
|
||||
{{ statusEnum.label.TASK_TYPE[scope.row.task_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_time" label="修改时间" width="120" show-tooltip-when-overflow/>
|
||||
|
||||
<!-- <el-table-column-->
|
||||
@@ -151,6 +156,7 @@ export default {
|
||||
dicts: [],
|
||||
name: 'StructIvtFlow',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation},
|
||||
statusEnums: ['TASK_TYPE'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
|
||||
@@ -62,7 +62,11 @@
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sect_name" label="库区" show-overflow-tooltip />
|
||||
<el-table-column prop="sect_code" label="库区" show-overflow-tooltip >
|
||||
<template slot-scope="scope">
|
||||
{{ tableEnum.label.st_ivt_sectattr[scope.row.sect_code] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stor_name" label="仓库" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_code" label="仓位编码" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_name" label="仓位名称" show-overflow-tooltip />
|
||||
@@ -126,7 +130,7 @@ export default {
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
tableEnums: [ 'bm_measure_unit#unit_name#unit_id' ],
|
||||
tableEnums: [ 'bm_measure_unit#unit_name#unit_id','st_ivt_sectattr#sect_name#sect_code' ],
|
||||
statusEnums: [ 'LOCK' ],
|
||||
props: {
|
||||
dialogShow: {
|
||||
|
||||
@@ -286,6 +286,7 @@ export default {
|
||||
data.unit_id = row.unit_id
|
||||
data.form_type = 'st_ivt_checkdtl'
|
||||
data.form_data = {}
|
||||
data.end_struct_code = row.struct_code
|
||||
this.dtlCols.forEach(a=>{
|
||||
let item = ''
|
||||
if (a.value in data) {
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<el-table-column width="160" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value"
|
||||
:label="item.lable">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-if="item.value == 'check_qty'" v-model="scope.row.form_data[item.value]" @input="qtyClick(scope.row)" class="input-with-select" />
|
||||
<el-input-number v-if="item.value == 'change_qty'" v-model="scope.row.form_data[item.value]" @input="qtyClick(scope.row)" class="input-with-select" />
|
||||
<el-select disabled v-if="item.value == 'profit_loss'"
|
||||
v-model="scope.row.form_data[item.value]"
|
||||
clearable
|
||||
@@ -131,7 +131,7 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-if="item.value != 'check_qty' && item.value != 'profit_loss'" v-model="scope.row.form_data[item.value]" disabled class="input-with-select" />
|
||||
<el-input v-if="item.value != 'change_qty' && item.value != 'profit_loss'" v-model="scope.row.form_data[item.value]" disabled class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -307,13 +307,13 @@ export default {
|
||||
this.$refs['form2'].resetFields()
|
||||
},
|
||||
qtyClick(row){
|
||||
if (row.form_data.check_qty > row.qty){
|
||||
if (row.form_data.change_qty > row.qty){
|
||||
this.$set(row.form_data, 'profit_loss', '1')
|
||||
}
|
||||
if (row.form_data.check_qty < row.qty){
|
||||
if (row.form_data.change_qty < row.qty){
|
||||
this.$set(row.form_data, 'profit_loss', '0')
|
||||
}
|
||||
if (row.form_data.check_qty == row.qty){
|
||||
if (row.form_data.change_qty == row.qty){
|
||||
this.$set(row.form_data, 'profit_loss', '2')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ export default {
|
||||
if (row.status == '13'){
|
||||
this.finish_flag = false
|
||||
}else {
|
||||
this.finish_flag = false
|
||||
this.finish_flag = true
|
||||
}
|
||||
this.dis_flag = false
|
||||
this.currentRow = row
|
||||
@@ -293,6 +293,14 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
checkFinish(row) {
|
||||
if (this.currentRow !== null) {
|
||||
crudCheck.checkFinish(this.currentRow).then(res => {
|
||||
this.crud.notify('盘点确认', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
},
|
||||
toDelete(id) {
|
||||
if (id !== null) {
|
||||
crudCheck.del([id]).then(res => {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/pmFormData',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/pmFormData',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/pmFormData',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getFormType() {
|
||||
return request({
|
||||
url: 'api/bmFormStruc/getTypes',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function getParentFormTypes() {
|
||||
return request({
|
||||
url: 'api/bmFormStruc/getParentFormTypes',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function getSonFormData(id) {
|
||||
return request({
|
||||
url: 'api/pmFormData/getSonFormData/' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export default {add, edit, del, getFormType, getParentFormTypes, getSonFormData}
|
||||
@@ -0,0 +1,267 @@
|
||||
<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-select
|
||||
v-model="query.form_type"
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="请选择/搜索"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery()"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fromTypes"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<template v-for="(col,index) in cols" v-if="hideShowDialog">
|
||||
<el-form-item label="col.lable">
|
||||
<label slot="label">{{ col.lable }}:</label>
|
||||
<el-input v-model="query.form_query[col.value]" :value="col.value" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="task_flag"
|
||||
@click="taskOpen"
|
||||
>
|
||||
作业下发
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@select="handleSelectionChange"
|
||||
:data="crud.data"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-link v-if="scope.row.hasChildren" type="warning" @click="toView(scope.row)">{{
|
||||
scope.row.code
|
||||
}}
|
||||
</el-link>
|
||||
<span v-else>{{ scope.row.code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
|
||||
<template slot-scope="scope">
|
||||
<template v-for="item in statusEnum.FORM_STATUS">
|
||||
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="(item, index) in cols"
|
||||
:key="item.value"
|
||||
width="130"
|
||||
show-overflow-tooltip
|
||||
:label="item.lable"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_time" label="创建时间" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="update_time" label="修改时间" />
|
||||
<el-table-column prop="create_name" label="修改人" />
|
||||
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="crud.toEdit(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="toDelete(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudFormData from './formData'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import crudmove from './pl'
|
||||
|
||||
|
||||
// import UploadDialog from './UploadDialog'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
code: null,
|
||||
proc_inst_id: null,
|
||||
biz_id: null,
|
||||
boz_code: null,
|
||||
biz_date: null,
|
||||
form_type: null,
|
||||
status: null,
|
||||
create_time: null,
|
||||
create_name: null,
|
||||
material_id: null,
|
||||
qty: null,
|
||||
pcsn: null,
|
||||
vehicle_code: null,
|
||||
from_data: null,
|
||||
parent_id: null
|
||||
}
|
||||
export default {
|
||||
name: 'st_ivt_profitloss',
|
||||
statusEnums: ['FORM_STATUS'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '移库单',
|
||||
url: 'api/pmFormData',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudFormData },
|
||||
optShow: {
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
form_type:'st_ivt_profitloss',
|
||||
form_data: {}
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cols: [],
|
||||
classes: [],
|
||||
task_flag: true,
|
||||
currentRow: null,
|
||||
uploadShow: false,
|
||||
dis_flag: true,
|
||||
fromTypes: [],
|
||||
permission: {},
|
||||
rules: {},
|
||||
hideShowDialog: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
created() {
|
||||
// 获取分类
|
||||
formstruc.getHeader('st_ivt_profitloss').then(res => {
|
||||
this.cols = res
|
||||
res.forEach(a => {
|
||||
this.form.form_data[a.value, '']
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
ToExpandall() {
|
||||
const els = document.getElementsByClassName('el-table__expand-icon')
|
||||
if (this.crud.data.length !== 0 && els.length !== 0) {
|
||||
for (let j1 = 0; j1 < els.length; j1++) {
|
||||
els[j1].classList.add('dafult')
|
||||
}
|
||||
if (this.$el.getElementsByClassName('el-table__expand-icon--expanded')) {
|
||||
const open = this.$el.getElementsByClassName('el-table__expand-icon--expanded')
|
||||
for (let j = 0; j < open.length; j++) {
|
||||
open[j].classList.remove('dafult')
|
||||
}
|
||||
const dafult = this.$el.getElementsByClassName('dafult')
|
||||
for (let a = 0; a < dafult.length; a++) {
|
||||
|
||||
dafult[a].click()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
hideShow() {
|
||||
if (this.hideShowDialog) {
|
||||
// this.$set(this.query, 'form_query', {})
|
||||
}
|
||||
this.hideShowDialog = !this.hideShowDialog
|
||||
},
|
||||
toView(row) {
|
||||
if (row !== null) {
|
||||
this.$refs.viewDialog.setForm(row)
|
||||
}
|
||||
},
|
||||
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length === 1) {
|
||||
if (row.status == '10'){
|
||||
this.task_flag = false
|
||||
}else {
|
||||
this.task_flag = true
|
||||
}
|
||||
this.dis_flag = false
|
||||
this.currentRow = row
|
||||
} else {
|
||||
this.task_flag = true
|
||||
this.dis_flag = true
|
||||
this.currentRow = null
|
||||
}
|
||||
},
|
||||
|
||||
disOpen(row) {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.taskDis.setForm(this.currentRow)
|
||||
}
|
||||
},
|
||||
taskOpen(row) {
|
||||
if (this.currentRow !== null) {
|
||||
crudmove.taskopen(this.currentRow).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
},
|
||||
toDelete(id) {
|
||||
if (id !== null) {
|
||||
crudmove.del([id]).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/move/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/move',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/move',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updateStatus(data) {
|
||||
return request({
|
||||
url: '/api/move/updateStatus',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function taskopen(data) {
|
||||
return request({
|
||||
url: '/api/move/taskOpen',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {add, edit, del, updateStatus, taskopen}
|
||||
Reference in New Issue
Block a user