Browse Source

模板调整

test
kilo 2 years ago
parent
commit
60020d0f3f
  1. 16
      src/option/basic/basicPrintTemplate.js
  2. 56
      src/views/basic/printTemplate/basicPrintTemplate.vue
  3. 1
      src/views/basicdata/warehouse/warehouse/basicdataWarehouse.vue

16
src/option/basic/basicPrintTemplate.js

@ -146,6 +146,15 @@ export default {
editDisplay: false,
viewDisplay: true,
},
{
label: "文件名称",
labelWidth: '100',
prop: "fileName",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: true,
},
{
label: "模板文件",
fileText:'附件上传',
@ -162,11 +171,17 @@ export default {
propsHttp: {
res: 'data',
url: 'link',
name:'originalName'
},
addDisplay: true,
editDisplay: true,
viewDisplay: false,
hide: true,
rules:[{
required: true,
message: "请上传附件",
trigger: "blur"
}]
}
// {
// label: "预留1",
@ -195,3 +210,4 @@ export default {
// },
]
}

56
src/views/basic/printTemplate/basicPrintTemplate.vue

@ -8,6 +8,8 @@
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
:upload-after="uploadAfter"
:upload-before="uploadBefore"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@ -18,7 +20,10 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
@on-load="onLoad"
:cell-class-name="addClass"
@cell-click="pageto"
>
<template #menu-left>
<el-button type="danger"
icon="el-icon-delete"
@ -33,9 +38,11 @@
</el-button>
</template>
<template #menu="{size,row,index}">
<el-button type="primary" text @click="viewTemplate(row)">下载模板</el-button>
</template>
<!-- <template #menu="{size,row,index}">-->
<!-- <el-button type="primary" text @click="dowloadTemplate(row)">下载模板</el-button>-->
<!-- <el-button type="primary" text @click="viewTemplate(row)">查看模板</el-button>-->
<!-- </template>-->
</avue-crud>
</basic-container>
</template>
@ -65,7 +72,9 @@
},
selectionList: [],
option: option,
data: []
data: [],
fileName:'',
};
},
computed: {
@ -88,6 +97,8 @@
},
methods: {
rowSave(row, done, loading) {
console.log("row",row);
row.fileName = this.fileName;
add(row).then(() => {
this.onLoad(this.page);
this.$message({
@ -205,9 +216,38 @@
this.onLoad(this.page, this.query);
},
//
viewTemplate(row){
dowloadTemplate(row){
window.open(row.templateUrl,'_blank')
},
viewTemplate(row){
console.log('查看模板');
// window.open(row.templateUrl,'_blank')
},
uploadBefore(file, done, loading,column){
console.log("上传之前file",file);
this.fileName = file.name;
done(file);
},
uploadAfter(res, done, loading,column){
console.log("上传之前之后",res);
done();
},
addClass({ row, column, rowIndex, columnIndex }){
if (columnIndex===6 && !!row.fileName){
return "cell-color";
}
},
pageto(row, column, cell, event){
console.log("点击文件名称");
if (column.label == "文件名称") {
// let path = this.$router.push({
// path: row.templateUrl,
// });
window.open(row.templateUrl)
}
},
onLoad(page, params = {}) {
this.loading = true;
@ -234,4 +274,8 @@
</script>
<style>
.cell-color {
color: #409eff !important;
cursor: pointer;
}
</style>

1
src/views/basicdata/warehouse/warehouse/basicdataWarehouse.vue

@ -614,6 +614,7 @@ export default {
handleEdit (row) {
this.title = '编辑'
this.box = true
this.$refs['form'].resetFields();
getDetail(row.id).then(res => {
this.form = res.data.data;
this.form.fireRatingNot = this.form.fireRatingNot.toString();

Loading…
Cancel
Save