1.修改选择打印模板接口

master
x_z 3 years ago
parent 271c41c676
commit 8d7dd4242f

@ -37,8 +37,6 @@ export function updateDetailRel(query) {
}); });
} }
export function getSystemPDFModules(query) { export function getSystemPDFModules(query) {
return axios({ return axios({
url: "/system/pdf/module/pdfModules", url: "/system/pdf/module/pdfModules",
@ -47,14 +45,6 @@ export function getSystemPDFModules(query) {
}); });
} }
export function getSystemPDFTemplates(query) {
return axios({
url: "/system/pdf/template/pdfTemplates",
method: "get",
params: query
});
}
export function systemPDFTemplateSave(data, formName, method = "post") { export function systemPDFTemplateSave(data, formName, method = "post") {
let url = formName === "add" ? "/system/pdf/template/save" : "/system/pdf/template/update"; let url = formName === "add" ? "/system/pdf/template/save" : "/system/pdf/template/update";
return axios({ return axios({
@ -80,3 +70,12 @@ export function systemPDFTemplateDeleteById(query) {
params: query params: query
}); });
} }
//查询客户专属和公共模板
export function getCustomerTemplates(data) {
return axios({
url: "/system/pdf/template/customerTemplates",
method: 'post',
data: data
});
}

@ -275,7 +275,6 @@
<script> <script>
import {checkPass} from "../../api/auth/register"; import {checkPass} from "../../api/auth/register";
import {authCustomerRoles} from "../../api/auth/authAdmin"; import {authCustomerRoles} from "../../api/auth/authAdmin";
import {getSystemPDFTemplates} from "../../api/param/systemPDFTemplate";
import { import {
getCustomers, getCustomers,
updateCustomers, updateCustomers,
@ -520,15 +519,6 @@ export default {
}) })
.catch(() => { .catch(() => {
}); });
},
getPDFTemplateList() {
getSystemPDFTemplates()
.then((response) => {
this.pdfTemplates = response.data.list;
})
.catch(() => {
});
} }
}, },
components: { components: {
@ -537,7 +527,6 @@ export default {
mounted() { mounted() {
}, },
created() { created() {
// this.getPDFTemplateList();
this.getList(); this.getList();
this.getRoleList(); this.getRoleList();
} }

@ -32,30 +32,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="功能名称" prop="name" width="250"></el-table-column> <el-table-column label="功能名称" prop="name" width="250"></el-table-column>
<el-table-column label="模板名称" width="250">
<template slot-scope="scope">
<p v-if="scope.row.templateName === null">
<el-button
type="primary"
size="mini"
:disabled="scope.row.templateType == 2"
@click.native.stop="moduleSelectTemplate(scope.row)"
>选择模板
</el-button
>
</p>
<p v-if="scope.row.templateName !== null">
<el-button
type="primary"
:disabled="scope.row.templateType == 2"
size="mini"
@click.native.stop="moduleSelectTemplate(scope.row)"
>{{ scope.row.templateName }}
</el-button
>
</p>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column> <el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" fixed="right" width="250"> <el-table-column label="操作" fixed="right" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
@ -394,16 +370,16 @@
<script> <script>
import { import {
systemPDFTemplateList,
systemPDFTemplateSave, systemPDFTemplateSave,
systemPDFTemplateDeleteById, systemPDFTemplateDeleteById,
systemPDFModuleList, systemPDFModuleList,
systemPDFModuleSave, updateDetailRel, systemPDFModuleSave, updateDetailRel,
getSystemPDFModules, moduleDetail getSystemPDFModules, moduleDetail, getCustomerTemplates
} from "../../../api/param/systemPDFTemplate"; } from "../../../api/param/systemPDFTemplate";
import {saveAs} from "file-saver"; import {saveAs} from "file-saver";
import {BASE_URL} from "../../../config/app"; import {BASE_URL} from "../../../config/app";
import {demoPrint} from "@/api/itextpdf/itextpdf"; import {demoPrint} from "@/api/itextpdf/itextpdf";
import store from "@/store";
const formJson = { const formJson = {
id: "", id: "",
@ -447,6 +423,7 @@ export default {
busRlId: null, busRlId: null,
name: "", name: "",
module: null, module: null,
customerId: store.getters.customerId,
page: 1, page: 1,
limit: 20 limit: 20
}, },
@ -617,20 +594,6 @@ export default {
this.selectTemplateQuery.module = null; this.selectTemplateQuery.module = null;
return true; return true;
}, },
moduleSelectTemplate(row) {
this.moduleFormData = {
id: row.id,
templateId: row.templateId
};
this.moduleFormVisible = true;
this.selectTemplateQuery = {
module: row.templateType,
name: "",
page: 1,
limit: 20
};
this.selectTemplateGetList();
},
busSelectTemplate(row) { busSelectTemplate(row) {
this.moduleFormData = { this.moduleFormData = {
@ -643,6 +606,7 @@ export default {
busRlId: row.id, busRlId: row.id,
type: 1, type: 1,
name: "", name: "",
customerId: store.getters.customerId,
page: 1, page: 1,
limit: 10 limit: 10
}; };
@ -651,7 +615,7 @@ export default {
selectTemplateGetList() { selectTemplateGetList() {
this.selectTemplateLoading = true; this.selectTemplateLoading = true;
systemPDFTemplateList(this.selectTemplateQuery) getCustomerTemplates(this.selectTemplateQuery)
.then(response => { .then(response => {
this.selectTemplateLoading = false; this.selectTemplateLoading = false;
this.selectTemplateList = response.data.list || []; this.selectTemplateList = response.data.list || [];

@ -11,6 +11,24 @@
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="query.name" placeholder="模板名称"></el-input> <el-input v-model="query.name" placeholder="模板名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item">
<el-select
v-model="query.customerId"
filterable
clearable
remote
reserve-keyword
placeholder="所属客户"
:remote-method="getCustomerList"
:loading="loading">
<el-option
v-for="item in customerList"
:key="item.customerId"
:label="item.companyName"
:value="item.customerId">
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="query.module" placeholder="模板类型"> <el-select v-model="query.module" placeholder="模板类型">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
@ -326,6 +344,7 @@ export default {
query: { query: {
name: "", name: "",
module: null, module: null,
customerId: null,
page: 1, page: 1,
limit: 20 limit: 20
}, },

Loading…
Cancel
Save