feat():根据母件编码分页查询子集

master
jiyufei 2 months ago
parent 54103d3371
commit 840b20d2ad

@ -1,57 +1,29 @@
<template>
<el-dialog title="详情" :close-on-click-modal="false" append-to-body :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="24">
<jnpf-form-tip-item label="母件编码" prop="pieceId">
<p>{{ dataForm.pieceId }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="母件名称" prop="pieceName">
<p>{{ dataForm.pieceName }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="规格型号" prop="models">
<p>{{ dataForm.models }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="计量单位" prop="unit">
<p>{{ dataForm.unit }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="版本代号" prop="versionCode">
<p>{{ dataForm.versionCode }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="版本说明" prop="versionIllustrate">
<p>{{ dataForm.versionIllustrate }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="版本日期" prop="versionDate">
<p>{{ dataForm.versionDate }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="创建时间" prop="creatorTime">
<p>{{ dataForm.creatorTime }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="单据状态" prop="documentStatus">
<p>{{ dataForm.documentStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-dialog title="子件详情" :close-on-click-modal="false" append-to-body :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1200px">
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod"
border height="500px">
<el-table-column prop="subsetId" label="子件编码" align="center">
</el-table-column>
<el-table-column prop="subsetName" label="子件名称" align="center">
</el-table-column>
<el-table-column prop="subsetModel" label="规格型号" align="center">
</el-table-column>
<el-table-column prop="unit" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="baseUse" label="基本用量" align="center">
</el-table-column>
<el-table-column prop="baseNum" label="基础数量" align="center">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="status" label="单据状态" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == '1'"></el-tag>
<el-tag type="success" v-else-if="scope.row.status == '2'">已审核</el-tag>
</template>
</el-form>
</el-row>
</el-table-column>
</JNPF-table>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
@ -73,7 +45,17 @@ export default {
visible: false,
detailVisible: false,
loading: false,
mergeList: [],
list: [],
expandObj: {},
listLoading: true,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
dataForm: {
id: '',
pieceId: '',
@ -115,20 +97,42 @@ export default {
this.dataForm = _dataAll
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.init()
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.listLoading = true;
let _query = {
...this.listQuery,
pieceId: id
};
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/YysBillMaterial/detail/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
this.loading = true
request({
url: '/api/example/YysBillMaterial/queryByPieceId',
method: 'POST',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
})
},

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="母件编码" prop="pieceId">
<JnpfInput v-model="dataForm.pieceId" @change="changeData('pieceId', -1)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>

@ -75,7 +75,7 @@
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
<el-button type="text" @click="goDetail(scope.row.pieceId)">
</el-button>
</template>
</el-table-column>

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="物料编码" prop="materialCode">
<JnpfInput v-model="dataForm.materialCode" @change="changeData('materialCode', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="分类编码" prop="classId">
<JnpfInput v-model="dataForm.classId" @change="changeData('classId', -1)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -21,9 +21,9 @@
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="上级分类" prop="parentClassification">
<JnpfInput v-model="dataForm.parentClassification"
@change="changeData('parentClassification', -1)" placeholder="请输入" clearable
<jnpf-form-tip-item label="上级分类" prop="parentClassname">
<JnpfInput v-model="dataForm.parentClassname"
@change="changeData('parentClassname', -1)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="物料编码" prop="materialId">
<JnpfInput v-model="dataForm.materialId" @change="changeData('materialId', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -23,7 +23,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="物料分类" prop="materialClassification">
<JnpfInput v-model="dataForm.materialClassification"
@change="changeData('materialClassification', -1)" placeholder="请输入" clearable
@change="changeData('materialClassification', -1)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="分类编码" prop="classId">
<JnpfInput v-model="dataForm.classId" @change="changeData('classId', -1)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -21,9 +21,9 @@
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="上级分类" prop="parentClassification">
<JnpfInput v-model="dataForm.parentClassification"
@change="changeData('parentClassification', -1)" placeholder="请输入" clearable
<jnpf-form-tip-item label="上级分类" prop="parentClassname">
<JnpfInput v-model="dataForm.parentClassname"
@change="changeData('parentClassname', -1)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="供应商编码" prop="supplierId">
<JnpfInput v-model="dataForm.supplierId" @change="changeData('supplierId', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>

@ -9,7 +9,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="单位编码" prop="unitId">
<JnpfInput v-model="dataForm.unitId" @change="changeData('unitId', -1)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>

Loading…
Cancel
Save