|
@@ -55,6 +55,18 @@
|
|
|
:configuration="configuration"
|
|
|
></select-component>
|
|
|
</template>
|
|
|
+ <template slot="dateValiditySearch">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="search.dateValidity"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ :default-time="['00:00:00', '23:59:59']"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope" slot="corpId">
|
|
|
{{ scope.row.corpName }}
|
|
|
</template>
|
|
@@ -64,13 +76,16 @@
|
|
|
<template slot-scope="scope" slot="status">
|
|
|
{{ scope.row.status | orderStateFormat }}
|
|
|
</template>
|
|
|
+ <template slot-scope="scope" slot="taxRate">
|
|
|
+ {{ scope.row.taxRate | taxRateFormat }}
|
|
|
+ </template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
size="small"
|
|
|
@click.stop="editOpen(scope.row, 2)"
|
|
|
- >编辑
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -91,6 +106,7 @@
|
|
|
:option="excelOption"
|
|
|
v-model="excelForm"
|
|
|
:upload-after="uploadAfter"
|
|
|
+ class="excelUpload"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
</basic-container>
|
|
@@ -100,10 +116,11 @@
|
|
|
<script>
|
|
|
import option from "./config/mainList.json";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
-import { getList, remove } from "@/api/maintenance/priceLibrary";
|
|
|
+import { getList, remove, getGoodstype } from "@/api/maintenance/priceLibrary";
|
|
|
import { defaultDate } from "@/util/date";
|
|
|
import { micrometerFormat } from "@/util/validate";
|
|
|
import { orderStateFormat } from "@/enums/order-stauts";
|
|
|
+import { taxRateFormat } from "@/enums/tax-rate";
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
name: "customerInformation",
|
|
@@ -146,9 +163,7 @@ export default {
|
|
|
dicData: [],
|
|
|
clearable: true
|
|
|
},
|
|
|
- search: {
|
|
|
- businesDate: defaultDate()
|
|
|
- },
|
|
|
+ search: {},
|
|
|
form: {},
|
|
|
option: {},
|
|
|
parentId: 0,
|
|
@@ -173,10 +188,17 @@ export default {
|
|
|
this.getWorkDicts("billType").then(res => {
|
|
|
this.findObject(this.option.column, "billType").dicData = res.data.data;
|
|
|
});
|
|
|
+ getGoodstype(1, 500).then(res => {
|
|
|
+ this.findObject(this.option.column, "goodsTypeName").dicData =
|
|
|
+ res.data.data.records;
|
|
|
+ });
|
|
|
},
|
|
|
filters: {
|
|
|
orderStateFormat(val) {
|
|
|
return orderStateFormat(val);
|
|
|
+ },
|
|
|
+ taxRateFormat(val) {
|
|
|
+ return taxRateFormat(val);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -184,6 +206,9 @@ export default {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
|
+ if (res != "导入成功") {
|
|
|
+ this.$message.error(res);
|
|
|
+ }
|
|
|
this.excelBox = false;
|
|
|
this.page.currentPage = 1;
|
|
|
this.onLoad(this.page);
|
|
@@ -222,11 +247,16 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
editOpen(row, status) {
|
|
|
+ this.$message.warning("暂不支持修改");
|
|
|
console.log(row, status);
|
|
|
},
|
|
|
//点击搜索按钮触发
|
|
|
searchChange(params, done) {
|
|
|
- this.page.currentPage = 1;
|
|
|
+ if (params.dateValidity) {
|
|
|
+ params.dateValidityStart = params.dateValidity[0];
|
|
|
+ params.dateValidityEnd = params.dateValidity[1];
|
|
|
+ }
|
|
|
+ delete params.dateValidity;
|
|
|
this.onLoad(this.page, params);
|
|
|
done();
|
|
|
},
|
|
@@ -260,30 +290,20 @@ export default {
|
|
|
if (columns.length > 0) {
|
|
|
columns.forEach((item, index) => {
|
|
|
sums[0] = "合计";
|
|
|
- if (
|
|
|
- item.property == "orderQuantity" ||
|
|
|
- item.property == "amount" ||
|
|
|
- item.property == "purchaseAmount"
|
|
|
- ) {
|
|
|
- let qtySum = 0;
|
|
|
- let instoreSum = 0;
|
|
|
- let totalSum = 0;
|
|
|
+ if (item.property == "price" || item.property == "purchaseAmount") {
|
|
|
+ let priceSum = 0;
|
|
|
+ let amountSum = 0;
|
|
|
data.forEach(e => {
|
|
|
- qtySum = _.add(qtySum, Number(e.orderQuantity));
|
|
|
- instoreSum = _.add(instoreSum, Number(e.amount));
|
|
|
- totalSum = _.add(totalSum, Number(e.purchaseAmount));
|
|
|
+ priceSum = _.add(priceSum, Number(e.price));
|
|
|
+ amountSum = _.add(amountSum, Number(e.purchaseAmount));
|
|
|
});
|
|
|
- //数量总计
|
|
|
- if (item.property == "orderQuantity") {
|
|
|
- sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
|
|
|
+ //最新价格
|
|
|
+ if (item.property == "price") {
|
|
|
+ sums[index] = micrometerFormat(priceSum);
|
|
|
}
|
|
|
- //入库金额总计
|
|
|
- if (item.property == "amount") {
|
|
|
- sums[index] = micrometerFormat(instoreSum);
|
|
|
- }
|
|
|
- //金额总计
|
|
|
+ //采购价格
|
|
|
if (item.property == "purchaseAmount") {
|
|
|
- sums[index] = micrometerFormat(totalSum);
|
|
|
+ sums[index] = micrometerFormat(amountSum);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -294,11 +314,6 @@ export default {
|
|
|
this.onLoad(this.page, this.search);
|
|
|
},
|
|
|
async saveColumn() {
|
|
|
- /**
|
|
|
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
- */
|
|
|
const inSave = await this.saveColumnData(
|
|
|
this.getColumnName(50),
|
|
|
this.option
|
|
@@ -320,4 +335,7 @@ export default {
|
|
|
.page-crad ::v-deep .basic-container__card {
|
|
|
height: 94.2vh;
|
|
|
}
|
|
|
+.excelUpload ::v-deep .el-upload-list {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
</style>
|