|
|
|
|
@ -41,6 +41,9 @@
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</template>
|
|
|
|
|
<el-select size="small" style="width: 200px;margin-right: 10px" v-model="select.product_id">
|
|
|
|
|
<el-option v-for="item in products" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<Input
|
|
|
|
|
v-model="select.keyword"
|
|
|
|
|
placeholder="关键字搜索"
|
|
|
|
|
@ -68,7 +71,6 @@
|
|
|
|
|
:total="total"
|
|
|
|
|
:list="list"
|
|
|
|
|
:table-item="table"
|
|
|
|
|
:expand-row-keys="expandRowKeys"
|
|
|
|
|
@pageSizeChange="(e) => (select.page_size = e)"
|
|
|
|
|
@pageIndexChange="
|
|
|
|
|
(e) => {
|
|
|
|
|
@ -76,7 +78,6 @@
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
@expand-change="expandChange"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column
|
|
|
|
|
@ -100,6 +101,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getList as getProducts } from "@/api/product"
|
|
|
|
|
import { serveList, getList } from "@/api/serveDetail";
|
|
|
|
|
import { parseTime, getAgeByIdcard } from "@/utils";
|
|
|
|
|
import { download } from "@/utils/downloadRequest";
|
|
|
|
|
@ -111,56 +113,30 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
expandRowKeys:[],
|
|
|
|
|
isShowDraw: false,
|
|
|
|
|
isShowDetail: false,
|
|
|
|
|
datePickMode: 1, //0为年1为月
|
|
|
|
|
products:[],
|
|
|
|
|
select: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
keyword: "",
|
|
|
|
|
year: `${new Date().getFullYear()}`,
|
|
|
|
|
month: this.$moment(new Date()).format("YYYY-MM"),
|
|
|
|
|
product_id:''
|
|
|
|
|
},
|
|
|
|
|
types: [],
|
|
|
|
|
|
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
innerList: [],
|
|
|
|
|
table: [
|
|
|
|
|
{
|
|
|
|
|
type: "expand",
|
|
|
|
|
width: 44,
|
|
|
|
|
expandFn: (row) => {
|
|
|
|
|
return (
|
|
|
|
|
<Table
|
|
|
|
|
style={{
|
|
|
|
|
margin: "0 166px 0 40px",
|
|
|
|
|
}}
|
|
|
|
|
data={this.innerList}
|
|
|
|
|
width={1370}
|
|
|
|
|
stripe={true}
|
|
|
|
|
border={true}
|
|
|
|
|
size="small"
|
|
|
|
|
columns={
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
title:'序号',
|
|
|
|
|
key:'id'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
></Table>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "name",
|
|
|
|
|
prop: "customer.name",
|
|
|
|
|
label: "客户姓名",
|
|
|
|
|
width: 140,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "idcard",
|
|
|
|
|
prop: "customer.idcard",
|
|
|
|
|
label: "年龄",
|
|
|
|
|
width: 80,
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
@ -168,17 +144,17 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "sex",
|
|
|
|
|
prop: "customer.sex",
|
|
|
|
|
label: "性别",
|
|
|
|
|
width: 80,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "idcard",
|
|
|
|
|
prop: "customer.idcard",
|
|
|
|
|
label: "身份证号",
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "phone",
|
|
|
|
|
prop: "customer.phone",
|
|
|
|
|
label: "手机号",
|
|
|
|
|
width: 150,
|
|
|
|
|
},
|
|
|
|
|
@ -202,26 +178,13 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async expandChange({ row, expanded }) {
|
|
|
|
|
console.log(row, expanded);
|
|
|
|
|
if (row.expandContent) return;
|
|
|
|
|
this.expandRowKeys = [row.id]
|
|
|
|
|
const res = await getList({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
customer_id: row.id,
|
|
|
|
|
year: this.select.year,
|
|
|
|
|
month: this.select.month,
|
|
|
|
|
});
|
|
|
|
|
//row.expandContent = res.data || [];
|
|
|
|
|
let currentIndex = 0;
|
|
|
|
|
this.list.some((item, index) => {
|
|
|
|
|
if (item.id === row.id) {
|
|
|
|
|
currentIndex = index;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$set(this, "innerList", res.data);
|
|
|
|
|
async getProducts(){
|
|
|
|
|
const res = await getProducts({
|
|
|
|
|
page:1,
|
|
|
|
|
page_size:999
|
|
|
|
|
})
|
|
|
|
|
this.products = res.data
|
|
|
|
|
this.select.product_id = this.products[0]?.id
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
exportServe() {
|
|
|
|
|
@ -253,7 +216,8 @@ export default {
|
|
|
|
|
|
|
|
|
|
detail(scope) {
|
|
|
|
|
this.$refs["serveDraw"].row = scope.row;
|
|
|
|
|
this.$refs["serveDraw"].select.customer_id = scope.row.id;
|
|
|
|
|
this.$refs["serveDraw"].select.id = scope.row.id;
|
|
|
|
|
this.$refs["serveDraw"].select.customer_id = scope.row.customer.id;
|
|
|
|
|
this.$refs["serveDraw"].select.year = this.select.year;
|
|
|
|
|
this.$refs["serveDraw"].select.month = this.select.month;
|
|
|
|
|
this.$refs["serveDraw"].isShow = true;
|
|
|
|
|
@ -264,8 +228,9 @@ export default {
|
|
|
|
|
this.list = res.data;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getList();
|
|
|
|
|
async created() {
|
|
|
|
|
await this.getProducts();
|
|
|
|
|
await this.getList();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|