|
|
@@ -16,21 +16,34 @@
|
|
|
@saveColumn="saveColumn"
|
|
|
:cell-style="cellStyle"
|
|
|
:summary-method="summaryMethod"
|
|
|
+ @expand-change="expandChange"
|
|
|
>
|
|
|
- <template slot-scope="scope" slot="grossProfitRate">
|
|
|
- {{ scope.row.grossProfitRate }}%
|
|
|
+ <template slot-scope="{ row }" slot="expand">
|
|
|
+ <avue-crud
|
|
|
+ :data="row.itemData"
|
|
|
+ :option="itemOption"
|
|
|
+ :table-loading="row.itemLoading"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ class="itemTable"
|
|
|
+ ></avue-crud>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="grossProfitRate">
|
|
|
+ {{ row.grossProfitRate }}%
|
|
|
</template>
|
|
|
<template slot-scope="{ row }" slot="createUser">
|
|
|
<span>{{ row.createUserName }}</span>
|
|
|
</template>
|
|
|
+ <template slot-scope="{ row }" slot="orderQuantity">
|
|
|
+ <span>{{ row.orderQuantity | IntegerFormat }}</span>
|
|
|
+ </template>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click.stop="newAdd('new')"
|
|
|
- >创建单据 </el-button
|
|
|
- >
|
|
|
+ >创建单据
|
|
|
+ </el-button>
|
|
|
<el-button type="success" size="small" disabled>复制单据</el-button>
|
|
|
<el-button type="info" size="small">报表</el-button>
|
|
|
</template>
|
|
|
@@ -80,7 +93,18 @@
|
|
|
</el-date-picker>
|
|
|
</template>
|
|
|
<template slot-scope="scope" slot="corpId">
|
|
|
- {{ scope.row.corpsName }}
|
|
|
+ <span
|
|
|
+ style="color: #409EFF;cursor: pointer"
|
|
|
+ @click.stop="beforeOpenPage(scope.row, 1)"
|
|
|
+ >{{ scope.row.corpsName }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="orderNo">
|
|
|
+ <span
|
|
|
+ style="color: #409EFF;cursor: pointer"
|
|
|
+ @click.stop="beforeOpenPage(scope.row, 1)"
|
|
|
+ >{{ scope.row.orderNo}}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-button
|
|
|
@@ -100,7 +124,11 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
- <detail-page @goBack="goBack" :detailData="detailData" v-if="!show"></detail-page>
|
|
|
+ <detail-page
|
|
|
+ @goBack="goBack"
|
|
|
+ :detailData="detailData"
|
|
|
+ v-if="!show"
|
|
|
+ ></detail-page>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -110,11 +138,12 @@ import {
|
|
|
getList,
|
|
|
remove,
|
|
|
getPorts,
|
|
|
- gainUser
|
|
|
+ gainUser,
|
|
|
+ getGoodsInfo
|
|
|
} from "@/api/basicData/salesContract";
|
|
|
import detailPage from "./detailsPage.vue";
|
|
|
import { defaultDate } from "@/util/date";
|
|
|
-import { micrometerFormat } from "@/util/validate";
|
|
|
+import { micrometerFormat, IntegerFormat } from "@/util/validate";
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
name: "customerInformation",
|
|
|
@@ -135,7 +164,56 @@ export default {
|
|
|
},
|
|
|
show: true,
|
|
|
detailData: {},
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ itemOption: {
|
|
|
+ align: "center",
|
|
|
+ header: false,
|
|
|
+ menu: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "产品类别",
|
|
|
+ prop: "priceCategory",
|
|
|
+ width: 138,
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品名称",
|
|
|
+ prop: "cname",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品描述",
|
|
|
+ prop: "itemDescription",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "配件描述",
|
|
|
+ prop: "partsDescribe",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "配件价格描述",
|
|
|
+ prop: "partsPriceDescribe",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "orderQuantity",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "金额",
|
|
|
+ prop: "amount",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
components: { detailPage },
|
|
|
@@ -154,10 +232,26 @@ export default {
|
|
|
this.findObject(this.option.column, "createUser").dicData = res.data.data;
|
|
|
});
|
|
|
},
|
|
|
+ filters: {
|
|
|
+ IntegerFormat(num) {
|
|
|
+ return IntegerFormat(num);
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
+ expandChange(row) {
|
|
|
+ if (!row.itemData) {
|
|
|
+ getGoodsInfo({ id: row.id, tradeType: "CK" })
|
|
|
+ .then(res => {
|
|
|
+ this.dataList[row.$index].itemData = res.data.data;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.dataList[row.$index].itemLoading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
//删除列表后面的删除按钮触发触发(row, index, done)
|
|
|
rowDel(row, index, done) {
|
|
|
this.$confirm("确定删除数据?", {
|
|
|
@@ -228,7 +322,15 @@ export default {
|
|
|
};
|
|
|
delete params.businesDate;
|
|
|
}
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ this.$refs.crud.toggleRowExpansion(item, false);
|
|
|
+ });
|
|
|
getList(page.currentPage, page.pageSize, params).then(res => {
|
|
|
+ if (res.data.data.records) {
|
|
|
+ res.data.data.records.forEach(e => {
|
|
|
+ e.itemLoading = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
this.page.total = res.data.data.total;
|
|
|
if (this.page.total) {
|
|
|
@@ -357,4 +459,10 @@ export default {
|
|
|
.page-crad ::v-deep .basic-container__card {
|
|
|
height: 94.2vh;
|
|
|
}
|
|
|
+::v-deep .el-table__expanded-cell[class*="cell"] {
|
|
|
+ padding: 0px;
|
|
|
+}
|
|
|
+.itemTable ::v-deep .el-table {
|
|
|
+ width: 738px;
|
|
|
+}
|
|
|
</style>
|