推送项目重构代码
This commit is contained in:
@@ -100,6 +100,21 @@
|
||||
</template>
|
||||
{{ detailData.remark == null ? '空' : detailData.remark }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item :span="3">
|
||||
<template slot="label">
|
||||
<i class="el-icon-paperclip"></i>
|
||||
收货单
|
||||
</template>
|
||||
<template v-if="detailData.receiptFiles">
|
||||
<a v-for="f in parseReceiptFiles(detailData.receiptFiles)" :key="f.ossId"
|
||||
:href="f.url" target="_blank" download
|
||||
style="color:#409eff; margin-right:10px; font-size:12px;">
|
||||
<i class="el-icon-paperclip"></i>{{ f.name }}
|
||||
</a>
|
||||
</template>
|
||||
<span v-else style="color:#c0c4cc;">无</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-table v-loading="loading" :data="oaOutWarehouseList" @selection-change="handleSelectionChange">
|
||||
@@ -148,6 +163,9 @@
|
||||
<el-input placeholder="请输入编号" v-model="form.masterNum">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收货单" prop="receiptDoc">
|
||||
<file-upload v-model="form.receiptDoc" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="drawer" label="项目名">
|
||||
<el-input :value="form.projectName" disabled></el-input>
|
||||
</el-form-item>
|
||||
@@ -246,12 +264,14 @@ import {
|
||||
updateOaWarehouseMaster
|
||||
} from "@/api/oa/warehouse/warehouseMaster";
|
||||
import { listRequirements } from "@/api/oa/requirement";
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
import ProjectSelect from "@/components/fad-service/ProjectSelect";
|
||||
|
||||
export default {
|
||||
name: "OaOutWarehouse",
|
||||
components: {
|
||||
ProjectSelect
|
||||
ProjectSelect,
|
||||
FileUpload
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -338,8 +358,31 @@ export default {
|
||||
},
|
||||
created () {
|
||||
this.getList();
|
||||
// 路由带 requirementId 进来时自动打开新增入库表单并预填
|
||||
const q = this.$route && this.$route.query;
|
||||
if (q && q.requirementId) {
|
||||
this.$nextTick(() => {
|
||||
this.handleAdd();
|
||||
this.form.requirementId = Number(q.requirementId) || q.requirementId;
|
||||
// 顺手把预填项推到选项列表,让 select 能显示
|
||||
if (q.requirementTitle) {
|
||||
this.requirementOptions = [{
|
||||
requirementId: this.form.requirementId,
|
||||
title: q.requirementTitle
|
||||
}];
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 后端联查的收货单文件解析("ossId|name|url,,...")
|
||||
parseReceiptFiles (raw) {
|
||||
if (!raw) return []
|
||||
return String(raw).split(',,').map(s => {
|
||||
const [ossId, name, url] = s.split('|')
|
||||
return { ossId, name: name || '收货单', url: url || '' }
|
||||
}).filter(f => f.ossId)
|
||||
},
|
||||
// 远程搜索采购需求
|
||||
loadRequirementOptions (keyword) {
|
||||
this.requirementLoading = true
|
||||
@@ -409,6 +452,7 @@ export default {
|
||||
this.form = {
|
||||
projectId: undefined,
|
||||
requirementId: undefined,
|
||||
receiptDoc: undefined,
|
||||
warehouseList: [],
|
||||
};
|
||||
this.resetForm("form");
|
||||
|
||||
Reference in New Issue
Block a user