rev:组盘页面修改

This commit is contained in:
zhangzq
2024-05-15 11:25:46 +08:00
parent 38e932d7d2
commit 36fb8ca2da
8 changed files with 356 additions and 167 deletions

View File

@@ -79,7 +79,17 @@
size="mini"
@click="insertEvent()"
>
添加物料
物料组盘
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertForm()"
>
单据组盘
</el-button>
<el-button
slot="left"
@@ -166,12 +176,19 @@
:mater-opt-code="materType"
@setMaterValue="tableDtlMaterial"
/>
<FormDialog
:dialog-show.sync="formShow"
:is-single="false"
:mater-opt-code="materType"
@setMaterValue="tableDtlMaterial"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import MaterDialog from '@/views/wms/base_manage/material/MaterDialog'
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
@@ -189,7 +206,7 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { formstruc, MaterDialog },
components: { formstruc, MaterDialog, FormDialog },
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area', 'PCS_SAL_TYPE'],
props: {
@@ -208,6 +225,7 @@ export default {
tableData:[],
dialogVisible: false,
materShow: false,
formShow: false,
dtlShow: false,
opendtlParam: null,
materType: '03', // 关键成品
@@ -271,6 +289,9 @@ export default {
insertEvent(row) {
this.materShow = true
},
insertForm(row) {
this.formShow = true
},
queryMater(index, row) {
this.nowindex = index
this.nowrow = row

View File

@@ -0,0 +1,264 @@
<template>
<el-dialog
title="单据选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
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>
<el-form-item label="单据编码">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
lazy
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:data="crud.data"
row-key="id"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.code }}</el-link>
</template>
</el-table-column>
<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 width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" :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
v-permission="['admin','Classstandard:edit','Classstandard:del']"
label="操作"
width="120px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
style="display: inline"
:data="scope.row"
:permission="permission"
:disabled-edit="scope.row.is_modify === '0'"
:disabled-dle="scope.row.is_modify === '0'"
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import crudMaterialbase from '@/views/wms/base_manage/material/material'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudClassstandard from '@/views/wms/base_manage/class_standard/classstandard'
import crudFormData from "./formData";
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
export default {
name: 'FormDia',
components: { rrOperation, pagination, Treeselect },
cruds() {
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudMaterialbase }, optShow: {}})
},
mixins: [presenter(), header()],
dicts: ['product_series'],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '00'
}
},
data() {
return {
fromTypes: [],
cols: [],
dialogVisible: false,
classes: [],
tableRadio: null,
class_idStr: null,
checkrow: null,
rows: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
this.getFromTypes()
},
created() {
console.log("created......")
this.getFromTypes()
},
[CRUD.HOOK.beforeRefresh]() {
if (this.fromTypes.length > 0){
formstruc.getHeader(this.query.form_type).then(res => {
this.cols = res
})
return true
}
return false
},
getFromTypes() {
crudFormData.getFormType().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
this.fromTypes = res
if (this.fromTypes.length > 0) {
this.$set(this.query, 'form_type', this.fromTypes[0].value)
this.crud.toQuery()
}
})
},
toView(row){},
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
return this.dict.label.product_series[row.product_series]
},
queryClassId() {
const param = {
'class_idStr': this.class_idStr
}
crudClassstandard.queryClassById(param).then(res => {
this.classes = res.content.map(obj => {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
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() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.dialogVisible = false
this.$emit('update:dialogShow', false)
this.$emit('setMaterValue', this.tableRadio)
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('setMaterValue', this.rows)
},
loadClass({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>