This commit is contained in:
2024-05-14 19:17:53 +08:00
parent 03db2b6d21
commit 38e932d7d2
14 changed files with 467 additions and 80 deletions

View File

@@ -0,0 +1,226 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
title="单据详情"
:visible.sync="dialogVisible"
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" size="mini" label-width="100px" label-suffix=":">
<el-form-item label="单据编号" prop="code">
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据类型" prop="form_type">
<el-input v-model="form.form_type" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据编码" prop="biz_code">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据时间" prop="biz_date">
<!-- <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.biz_date" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="批次" prop="pcsn">
<el-input v-model="form.pcsn" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="物料数量" prop="qty">
<el-input v-model="form.qty" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="载具编号" prop="vehicle_code">
<el-input v-model="form.vehicle_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据状态" prop="status">
<el-input v-model="form.status" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<!-- <el-date-picker v-model="form.create_time" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.create_time" disabled clearable style="width: 210px"/>
</el-form-item>
<template v-for="(col,index) in cols">
<el-form-item label="col.lable" prop="bill_code">
<label slot="label">{{ col.lable }}:</label>
<el-input disabled v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 210px"/>
</el-form-item>
</template>
</el-form>
<div class="crud-opts2">
<span class="role-span2">单据明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120"/>
<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>
</el-card>
</el-dialog>
</template>
<script>
import {crud} from '@crud/crud'
import crudFormData, {getSonFormData} from './formData'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
export default {
name: 'ViewDialog',
components: {formstruc},
mixins: [crud()],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'task_status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
cols: [],
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
},
setForm(row) {
this.dialogVisible = true
this.form = row
formstruc.getHeader(this.form.form_type).then(res => {
this.cols = res
})
this.queryTableDtl(row.id)
},
close() {
this.dialogVisible = false
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl(id) {
crudFormData.getSonFormData(id).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getIosInvDis({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
},
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -31,5 +31,19 @@ export function getFormType() {
})
}
export function getParentFormTypes() {
return request({
url: 'api/bmFormStruc/getParentFormTypes',
method: 'get',
})
}
export default { add, edit, del, getFormType }
export function getSonFormData(id) {
return request({
url: 'api/pmFormData/getSonFormData/' + id,
method: 'get',
})
}
export default {add, edit, del, getFormType, getParentFormTypes, getSonFormData}

View File

@@ -27,24 +27,13 @@
:label="item.label"
/>
</el-select>
<!-- <el-select-->
<!-- v-model="query.form_type"-->
<!-- placeholder="请选择单据类型"-->
<!-- clearable-->
<!-- filterable-->
<!-- size="mini"-->
<!-- class="filter-item"-->
<!-- style="width: 185px;"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in fromTypes"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- >-->
<!-- </el-option>-->
<!-- </el-select>-->
</el-form-item>
<template v-if="hideShowDialog" v-for="(col,index) in cols">
<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>
@@ -68,21 +57,38 @@
>
导入
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- icon="el-icon-view"-->
<!-- size="mini"-->
<!-- @click="hideShow"-->
<!-- >-->
<!-- </el-button>-->
<el-button
slot="right"
class="filter-item"
icon="el-icon-view"
size="mini"
@click="hideShow"
>
</el-button>
</crudOperation>
<!--表格渲染-->
<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"/>
<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="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
@@ -93,8 +99,9 @@
<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 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
@@ -119,20 +126,20 @@
<!--分页组件-->
<pagination/>
</div>
<!-- <UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="crud.toQuery()"/>-->
<ViewDialog ref="viewDialog"/>
</div>
</template>
<script>
import crudFormData from './formData'
import CRUD, {crud, form, header, presenter} from '@crud/crud'
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
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 ViewDialog from './ViewDialog'
// import UploadDialog from './UploadDialog'
let defaultForm = {
@@ -156,7 +163,7 @@ let defaultForm = {
export default {
name: 'FormData',
dicts: ['base_data'],
components: {pagination, crudOperation, rrOperation, udOperation, Treeselect},
components: {pagination, crudOperation, rrOperation, udOperation, ViewDialog},
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -168,39 +175,45 @@ export default {
optShow: {
add: true,
reset: true
},
query: {
form_data: {}
}
})
},
data() {
return {
cols:[],
cols: [],
classes: [],
uploadShow: false,
fromTypes: [],
permission: {},
rules: {}
rules: {},
hideShowDialog: false
}
},
created() {
// 获取分类
this.getFromTypes()
// this.crud.toQuery()
},
mounted() {
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
if (this.fromTypes.length > 0){
if (this.fromTypes.length > 0) {
formstruc.getHeader(this.query.form_type).then(res => {
this.cols = res
res.forEach(a => {
this.$set(this.query, 'form_query', {})
})
})
return true
}
return false
},
getFromTypes() {
crudFormData.getFormType().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
crudFormData.getParentFormTypes().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
this.fromTypes = res
if (this.fromTypes.length > 0) {
this.$set(this.query, 'form_type', this.fromTypes[0].value)
@@ -208,10 +221,20 @@ export default {
}
})
},
hideShow() {
if (this.hideShowDialog) {
//this.$set(this.query, 'form_query', {})
}
this.hideShowDialog = !this.hideShowDialog
},
toView(row) {
if (row !== null) {
this.$refs.viewDialog.setForm(row)
}
},
}
}
</script>
<style scoped>
</style>