|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <basic-container v-if="show" class="page-crad">
|
|
|
+ <basic-container class="page-crad">
|
|
|
<avue-crud
|
|
|
ref="crud"
|
|
|
:option="option"
|
|
@@ -23,9 +23,16 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
- @click.stop="newAdd()"
|
|
|
- >新单</el-button
|
|
|
+ @click.stop="excelBox = !excelBox"
|
|
|
+ >导入</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ size="small"
|
|
|
+ @click="derivation()"
|
|
|
+ >下载模板
|
|
|
+ </el-button>
|
|
|
<el-button type="info" size="small">报表</el-button>
|
|
|
</template>
|
|
|
<template slot="cnameSearch">
|
|
@@ -52,13 +59,6 @@
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- icon="el-icon-view"
|
|
|
- size="small"
|
|
|
- @click.stop="beforeOpenPage(scope.row, 1)"
|
|
|
- >查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
icon="el-icon-edit"
|
|
|
size="small"
|
|
|
@click.stop="editOpen(scope.row, 2)"
|
|
@@ -73,15 +73,26 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ title="导入价格"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="excelBox"
|
|
|
+ width="555px"
|
|
|
+ >
|
|
|
+ <avue-form
|
|
|
+ :option="excelOption"
|
|
|
+ v-model="excelForm"
|
|
|
+ :upload-after="uploadAfter"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</basic-container>
|
|
|
- <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import option from "./config/mainList.json";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
import { getList, remove } from "@/api/maintenance/priceLibrary";
|
|
|
-import detailPage from "./detailsPage.vue";
|
|
|
import { defaultDate } from "@/util/date";
|
|
|
import { micrometerFormat } from "@/util/validate";
|
|
|
import { orderStateFormat } from "@/enums/order-stauts";
|
|
@@ -90,6 +101,27 @@ export default {
|
|
|
name: "customerInformation",
|
|
|
data() {
|
|
|
return {
|
|
|
+ excelOption: {
|
|
|
+ submitBtn: false,
|
|
|
+ emptyBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "导入数据",
|
|
|
+ prop: "excelFile",
|
|
|
+ type: "upload",
|
|
|
+ drag: true,
|
|
|
+ loadText: "导入数据中,请稍等",
|
|
|
+ span: 24,
|
|
|
+ propsHttp: {
|
|
|
+ res: "data"
|
|
|
+ },
|
|
|
+ tip: "请上传 .xls,.xlsx 标准格式文件",
|
|
|
+ action: "/api/blade-mocha-item/pricebank/importPrice"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ excelBox: false,
|
|
|
+ excelForm: {},
|
|
|
goodsConfiguration: {
|
|
|
multipleChoices: false,
|
|
|
multiple: false,
|
|
@@ -116,14 +148,13 @@ export default {
|
|
|
page: {
|
|
|
pageSize: 10,
|
|
|
currentPage: 1,
|
|
|
- total: 0
|
|
|
+ total: 0,
|
|
|
+ pageSizes:[10,50,100,200,300,400,500]
|
|
|
},
|
|
|
- show: true,
|
|
|
detailData: {},
|
|
|
loading: false
|
|
|
};
|
|
|
},
|
|
|
- components: { detailPage },
|
|
|
async created() {
|
|
|
/**
|
|
|
* 已定义全局方法,直接使用,getColumnData获取列数据,参数传值(表格名称,引入的本地JSON的数据定义的名称)
|
|
@@ -131,28 +162,8 @@ export default {
|
|
|
* 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
*/
|
|
|
this.option = await this.getColumnData(this.getColumnName(50), option);
|
|
|
- let _this = this;
|
|
|
- this.option.column.forEach(e => {
|
|
|
- if (e.prop == "exchangeRate") {
|
|
|
- e.formatter = function(row) {
|
|
|
- return _this.textFormat(
|
|
|
- Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
|
|
|
- "0.00%"
|
|
|
- );
|
|
|
- };
|
|
|
- }
|
|
|
- if (e.prop == "creditAmount") {
|
|
|
- e.formatter = function(row) {
|
|
|
- return _this.textFormat(
|
|
|
- Number(row.creditAmount ? row.creditAmount : 0),
|
|
|
- "#,##0.00"
|
|
|
- );
|
|
|
- };
|
|
|
- }
|
|
|
- });
|
|
|
this.getWorkDicts("billType").then(res => {
|
|
|
- this.findObject(this.option.column, "billType").dicData =
|
|
|
- res.data.data;
|
|
|
+ this.findObject(this.option.column, "billType").dicData = res.data.data;
|
|
|
});
|
|
|
},
|
|
|
filters: {
|
|
@@ -164,6 +175,26 @@ export default {
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
+ uploadAfter(res, done, loading, column) {
|
|
|
+ this.excelBox = false;
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page);
|
|
|
+ loading();
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ derivation() {
|
|
|
+ this.$confirm("是否下载模板?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ window.open(
|
|
|
+ `/api/blade-mocha-item/pricebank/exportPrice?${
|
|
|
+ this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
//删除列表后面的删除按钮触发触发(row, index, done)
|
|
|
rowDel(row, index, done) {
|
|
|
this.$confirm("确定删除数据?", {
|
|
@@ -182,20 +213,8 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- //查看跳转页面
|
|
|
- beforeOpenPage(row, status) {
|
|
|
- this.detailData = {
|
|
|
- id: row.id,
|
|
|
- status: status
|
|
|
- };
|
|
|
- this.show = false;
|
|
|
- },
|
|
|
editOpen(row, status) {
|
|
|
- this.detailData = {
|
|
|
- id: row.id,
|
|
|
- status: status
|
|
|
- };
|
|
|
- this.show = false;
|
|
|
+ console.log(row, status);
|
|
|
},
|
|
|
//点击搜索按钮触发
|
|
|
searchChange(params, done) {
|
|
@@ -266,13 +285,6 @@ export default {
|
|
|
refreshChange() {
|
|
|
this.onLoad(this.page, this.search);
|
|
|
},
|
|
|
- newAdd() {
|
|
|
- this.show = false;
|
|
|
- },
|
|
|
- goBack() {
|
|
|
- this.detailData = this.$options.data().detailData;
|
|
|
- this.show = true;
|
|
|
- },
|
|
|
async saveColumn() {
|
|
|
/**
|
|
|
* 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
@@ -289,11 +301,6 @@ export default {
|
|
|
this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- watch: {
|
|
|
- option: function() {
|
|
|
- this.search.businesDate = defaultDate();
|
|
|
- }
|
|
|
}
|
|
|
};
|
|
|
</script>
|