更新代码
This commit is contained in:
parent
93acd9eab1
commit
0100f93a2a
@ -13,6 +13,11 @@ export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
},
|
||||
isGet:{
|
||||
type: String,
|
||||
default: '',
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -41,7 +46,7 @@ export default {
|
||||
methods: {
|
||||
async listStaff() {
|
||||
try {
|
||||
if (this.hasRequest) return;
|
||||
if (!this.isGet) return;
|
||||
const res = await getStaffList()
|
||||
this.staffList = res.data
|
||||
this.hasRequest = true
|
||||
|
@ -21,6 +21,14 @@
|
||||
<span class="item__txt">{{ scope.row.name ? scope.row.name : scope.row.goods }}</span>
|
||||
</div>
|
||||
</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="code"/>
|
||||
<el-table-column align="center" label="数量" width="180" prop="count">
|
||||
@ -55,14 +63,14 @@
|
||||
<el-table-column align="center" label="施工人员" width="180" prop="repair">
|
||||
<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"
|
||||
: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>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="销售人员" width="180" prop="sale">
|
||||
<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"
|
||||
: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>
|
||||
</div>
|
||||
</el-table-column>
|
||||
@ -137,14 +145,23 @@ export default {
|
||||
type:Array,
|
||||
default: () => {return []},
|
||||
required: false
|
||||
},
|
||||
couponList: {
|
||||
type: Array,
|
||||
default: () => {return []},
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
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
|
||||
clickCellMap: {},
|
||||
selectRepair: {},
|
||||
@ -159,6 +176,10 @@ export default {
|
||||
list: {
|
||||
handler(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
|
||||
},
|
||||
@ -320,6 +341,9 @@ export default {
|
||||
},
|
||||
returnOther() {
|
||||
|
||||
},
|
||||
getCouponName(id){
|
||||
// this.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,122 @@
|
||||
<template>
|
||||
<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">-->
|
||||
<!-- <!– <template slot="extra">–>-->
|
||||
<!-- <!– <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 type="primary" size="small">选择业务</el-button>–>-->
|
||||
<!-- <!– </template>–>-->
|
||||
<!-- <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>-->
|
||||
<!-- <!– <el-descriptions-item>–>-->
|
||||
<!-- <!– <template slot="label">–>-->
|
||||
<!-- <!– 车牌–>-->
|
||||
<!-- <!– </template>–>-->
|
||||
<!-- <!– <el-input disabled v-model="selectCar.licenseNumber"/>–>-->
|
||||
<!-- <!– </el-descriptions-item>–>-->
|
||||
<!-- <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>-->
|
||||
<!-- <!– <el-descriptions-item :span="3">–>-->
|
||||
<!-- <!– <template slot="label">–>-->
|
||||
<!-- <!– 备注–>-->
|
||||
<!-- <!– </template>–>-->
|
||||
<!-- <!– <el-input v-model="formData.remark"/>–>-->
|
||||
<!-- <!– </el-descriptions-item>–>-->
|
||||
<!-- <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">-->
|
||||
<!-- <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>-->
|
||||
@ -113,6 +229,66 @@
|
||||
<StaffChoose v-model="selectStaff"/>
|
||||
</el-descriptions-item>
|
||||
</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-col v-if="createTicketType" :span="4.8">
|
||||
<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-col>
|
||||
</el-row>
|
||||
<TicketItem item-type="project" :in-list-data="projectList" @tableData="projectData" ref="projectTable"/>
|
||||
<TicketItem v-if="createTicketType" :in-list-data="partList" item-type="part" @tableData="partData"
|
||||
<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" :coupon-list="couponList" @changeCoupon="changeCoupon"
|
||||
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"/>
|
||||
<el-row :gutter="createTicketType ? 2 : 3" style="margin-top: 1rem">
|
||||
<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 TicketChoose from "@/views/repair/tickets/Components/TicketChoose.vue";
|
||||
import request from "@/utils/request";
|
||||
import * as CustomerMainApi from "@/api/base/customer";
|
||||
|
||||
export default {
|
||||
name: "UserInfo",
|
||||
@ -241,8 +418,11 @@ export default {
|
||||
selectUser(val) {
|
||||
if (!val) {
|
||||
this.selectUser = {}
|
||||
this.bookingList = []
|
||||
this.couponList = []
|
||||
}else {
|
||||
this.getBooking(val.userId)
|
||||
this.getCouponList(val.id)
|
||||
}
|
||||
},
|
||||
selectCar(val) {
|
||||
@ -298,9 +478,19 @@ export default {
|
||||
partList: [],
|
||||
otherList: [],
|
||||
bookingList: [],
|
||||
couponList: [],
|
||||
finaCouponList: []
|
||||
}
|
||||
},
|
||||
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) {
|
||||
// 去掉最后一行
|
||||
this.projectList = [...data]
|
||||
@ -530,10 +720,25 @@ export default {
|
||||
method: "get"
|
||||
})
|
||||
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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.top-left{
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user