更新代码

This commit is contained in:
xiao-fajia 2024-09-25 15:42:23 +08:00
parent 93acd9eab1
commit 0100f93a2a
3 changed files with 356 additions and 122 deletions

View File

@ -13,6 +13,11 @@ export default {
props: { props: {
value: { value: {
type: Object, type: Object,
},
isGet:{
type: String,
default: '',
required: false
} }
}, },
data() { data() {
@ -41,7 +46,7 @@ export default {
methods: { methods: {
async listStaff() { async listStaff() {
try { try {
if (this.hasRequest) return; if (!this.isGet) return;
const res = await getStaffList() const res = await getStaffList()
this.staffList = res.data this.staffList = res.data
this.hasRequest = true this.hasRequest = true

View File

@ -21,6 +21,14 @@
<span class="item__txt">{{ scope.row.name ? scope.row.name : scope.row.goods }}</span> <span class="item__txt">{{ scope.row.name ? scope.row.name : scope.row.goods }}</span>
</div> </div>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="使用权益" width="200" prop="coupon">-->
<!-- <div class="item" slot-scope="scope">-->
<!-- <el-select class="item__input" v-model="scope.row.coupon.id" clearable filterable @blur="save(scope.row)">-->
<!-- <el-option v-for="coupon in couponList" :key="coupon.id" :label="coupon.couponName" :value="coupon.id" />-->
<!-- </el-select>-->
<!-- <span class="item__txt">{{ get }}</span>-->
<!-- </div>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="规格" width="180" prop="model"/> <el-table-column align="center" label="规格" width="180" prop="model"/>
<el-table-column align="center" label="编码" width="180" prop="code"/> <el-table-column align="center" label="编码" width="180" prop="code"/>
<el-table-column align="center" label="数量" width="180" prop="count"> <el-table-column align="center" label="数量" width="180" prop="count">
@ -55,14 +63,14 @@
<el-table-column align="center" label="施工人员" width="180" prop="repair"> <el-table-column align="center" label="施工人员" width="180" prop="repair">
<div v-if="scope.row.id" class="item" slot-scope="scope"> <div v-if="scope.row.id" class="item" slot-scope="scope">
<StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.repair" <StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.repair"
:select-width="'15rem'"/> :select-width="'15rem'" :is-get="scope.row.id"/>
<span class="item__txt">{{ scope.row.repair ? scope.row.repair.name : scope.row.repair }}</span> <span class="item__txt">{{ scope.row.repair ? scope.row.repair.name : scope.row.repair }}</span>
</div> </div>
</el-table-column> </el-table-column>
<el-table-column align="center" label="销售人员" width="180" prop="sale"> <el-table-column align="center" label="销售人员" width="180" prop="sale">
<div v-if="scope.row.id" class="item" slot-scope="scope"> <div v-if="scope.row.id" class="item" slot-scope="scope">
<StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.sale" <StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.sale"
:select-width="'15rem'"/> :select-width="'15rem'" :is-get="scope.row.id"/>
<span class="item__txt">{{ scope.row.sale ? scope.row.sale.name : scope.row.sale }}</span> <span class="item__txt">{{ scope.row.sale ? scope.row.sale.name : scope.row.sale }}</span>
</div> </div>
</el-table-column> </el-table-column>
@ -137,14 +145,23 @@ export default {
type:Array, type:Array,
default: () => {return []}, default: () => {return []},
required: false required: false
},
couponList: {
type: Array,
default: () => {return []},
required: false
} }
}, },
data() { data() {
return { return {
loading: false, loading: false,
list: [{}], list: [{
coupon:{
id: null
}
}],
// //
editProp: ["goods", 'count', 'price', 'discount', 'repair', 'sale', 'remark', 'type', 'accountType'], editProp: ["goods", 'count', 'price', 'discount', 'repair', 'sale', 'remark', 'type', 'accountType', 'coupon'],
// cell // cell
clickCellMap: {}, clickCellMap: {},
selectRepair: {}, selectRepair: {},
@ -159,6 +176,10 @@ export default {
list: { list: {
handler(val) { handler(val) {
this.$emit("tableData", val) this.$emit("tableData", val)
const coupons = val.filter(item => item.coupon).map(item => item.coupon)
if (coupons && coupons.length > 0){
this.$emit("changeCoupon", coupons)
}
}, },
deep: true deep: true
}, },
@ -320,6 +341,9 @@ export default {
}, },
returnOther() { returnOther() {
},
getCouponName(id){
// this.
} }
} }
} }

View File

@ -1,6 +1,122 @@
<template> <template>
<div> <div>
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem"> <!-- <el-descriptions class="margin-top" :column="3" :size="'mini'" border style="margin-bottom: 1rem">-->
<!-- &lt;!&ndash; <template slot="extra">&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button v-if="createTicketType" type="success" size="small">新增客户信息</el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button v-if="createTicketType" type="primary" size="small" :disabled="!selectUser.id">完善更多客户信息</el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button type="primary" size="small">选择业务</el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 用户选择-->
<!-- </template>-->
<!-- <UserChoose v-model="selectUser"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 车辆选择-->
<!-- </template>-->
<!-- <CarChoose v-model="selectCar" :cus-name="selectUser.cusName"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 手机-->
<!-- </template>-->
<!-- <el-input disabled v-model="selectUser.phoneNumber"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 车架号-->
<!-- </template>-->
<!-- <el-input disabled v-model="selectCar.vin"/>-->
<!-- </el-descriptions-item>-->
<!-- &lt;!&ndash; <el-descriptions-item>&ndash;&gt;-->
<!-- &lt;!&ndash; <template slot="label">&ndash;&gt;-->
<!-- &lt;!&ndash; 车牌&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-input disabled v-model="selectCar.licenseNumber"/>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-descriptions-item>&ndash;&gt;-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 品牌车系-->
<!-- </template>-->
<!-- <el-input disabled v-model="selectCar.modelStr"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 保险到期-->
<!-- </template>-->
<!-- <el-date-picker disabled-->
<!-- v-model="selectCar.insuranceExpiryDate"-->
<!-- type="date">-->
<!-- </el-date-picker>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 年检到期-->
<!-- </template>-->
<!-- <el-date-picker disabled-->
<!-- v-model="selectCar.nextInspectionDate"-->
<!-- type="date">-->
<!-- </el-date-picker>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 进厂时间-->
<!-- </template>-->
<!-- <el-date-picker-->
<!-- v-model="formData.inTime"-->
<!-- type="date"-->
<!-- placeholder="选择日期">-->
<!-- </el-date-picker>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 预计完工-->
<!-- </template>-->
<!-- <el-date-picker-->
<!-- v-model="formData.outTime"-->
<!-- type="date"-->
<!-- placeholder="选择日期">-->
<!-- </el-date-picker>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 上次里程-->
<!-- </template>-->
<!-- <el-input v-model="selectCar.maintenanceMileage"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 本次里程-->
<!-- </template>-->
<!-- <el-input v-model="selectCar.newMaintenanceMileage"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 预约订单选择-->
<!-- </template>-->
<!-- <el-select v-model="formData.bookingId" size="small">-->
<!-- <el-option v-for="item in bookingList" :key="item.id" :value="item.id" :label="item.bookingTime" />-->
<!-- </el-select>-->
<!-- </el-descriptions-item>-->
<!-- &lt;!&ndash; <el-descriptions-item :span="3">&ndash;&gt;-->
<!-- &lt;!&ndash; <template slot="label">&ndash;&gt;-->
<!-- &lt;!&ndash; 备注&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-input v-model="formData.remark"/>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-descriptions-item>&ndash;&gt;-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 服务顾问-->
<!-- </template>-->
<!-- <StaffChoose v-model="selectStaff"/>-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<el-row :gutter="24">
<el-col :span="17" style="padding-right: 0">
<el-card class="top-left">
<el-descriptions class="margin-top" :column="3" :size="'mini'" border>
<!-- <template slot="extra">--> <!-- <template slot="extra">-->
<!-- <el-button v-if="createTicketType" type="success" size="small">新增客户信息</el-button>--> <!-- <el-button v-if="createTicketType" type="success" size="small">新增客户信息</el-button>-->
<!-- <el-button v-if="createTicketType" type="primary" size="small" :disabled="!selectUser.id">完善更多客户信息</el-button>--> <!-- <el-button v-if="createTicketType" type="primary" size="small" :disabled="!selectUser.id">完善更多客户信息</el-button>-->
@ -113,6 +229,66 @@
<StaffChoose v-model="selectStaff"/> <StaffChoose v-model="selectStaff"/>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card>
</el-col>
<el-col :span="7" style="padding-left: 0">
<el-card style="margin-left: 0" >
<div slot="header" class="clearfix">
<span style="font-weight: bold; font-size: 16px;"> 会员卡券</span>
</div>
<el-table
:data="couponList"
border
size="mini"
height="200"
style="width: 100%">
<!-- @selection-change="handleSelectionChange"-->
<!-- <el-table-column-->
<!-- type="selection"-->
<!-- width="55">-->
<!-- </el-table-column>-->
<el-table-column prop="couponName" label="卡券名称" />
<el-table-column label="卡券类型" width="80" align="center" prop="couponType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.MEMBER_COUPON_TYPE" :value="scope.row.couponType"/>
</template>
</el-table-column>
<el-table-column label="剩余金额/次数" width="120" align="right" prop="balance">
<template v-slot="scope">
{{scope.row.balance}}{{scope.row.outRule == 'mehx'?'元':'次'}}
</template>
</el-table-column>
<el-table-column label="适用车型" width="80" align="center" prop="carModel">
<template v-slot="scope">
<span v-if="scope.row.carModel == null">不限</span>
<dict-tag :type="DICT_TYPE.MEMBER_CAR" :value="scope.row.carModel"/>
</template>
</el-table-column>
<el-table-column label="核销规则" width="100" align="center" prop="outRule">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.MEMBER_COUPON_OUT_RULE" :value="scope.row.outRule"/>
</template>
</el-table-column>
<el-table-column label="开始有效期" align="center" prop="beginTime" width="150">
<template v-slot="scope">
<span>{{ parseTime(scope.row.beginTime) }}</span>
</template>
</el-table-column>
<el-table-column label="结束有效期" align="center" prop="endTime" width="150">
<template v-slot="scope">
<span>{{ parseTime(scope.row.endTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column fixed="right" label="操作" width="130" align="center" class-name="small-padding fixed-width">-->
<!-- <template v-slot="scope">-->
<!-- <el-button size="mini" type="text" icon="el-icon-goods" @click="couponVerification(scope.row)">核销</el-button>-->
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-card>
</el-col>
</el-row>
<el-row :gutter="5" style="margin-bottom: 1rem"> <el-row :gutter="5" style="margin-bottom: 1rem">
<el-col v-if="createTicketType" :span="4.8"> <el-col v-if="createTicketType" :span="4.8">
<el-button size="small" @click="$refs['repairAdvice'].open()">维修建议</el-button> <el-button size="small" @click="$refs['repairAdvice'].open()">维修建议</el-button>
@ -143,10 +319,10 @@
<el-button size="small" v-if="formData.ticketType === '02'" @click="formData.ticketType = '01'">B单</el-button> <el-button size="small" v-if="formData.ticketType === '02'" @click="formData.ticketType = '01'">B单</el-button>
</el-col> </el-col>
</el-row> </el-row>
<TicketItem item-type="project" :in-list-data="projectList" @tableData="projectData" ref="projectTable"/> <TicketItem item-type="project" :in-list-data="projectList" @tableData="projectData" ref="projectTable" :coupon-list="couponList" @changeCoupon="changeCoupon"/>
<TicketItem v-if="createTicketType" :in-list-data="partList" item-type="part" @tableData="partData" <TicketItem v-if="createTicketType" :in-list-data="partList" item-type="part" @tableData="partData" :coupon-list="couponList" @changeCoupon="changeCoupon"
ref="partTable"/> ref="partTable"/>
<TicketItem v-if="createTicketType" :in-list-data="otherList" item-type="other" @tableData="otherData" <TicketItem v-if="createTicketType" :in-list-data="otherList" item-type="other" @tableData="otherData" :coupon-list="couponList" @changeCoupon="changeCoupon"
ref="otherTable"/> ref="otherTable"/>
<el-row :gutter="createTicketType ? 2 : 3" style="margin-top: 1rem"> <el-row :gutter="createTicketType ? 2 : 3" style="margin-top: 1rem">
<el-col :span="createTicketType ? 12 : 16"> <el-col :span="createTicketType ? 12 : 16">
@ -227,6 +403,7 @@ import RepairAdvice from "@/views/repair/tickets/form/RepairAdvice.vue";
import QualityExplain from "@/views/repair/tickets/form/QualityExplain.vue"; import QualityExplain from "@/views/repair/tickets/form/QualityExplain.vue";
import TicketChoose from "@/views/repair/tickets/Components/TicketChoose.vue"; import TicketChoose from "@/views/repair/tickets/Components/TicketChoose.vue";
import request from "@/utils/request"; import request from "@/utils/request";
import * as CustomerMainApi from "@/api/base/customer";
export default { export default {
name: "UserInfo", name: "UserInfo",
@ -241,8 +418,11 @@ export default {
selectUser(val) { selectUser(val) {
if (!val) { if (!val) {
this.selectUser = {} this.selectUser = {}
this.bookingList = []
this.couponList = []
}else { }else {
this.getBooking(val.userId) this.getBooking(val.userId)
this.getCouponList(val.id)
} }
}, },
selectCar(val) { selectCar(val) {
@ -298,9 +478,19 @@ export default {
partList: [], partList: [],
otherList: [], otherList: [],
bookingList: [], bookingList: [],
couponList: [],
finaCouponList: []
} }
}, },
methods: { methods: {
async getCouponList(id){
const res = await CustomerMainApi.getCustomerMain(id);
this.couponList = res.data.couponList
this.finaCouponList = [
...this.couponList,
]
this.finaCouponList.map(item => item["isChoose"] = false)
},
projectData(data) { projectData(data) {
// //
this.projectList = [...data] this.projectList = [...data]
@ -530,10 +720,25 @@ export default {
method: "get" method: "get"
}) })
this.bookingList = res.data this.bookingList = res.data
} },
//
changeCoupon(data){
this.finaCouponList.map(item => {
item.isChoose = data.includes(item)
})
this.finaCouponList.forEach(item => console.log(item.isChoose))
this.couponList = this.finaCouponList.filter(item => !item.isChoose)
},
// //
// handleSelectionChange(val){
//
// }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.top-left{
margin-bottom: 1rem;
}
</style> </style>