|
|
|
@ -14,8 +14,6 @@
|
|
|
|
|
<el-form-item class="query-form-item">
|
|
|
|
|
<el-select v-model="query.module" placeholder="模板类型">
|
|
|
|
|
<el-option label="全部" value=""></el-option>
|
|
|
|
|
<!--<el-option label="标签" value="0"></el-option>
|
|
|
|
|
<el-option label="报表" value="1"></el-option>-->
|
|
|
|
|
<el-option label="单据" value="2"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -37,9 +35,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="更新时间" prop="update_time" width="180"></el-table-column>
|
|
|
|
|
|
|
|
|
|
<!-- <el-table-column label="表格行数" prop="rowCount" width="100"></el-table-column>-->
|
|
|
|
|
<!-- <el-table-column label="二维码数量" prop="qrcodeCount" width="125"></el-table-column>-->
|
|
|
|
|
<el-table-column label="所属客户" prop="customerName" width="240"></el-table-column>
|
|
|
|
|
<el-table-column label="备注" prop="remark"></el-table-column>
|
|
|
|
|
<el-table-column label="操作" fixed="right" width="250">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -97,50 +93,42 @@
|
|
|
|
|
top="5vh"
|
|
|
|
|
>
|
|
|
|
|
<el-form :model="formData" :rules="formRules" ref="dataForm">
|
|
|
|
|
|
|
|
|
|
<!-- <el-row :gutter="20">-->
|
|
|
|
|
<!-- <el-col :span="2">-->
|
|
|
|
|
<!-- <div class="ao-text">-->
|
|
|
|
|
<!-- <span>模板名称:</span>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div class="ao-text">-->
|
|
|
|
|
<!-- <span>模板名称:</span>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- <el-col :span="8">-->
|
|
|
|
|
<!-- <el-form-item prop="name">-->
|
|
|
|
|
<!-- <el-input v-model="formData.name" auto-complete="off" :disabled="false"></el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="所属模块" prop="type">-->
|
|
|
|
|
<!-- <el-select v-model="formData.type" placeholder="所属模块">-->
|
|
|
|
|
<!-- <el-option label="订单详情" value="1"></el-option>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- <el-col :span="2">-->
|
|
|
|
|
<!-- <div class="ao-text">-->
|
|
|
|
|
<!-- <span>备注:</span>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- <el-col :span="8">-->
|
|
|
|
|
<!-- <el-form-item prop="type">-->
|
|
|
|
|
<!-- <el-input type="textarea" v-model="formData.remark" rows=6></el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- </el-row>-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<div class="ao-text">
|
|
|
|
|
<span>模板名称:</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-col :span="5">
|
|
|
|
|
<el-form-item prop="name">
|
|
|
|
|
<el-input v-model="formData.name" auto-complete="off" :disabled="false"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<div class="ao-text">
|
|
|
|
|
<span>所属客户:</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="5">
|
|
|
|
|
<el-form-item prop="customerId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.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-col>
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<div class="ao-text">
|
|
|
|
|
<span>备注:</span>
|
|
|
|
@ -148,17 +136,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item prop="module">
|
|
|
|
|
<!-- <el-select v-model="formData.module" placeholder="所属模块">-->
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
|
<!-- v-for="item in moduleNameList"-->
|
|
|
|
|
<!-- :key="item.idStr"-->
|
|
|
|
|
<!-- :label="item.name"-->
|
|
|
|
|
<!-- :value="item.idStr"-->
|
|
|
|
|
<!-- ></el-option>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<el-select v-model="formData.module" placeholder="模板类型">
|
|
|
|
|
<!-- <el-option label="标签" value="0"></el-option>
|
|
|
|
|
<el-option label="报表" value="1"></el-option>-->
|
|
|
|
|
<el-option label="单据" value="2"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -203,7 +181,6 @@
|
|
|
|
|
MB
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">{{ formData.path }}</div>
|
|
|
|
|
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -229,7 +206,6 @@
|
|
|
|
|
:auto-upload="true">
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary" :disabled="uploadDisabled">选取文件
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>-->
|
|
|
|
|
<div slot="tip" class="el-upload__tip" v-if="formData.jrxmlPath==null">只能上传 jrxml
|
|
|
|
|
文件,且不超过 2 MB
|
|
|
|
|
</div>
|
|
|
|
@ -325,6 +301,7 @@ import {BASE_URL} from "../../../config/app";
|
|
|
|
|
import {saveAs} from 'file-saver';
|
|
|
|
|
import {demoPrint} from "@/api/itextpdf/itextpdf";
|
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
|
import {getCompanyList} from "@/api/warehouse/company";
|
|
|
|
|
|
|
|
|
|
const formJson = {
|
|
|
|
|
id: "",
|
|
|
|
@ -337,6 +314,7 @@ const formJson = {
|
|
|
|
|
rowCount: 10,
|
|
|
|
|
qrcodeCount: 1,
|
|
|
|
|
remark: "",
|
|
|
|
|
customerId: null
|
|
|
|
|
};
|
|
|
|
|
const moduleFormJson = {
|
|
|
|
|
id: "",
|
|
|
|
@ -410,6 +388,7 @@ export default {
|
|
|
|
|
uploadDisabled: false,
|
|
|
|
|
moduleLoading: false,
|
|
|
|
|
moduleNameMap: {0: "标签", 1: "报表", 2: "单据"},
|
|
|
|
|
customerList: []
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -442,6 +421,19 @@ export default {
|
|
|
|
|
.then(response => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = response.data.list || [];
|
|
|
|
|
if (this.list.length > 0) {
|
|
|
|
|
this.list.forEach(item =>{
|
|
|
|
|
if (isBlank(item.customerId)) {
|
|
|
|
|
item.customerName = '公共模板';
|
|
|
|
|
} else {
|
|
|
|
|
this.customerList.forEach(customer => {
|
|
|
|
|
if (item.customerId === customer.customerId){
|
|
|
|
|
item.customerName = customer.companyName;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.total = response.data.total || 0;
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
@ -517,15 +509,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 刷新表单
|
|
|
|
|
resetForm() {
|
|
|
|
|
// if (this.$refs["dataForm"]) {
|
|
|
|
|
// // 清空验证信息表单
|
|
|
|
|
// this.$refs["dataForm"].clearValidate();
|
|
|
|
|
// // 刷新表单
|
|
|
|
|
// this.$refs["dataForm"].resetFields();
|
|
|
|
|
// this.fileList = null;
|
|
|
|
|
// this.jrxmlFileList = null;
|
|
|
|
|
// this.getList();
|
|
|
|
|
// }
|
|
|
|
|
// 清空验证信息表单
|
|
|
|
|
this.$refs["dataForm"].clearValidate();
|
|
|
|
|
// 刷新表单
|
|
|
|
@ -578,13 +561,6 @@ export default {
|
|
|
|
|
showFieldExpain(row) {
|
|
|
|
|
this.currentRow = row.fieldExplain.replace('\\\n', '<br>');
|
|
|
|
|
this.centerDialogVisible = true;
|
|
|
|
|
// const {href} = this.$router.resolve({//打开新窗口页面
|
|
|
|
|
// path: '/showText',
|
|
|
|
|
// query: {
|
|
|
|
|
// content: row.fieldExplain
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// window.open(href, '_blank')
|
|
|
|
|
},
|
|
|
|
|
// 显示表单
|
|
|
|
|
handleForm(index, row) {
|
|
|
|
@ -693,29 +669,46 @@ export default {
|
|
|
|
|
this.$message.error("请上传模板文件");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.formLoading = true;
|
|
|
|
|
let data = Object.assign({}, this.formData);
|
|
|
|
|
data.name = data.name.trim();
|
|
|
|
|
data.create_time = null;
|
|
|
|
|
data.update_time = null;
|
|
|
|
|
systemPDFTemplateSave(data, this.formName)
|
|
|
|
|
.then(response => {
|
|
|
|
|
this.formLoading = false;
|
|
|
|
|
if (response.code !== 20000) {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this.$message.success("操作成功");
|
|
|
|
|
this.formVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.formLoading = false;
|
|
|
|
|
if (isBlank(this.formData.customerId)) {
|
|
|
|
|
this.$confirm('所属客户未选择,此模板将添加为公共模板,是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.saveTemplate();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.saveTemplate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
saveTemplate() {
|
|
|
|
|
this.formLoading = true;
|
|
|
|
|
let data = Object.assign({}, this.formData);
|
|
|
|
|
data.name = data.name.trim();
|
|
|
|
|
data.create_time = null;
|
|
|
|
|
data.update_time = null;
|
|
|
|
|
systemPDFTemplateSave(data, this.formName)
|
|
|
|
|
.then(response => {
|
|
|
|
|
this.formLoading = false;
|
|
|
|
|
if (response.code !== 20000) {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this.$message.success("操作成功");
|
|
|
|
|
this.formVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.formLoading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteTemplate(row) {
|
|
|
|
|
this.$confirm("此操作将永久删除该模板, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
@ -783,6 +776,17 @@ export default {
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getCustomerList(key) {
|
|
|
|
|
let query = {};
|
|
|
|
|
if (!isBlank(key)) {
|
|
|
|
|
query.companyName = key;
|
|
|
|
|
}
|
|
|
|
|
getCompanyList(query).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.customerList = res.data || [];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
filters: {
|
|
|
|
|
paramStatusFilterType(paramStatus) {
|
|
|
|
@ -806,6 +810,7 @@ export default {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getPDFModuleNameList();
|
|
|
|
|
this.getModuleList();
|
|
|
|
|
this.getCustomerList();
|
|
|
|
|
this.uploadUrl = BASE_URL + "/udiwms/upload/pdf/template/jasper";
|
|
|
|
|
this.uploadJrxmlUrl = BASE_URL + "/udiwms/upload/pdf/template/jrxml";
|
|
|
|
|
this.headers = {
|
|
|
|
|