推送项目重构代码
This commit is contained in:
@@ -26,21 +26,36 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outWareHouseList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" />
|
||||
<el-table-column label="入库单编号" align="center" prop="masterNum" />
|
||||
<el-table-column label="操作时间" align="center" prop="signTime">
|
||||
<el-table v-loading="loading" :data="outWareHouseList" @selection-change="handleSelectionChange" stripe size="small">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column label="入库时间" prop="signTime" width="100">
|
||||
<template slot-scope="scope">{{ parseTime(scope.row.signTime, '{y}-{m}-{d}') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库人" prop="signUser" width="80" />
|
||||
<el-table-column label="关联需求" min-width="160" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.signTime, '{y}-{m}-{d}') }}</span>
|
||||
<span v-if="scope.row.requirementName">{{ scope.row.requirementName }}</span>
|
||||
<span v-else style="color:#c0c4cc;">无关联</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="signUser" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="关联项目" prop="projectName" min-width="160" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="showDetail(scope.row)">查看详情
|
||||
</el-button>
|
||||
<span v-if="scope.row.projectName">{{ scope.row.projectName }}</span>
|
||||
<span v-else style="color:#c0c4cc;">无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料概览" prop="itemsSummary" min-width="220" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.itemsSummary">{{ scope.row.itemsSummary }}</span>
|
||||
<el-button v-else type="text" size="mini" @click="showDetail(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料种类" prop="itemCount" width="80" align="right" />
|
||||
<el-table-column label="入库总数" prop="totalQty" width="80" align="right" />
|
||||
<el-table-column label="备注" prop="remark" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="showDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -58,7 +73,7 @@
|
||||
<i class="el-icon-s-order"></i>
|
||||
入库单
|
||||
</template>
|
||||
{{ detailData.masterId }}
|
||||
{{ detailData.masterNum }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item>
|
||||
@@ -106,6 +121,20 @@
|
||||
<!-- 添加或修改仓库入库对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="采购需求" prop="requirementId" required>
|
||||
<el-select v-model="form.requirementId" filterable remote
|
||||
:remote-method="loadRequirementOptions" :loading="requirementLoading"
|
||||
placeholder="按需求标题搜索(必选)" style="width: 100%"
|
||||
@change="onRequirementChange">
|
||||
<el-option v-for="r in requirementOptions" :key="r.requirementId"
|
||||
:label="r.title" :value="r.requirementId">
|
||||
<span style="float: left">{{ r.title }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 12px">
|
||||
{{ r.projectName || '无项目' }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定项目">
|
||||
<el-radio-group v-model="projectFlag" :disabled="drawer">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
@@ -216,6 +245,7 @@ import {
|
||||
listOaWarehouseMaster,
|
||||
updateOaWarehouseMaster
|
||||
} from "@/api/oa/warehouse/warehouseMaster";
|
||||
import { listRequirements } from "@/api/oa/requirement";
|
||||
import ProjectSelect from "@/components/fad-service/ProjectSelect";
|
||||
|
||||
export default {
|
||||
@@ -270,6 +300,9 @@ export default {
|
||||
open: false,
|
||||
// 是否绑定项目
|
||||
projectFlag: false,
|
||||
// 采购需求下拉
|
||||
requirementOptions: [],
|
||||
requirementLoading: false,
|
||||
// 库存查询参数
|
||||
warehouseParams: {
|
||||
pageSize: 999,
|
||||
@@ -297,6 +330,9 @@ export default {
|
||||
warehouseId: [
|
||||
{ required: true, message: "入库对象id不能为空", trigger: "blur" }
|
||||
],
|
||||
requirementId: [
|
||||
{ required: true, message: "入库必须关联采购需求", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -304,6 +340,20 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 远程搜索采购需求
|
||||
loadRequirementOptions (keyword) {
|
||||
this.requirementLoading = true
|
||||
listRequirements({ pageNum: 1, pageSize: 20, title: keyword || undefined, status: 1 })
|
||||
.then(res => { this.requirementOptions = res.rows || [] })
|
||||
.finally(() => { this.requirementLoading = false })
|
||||
},
|
||||
onRequirementChange (id) {
|
||||
const r = this.requirementOptions.find(x => x.requirementId === id)
|
||||
if (r && r.projectId) {
|
||||
this.projectFlag = true
|
||||
this.form.projectId = r.projectId
|
||||
}
|
||||
},
|
||||
|
||||
// 添加新的一行
|
||||
addRow () {
|
||||
@@ -358,6 +408,7 @@ export default {
|
||||
reset () {
|
||||
this.form = {
|
||||
projectId: undefined,
|
||||
requirementId: undefined,
|
||||
warehouseList: [],
|
||||
};
|
||||
this.resetForm("form");
|
||||
@@ -382,6 +433,7 @@ export default {
|
||||
handleAdd () {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.loadRequirementOptions();
|
||||
if (this.drawer) {
|
||||
// 如果抽屉是打开的说明是从项目处进入的新增,从而加入projectId
|
||||
this.projectFlag = true;
|
||||
|
||||
Reference in New Issue
Block a user