add:出库增加按单据选择
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="单据选择"
|
|
||||||
append-to-body
|
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
|
title="单据选择"
|
||||||
width="1000px"
|
width="1000px"
|
||||||
@close="close"
|
@close="close"
|
||||||
@open="open"
|
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
:inline="true"
|
:inline="true"
|
||||||
@@ -25,8 +24,8 @@
|
|||||||
@change="crud.toQuery()"
|
@change="crud.toQuery()"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in tableEnum.bm_form_struc"
|
v-for="item in dict.INANDOUT_BILL_TYPE"
|
||||||
:key="item.value"
|
:key="item.dict_id"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
/>
|
/>
|
||||||
@@ -50,47 +49,23 @@
|
|||||||
v-loading="crud.loading"
|
v-loading="crud.loading"
|
||||||
:data="crud.data"
|
:data="crud.data"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
@select="crud.selectChange"
|
highlight-current-row
|
||||||
@select-all="crud.selectAllChange"
|
|
||||||
@selection-change="crud.selectionChangeHandler"
|
|
||||||
@current-change="clickChange"
|
@current-change="clickChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px" />
|
||||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px">
|
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.code }}</el-link>
|
{{ dict.label.INANDOUT_BILL_TYPE[scope.row.form_type] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" />
|
<el-table-column prop="source_form_date" label="业务单据日期" show-overflow-tooltip width="120" />
|
||||||
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120" />
|
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip width="120" />
|
||||||
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130" />
|
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120" />
|
||||||
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
|
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
|
||||||
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip />
|
<el-table-column prop="qty" label="计划数量" show-overflow-tooltip />
|
||||||
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120" />
|
<el-table-column prop="assign_qty" label="已分配数量" show-overflow-tooltip width="120" />
|
||||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120" />
|
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120" />
|
||||||
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120" />
|
|
||||||
<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="create_time" label="创建时间" />
|
<el-table-column prop="create_time" label="创建时间" />
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
width="120px"
|
|
||||||
align="center"
|
|
||||||
fixed="right"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<udOperation
|
|
||||||
style="display: inline"
|
|
||||||
:data="scope.row"
|
|
||||||
:disabled-edit="scope.row.is_modify === '0'"
|
|
||||||
:disabled-dle="scope.row.is_modify === '0'"
|
|
||||||
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
@@ -98,48 +73,13 @@
|
|||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submit">确 定</el-button>
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
<el-dialog
|
|
||||||
title="单据明细"
|
|
||||||
append-to-body
|
|
||||||
:visible.sync="dtlVisible"
|
|
||||||
destroy-on-close
|
|
||||||
width="1000px"
|
|
||||||
>
|
|
||||||
<!--表格渲染-->
|
|
||||||
<el-table
|
|
||||||
:data="childrenList"
|
|
||||||
>
|
|
||||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px" />
|
|
||||||
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130" />
|
|
||||||
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" />
|
|
||||||
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120" />
|
|
||||||
<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="create_time" label="创建时间" />
|
|
||||||
</el-table>
|
|
||||||
<!--分页组件-->
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dtlVisible = false">取 消</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CRUD, { header, presenter } from '@crud/crud'
|
import CRUD, { header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation.vue'
|
import rrOperation from '@crud/RR.operation.vue'
|
||||||
import pagination from '@crud/Pagination.vue'
|
import pagination from '@crud/Pagination.vue'
|
||||||
// import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
|
||||||
// import crudClassstandard from '@/views/wms/base_manage/class_standard/classstandard'
|
|
||||||
import crudFormData from './formData'
|
import crudFormData from './formData'
|
||||||
export default {
|
export default {
|
||||||
name: 'FormDia',
|
name: 'FormDia',
|
||||||
@@ -148,7 +88,7 @@ export default {
|
|||||||
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudFormData }, optShow: {}})
|
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudFormData }, optShow: {}})
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header()],
|
mixins: [presenter(), header()],
|
||||||
tableEnums: ['bm_form_struc#form_name#form_type'],
|
dicts: ['INANDOUT_BILL_TYPE'],
|
||||||
props: {
|
props: {
|
||||||
dialogShow: {
|
dialogShow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -168,8 +108,6 @@ export default {
|
|||||||
cols: [],
|
cols: [],
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dtlVisible: false,
|
dtlVisible: false,
|
||||||
childrenList: [],
|
|
||||||
tableRadio: null,
|
|
||||||
checkrow: null,
|
checkrow: null,
|
||||||
rows: []
|
rows: []
|
||||||
}
|
}
|
||||||
@@ -182,66 +120,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
|
||||||
},
|
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
|
||||||
// if (this.query.form_type !=null){
|
|
||||||
// formstruc.getHeader(this.query.form_type).then(res => {
|
|
||||||
// this.cols = res
|
|
||||||
// })
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// return false
|
|
||||||
},
|
|
||||||
|
|
||||||
toView(row) {
|
|
||||||
if (row.hasChildren) {
|
|
||||||
this.dtlVisible = true
|
|
||||||
this.childrenList = row.children
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clickChange(item) {
|
clickChange(item) {
|
||||||
this.tableRadio = item
|
this.checkrow = item
|
||||||
},
|
|
||||||
handleSelectionChange(val, row) {
|
|
||||||
if (this.isSingle) {
|
|
||||||
if (val.length > 1) {
|
|
||||||
this.$refs.table.clearSelection()
|
|
||||||
this.$refs.table.toggleRowSelection(val.pop())
|
|
||||||
} else {
|
|
||||||
this.checkrow = row
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelectAll() {
|
|
||||||
this.$refs.table.clearSelection()
|
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.crud.resetQuery(false)
|
this.crud.resetQuery(false)
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// 处理单选
|
this.dialogVisible = false
|
||||||
if (this.isSingle && this.tableRadio) {
|
|
||||||
this.dialogVisible = false
|
|
||||||
const subData = {}
|
|
||||||
this.$set(subData, 't', this.form)
|
|
||||||
this.$set(subData, 'item', this.tableRadio)
|
|
||||||
this.$emit('update:dialogShow', false)
|
|
||||||
this.$emit('setMaterValue', subData)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.rows = this.$refs.table.selection
|
|
||||||
if (this.rows.length <= 0) {
|
|
||||||
this.$message('请先勾选物料')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.crud.resetQuery(false)
|
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
const subData = {}
|
this.$emit('setFormValue', this.checkrow)
|
||||||
this.$set(subData, 't', this.rows[0])
|
|
||||||
this.$set(subData, 'item', this.rows[0].children)
|
|
||||||
this.$emit('setMaterValue', subData)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,17 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="queryDtl()"
|
@click="addFormDtl()"
|
||||||
|
>
|
||||||
|
添加单据
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="addMaterDtl()"
|
||||||
>
|
>
|
||||||
添加物料
|
添加物料
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -169,6 +179,7 @@
|
|||||||
|
|
||||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
||||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
|
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
|
||||||
|
<FormDialog :dialog-show.sync="formShow" @setFormValue="setFormValue" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -176,6 +187,7 @@
|
|||||||
import CRUD, { crud, form } from '@crud/crud'
|
import CRUD, { crud, form } from '@crud/crud'
|
||||||
import AddDtl from '@/views/wms/st/outbill/AddDtl'
|
import AddDtl from '@/views/wms/st/outbill/AddDtl'
|
||||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||||
|
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
|
||||||
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||||
|
|
||||||
@@ -196,7 +208,7 @@ const defaultForm = {
|
|||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'AddDialog',
|
name: 'AddDialog',
|
||||||
components: { AddDtl, MaterDialog },
|
components: { AddDtl, MaterDialog, FormDialog },
|
||||||
mixins: [crud(), form(defaultForm)],
|
mixins: [crud(), form(defaultForm)],
|
||||||
props: {
|
props: {
|
||||||
dialogShow: {
|
dialogShow: {
|
||||||
@@ -211,6 +223,7 @@ export default {
|
|||||||
dtlShow: false,
|
dtlShow: false,
|
||||||
materType: '',
|
materType: '',
|
||||||
materShow: false,
|
materShow: false,
|
||||||
|
formShow: false,
|
||||||
flagnow: false,
|
flagnow: false,
|
||||||
nowrow: {},
|
nowrow: {},
|
||||||
nowindex: '',
|
nowindex: '',
|
||||||
@@ -302,13 +315,8 @@ export default {
|
|||||||
this.materShow = true
|
this.materShow = true
|
||||||
this.nowindex = index
|
this.nowindex = index
|
||||||
this.nowrow = row
|
this.nowrow = row
|
||||||
/* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
|
|
||||||
this.materType = res.materType
|
|
||||||
this.nowindex = index
|
|
||||||
this.nowrow = row
|
|
||||||
})*/
|
|
||||||
},
|
},
|
||||||
queryDtl(index, row) {
|
addMaterDtl(index, row) {
|
||||||
if (this.form.bill_type === '') {
|
if (this.form.bill_type === '') {
|
||||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
@@ -320,6 +328,18 @@ export default {
|
|||||||
this.storId = this.form.stor_id
|
this.storId = this.form.stor_id
|
||||||
this.dtlShow = true
|
this.dtlShow = true
|
||||||
},
|
},
|
||||||
|
addFormDtl(index, row) {
|
||||||
|
if (this.form.bill_type === '') {
|
||||||
|
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.form.stor_id === '') {
|
||||||
|
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.storId = this.form.stor_id
|
||||||
|
this.formShow = true
|
||||||
|
},
|
||||||
tableChanged(rows) {
|
tableChanged(rows) {
|
||||||
rows.forEach((item) => {
|
rows.forEach((item) => {
|
||||||
// 添加plan_qty
|
// 添加plan_qty
|
||||||
@@ -360,6 +380,21 @@ export default {
|
|||||||
this.nowrow.edit = false
|
this.nowrow.edit = false
|
||||||
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||||
},
|
},
|
||||||
|
setFormValue(data) {
|
||||||
|
this.nowrow.material_id = data.material_id
|
||||||
|
this.nowrow.material_code = data.material_code
|
||||||
|
this.nowrow.material_name = data.material_name
|
||||||
|
this.nowrow.qty_unit_id = data.unit_id
|
||||||
|
this.nowrow.qty_unit_name = data.unit_name
|
||||||
|
this.nowrow.pcsn = data.pcsn
|
||||||
|
this.nowrow.plan_qty = data.qty
|
||||||
|
this.nowrow.qty = data.qty
|
||||||
|
this.nowrow.source_bill_code = data.code
|
||||||
|
this.nowrow.source_bill_id = data.id
|
||||||
|
this.nowrow.source_bill_type = data.form_type
|
||||||
|
this.nowrow.edit = false
|
||||||
|
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||||
|
},
|
||||||
deleteRow(index, rows) {
|
deleteRow(index, rows) {
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||||
rows.splice(index, 1)
|
rows.splice(index, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user