<template>
|
<div class="order-manage">
|
<el-dialog
|
:title="editCommonConfig.title + '客户服务单'"
|
:visible.sync="editConfig.visible"
|
:width="dialogWidth"
|
:before-close="handleClose"
|
append-to-body
|
custom-class="iframe-dialog"
|
>
|
<el-form
|
ref="form"
|
:model="editConfig.infomation"
|
:rules="rules"
|
label-position="right"
|
label-width="308px"
|
size="mini"
|
style="height: 60vh; overflow-x: hidden"
|
>
|
<!-- 信息 -->
|
<div class="basic-info">
|
<!-- 基本信息 -->
|
<div class="basic-info-title">基本信息</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="客户名称" prop="client_name">
|
<div class="custom-name">
|
<el-autocomplete
|
v-model="editConfig.infomation.client_name"
|
:fetch-suggestions="
|
(queryString, callback) => {
|
querySearchAsync(queryString, callback, 'client')
|
}
|
"
|
value-key="name"
|
@select="handleSelectClient('client', $event)"
|
></el-autocomplete>
|
<div class="common-select-btn" @click="selClientClick('client')">
|
<i class="el-icon-circle-plus-outline" title="选择"></i>
|
</div>
|
<div class="common-select-btn" @click="clearupClient('client')">
|
<i class="el-icon-edit-outline" title="清除"></i>
|
</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="服务单编号" prop="serviceNumber">
|
<el-input v-model="editConfig.infomation.serviceNumber"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="服务合同">
|
<div class="custom-name">
|
<el-autocomplete
|
v-model="editConfig.infomation.service_number"
|
:fetch-suggestions="
|
(queryString, callback) => {
|
querySearchAsync(queryString, callback, 'serviceContract')
|
}
|
"
|
value-key="number"
|
@select="handleSelectClient('serviceContract', $event)"
|
></el-autocomplete>
|
<div class="common-select-btn" @click="selClientClick('serviceContract')">
|
<i class="el-icon-circle-plus-outline" title="选择"></i>
|
</div>
|
<div class="common-select-btn" @click="clearupClient('serviceContract')">
|
<i class="el-icon-edit-outline" title="清除"></i>
|
</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="故障类别" prop="faultTypeId">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.faultTypeId"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
>
|
<!-- @focus="getFaultTypeList" -->
|
<el-option v-for="item in faultTypeOptions" :key="item.id" :label="item.name" :value="item.id">
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="主题" prop="subject">
|
<el-input v-model="editConfig.infomation.subject"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="合同订单">
|
<div class="custom-name">
|
<el-autocomplete
|
v-model="editConfig.infomation.number"
|
:fetch-suggestions="
|
(queryString, callback) => {
|
querySearchAsync(queryString, callback, 'contract')
|
}
|
"
|
value-key="number"
|
@select="handleSelectClient('contract', $event)"
|
></el-autocomplete>
|
<div class="common-select-btn" @click="selClientClick('contract')">
|
<i class="el-icon-circle-plus-outline" title="选择"></i>
|
</div>
|
<div class="common-select-btn" @click="clearupClient('contract')">
|
<i class="el-icon-edit-outline" title="清除"></i>
|
</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="产品类别" prop="productCategory">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.productCategory"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
>
|
<el-option
|
v-for="item in productCategoryOptions"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
>
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="产品名称" prop="product_name">
|
<div class="custom-name">
|
<el-autocomplete
|
v-model="editConfig.infomation.product_name"
|
:fetch-suggestions="
|
(queryString, callback) => {
|
querySearchAsync(queryString, callback, 'productName')
|
}
|
"
|
value-key="name"
|
@select="handleSelectClient('productName', $event)"
|
></el-autocomplete>
|
<div class="common-select-btn" @click="selClientClick('productName')">
|
<i class="el-icon-circle-plus-outline" title="选择"></i>
|
</div>
|
<div class="common-select-btn" @click="clearupClient('productName')">
|
<i class="el-icon-edit-outline" title="清除"></i>
|
</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="服务方式" prop="serviceTypeId">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.serviceTypeId"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
@focus="getServiceTypeList"
|
>
|
<el-option v-for="item in serviceTypeOptions" :key="item.id" :label="item.name" :value="item.id">
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="服务人员" prop="serviceManId">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.serviceManId"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
>
|
<el-option
|
v-for="item in serviceManOptions"
|
:key="item.id"
|
:label="item.username"
|
:value="item.id"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="联系人姓名" prop="client_name">
|
<div class="custom-name">
|
<el-autocomplete
|
v-model="editConfig.infomation.contact_name"
|
:fetch-suggestions="
|
(queryString, callback) => {
|
querySearchAsync(queryString, callback, 'contact')
|
}
|
"
|
value-key="name"
|
@select="handleSelectClient('contact', $event)"
|
></el-autocomplete>
|
<div class="common-select-btn" @click="selClientClick('contact')">
|
<i class="el-icon-circle-plus-outline" title="选择"></i>
|
</div>
|
<div class="common-select-btn" @click="clearupClient('contact')">
|
<i class="el-icon-edit-outline" title="清除"></i>
|
</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="严重程度" prop="severity">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.severity"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
@focus="getSeverityList"
|
>
|
<el-option v-for="item in severityOptions" :key="item.id" :label="item.name" :value="item.id">
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="24">
|
<el-form-item label="上门地址" prop="address">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
placeholder="请输入内容"
|
v-model="editConfig.infomation.address"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="优先级别" prop="priorityLevelId">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.priorityLevelId"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
@focus="getPriorityLevelList"
|
>
|
<el-option
|
v-for="item in priorityLevelOptions"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
>
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="预约上门时间" prop="appointmentTime">
|
<el-date-picker
|
v-model="editConfig.infomation.appointmentTime"
|
type="datetime"
|
placeholder="选择日期"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="销售机会" prop="client_name">
|
<div class="custom-name">
|
<el-autocomplete
|
v-model="editConfig.infomation.sale_chance_name"
|
:fetch-suggestions="
|
(queryString, callback) => {
|
querySearchAsync(queryString, callback, 'chance')
|
}
|
"
|
value-key="name"
|
@select="handleSelectClient('chance', $event)"
|
></el-autocomplete>
|
<div class="common-select-btn" @click="selClientClick('chance')">
|
<i class="el-icon-circle-plus-outline"></i>
|
</div>
|
<div class="common-select-btn" @click="clearupClient('chance')">
|
<i class="el-icon-edit-outline"></i>
|
</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<!-- 动态信息 -->
|
<div class="basic-info-title">动态信息</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="处理状态" prop="status">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.status"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
>
|
<el-option v-for="item in statusOptions" :key="item.id" :label="item.name" :value="item.id">
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<!-- 时间/金额 -->
|
<div class="basic-info-title">时间/金额</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="希望处理时间" prop="expectTime">
|
<el-date-picker v-model="editConfig.infomation.expectTime" type="datetime" placeholder="选择时间">
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="实际处理时间" prop="realTime">
|
<el-date-picker v-model="editConfig.infomation.startTime" type="realTime" placeholder="选择时间">
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="交通费" prop="carFare">
|
<el-input v-model="editConfig.infomation.carFare"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="收费金额" prop="chargeAmount">
|
<el-input v-model="editConfig.infomation.chargeAmount"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="花费时间" prop="timeSpentId">
|
<div class="common-select">
|
<el-select
|
v-model="editConfig.infomation.timeSpentId"
|
placeholder="请选择"
|
class="common-select-sel"
|
size="mini"
|
@focus="getTimeSpentList"
|
>
|
<el-option v-for="item in timeSpentOptions" :key="item.id" :label="item.name" :value="item.id">
|
</el-option>
|
</el-select>
|
<div class="common-select-btn"><i class="el-icon-setting"></i></div>
|
</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<!-- 定位地址 -->
|
<!-- <div class="basic-info-title">定位地址</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="定位" prop="position">
|
<el-input v-model="editConfig.infomation.position"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="24">
|
<el-form-item label="地图" prop="map">
|
<div style="height: 100px"></div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div> -->
|
<!-- 问题描述 -->
|
<div class="basic-info-title">问题描述</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="常见问题" prop="faqId">
|
<el-input v-model="editConfig.infomation.faqId"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="24">
|
<el-form-item label="问题描述" prop="problemDesc">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
placeholder="请输入内容"
|
v-model="editConfig.infomation.problemDesc"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<!-- 解决方法 -->
|
<div class="basic-info-title">解决方法</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="解决方法" prop="solution">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
placeholder="请输入内容"
|
v-model="editConfig.infomation.solution"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="24">
|
<el-form-item label="内部备注" prop="solutionRemark">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
placeholder="请输入内容"
|
v-model="editConfig.infomation.solutionRemark"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<!-- 备注 -->
|
<div class="basic-info-title">备注</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="备注" prop="remark">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
placeholder="请输入内容"
|
v-model="editConfig.infomation.remark"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<!-- 附件信息 -->
|
<!-- <div class="basic-info-title">附件信息</div>
|
<div class="basic-info-view">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="附件" prop="">
|
<template slot="label">
|
<div style="display: flex; float: right">
|
<div style="font-size: 16px">
|
<i class="el-icon-warning-outline" title="最多上传20个附件,最大限制5MB"></i>
|
</div>
|
<span style="margin-left: 5px">附件</span>
|
</div>
|
</template>
|
<div class="annex-view">
|
<div @click="addAnnexClick">
|
<div style="display: flex; float: right">
|
<div style="font-size: 16px"><i class="el-icon-paperclip"></i></div>
|
<span>添加</span>
|
</div>
|
</div>
|
<div class="setFormat" @click="setFormatClick">设置允许上传的文件格式</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div> -->
|
<!-- 客户服务单历史记录 -->
|
<div v-if="editConfig.title === '编辑'" class="basic-info">
|
<div class="basic-info-label" @click="expandClick('record')">
|
<i v-if="isRecordExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">客户服务单历史记录</span>
|
</div>
|
<div v-show="isRecordExpand" class="basic-info-content">
|
<div class="list" v-if="recordTableList.length > 0">
|
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
|
<TableCommonView
|
ref="recordTableListRef"
|
:select-box="false"
|
:table-list="recordTableList"
|
></TableCommonView>
|
</div>
|
<div class="no-data" v-else>没有找到任何记录</div>
|
</div>
|
</div>
|
<!-- 服务合同信息 -->
|
<div v-if="editConfig.title === '编辑'" class="basic-info">
|
<div class="basic-info-label" @click="expandClick('contract')">
|
<i v-if="isConttractExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">服务合同信息</span>
|
</div>
|
<div v-show="isConttractExpand" class="basic-info-content">
|
<div class="list" v-if="recordTableList.length > 0">
|
<PagerView class="page" :pager-options="pagerOptions1" v-on="pagerEvents" />
|
<TableCommonView ref="tableListRef" :select-box="false" :table-list="tableList"></TableCommonView>
|
</div>
|
<div class="no-data" v-else>没有找到任何记录</div>
|
</div>
|
</div>
|
</div>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<!-- <el-button type="primary" size="small" @click="editConfig.visible = false">保并提交审批</el-button> -->
|
<el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
|
<el-button size="small" @click="editConfig.visible = false">取消</el-button>
|
</div>
|
<!-- 选择客户 -->
|
<SelectClientDialog
|
v-if="editSelectClientConfig.editVisible"
|
:edit-common-config="editSelectClientConfig"
|
@selClient="selClient"
|
/>
|
<!-- 选择服务合同 合同订单 -->
|
<SelectCommonDialog
|
v-if="editSelCommonConfig.editVisible"
|
:edit-common-config="editSelCommonConfig"
|
@selClient="selClient"
|
/>
|
<!-- 选择联系人 -->
|
<SelectContactDialog
|
v-if="editSelectContactConfig.editVisible"
|
:edit-common-config="editSelectContactConfig"
|
@selClient="selClient"
|
/>
|
<!-- 选择销售机会 -->
|
<SelectChanceDialog
|
v-if="editSelectChanceConfig.editVisible"
|
:edit-common-config="editSelectChanceConfig"
|
@selClient="selClient"
|
/>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { getAllData } from "@/api/client/client"
|
import { getAddServiceOrder, getUpdateServiceOrder } from "@/api/serviceManage/clientServiceOrder"
|
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
|
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
|
import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
|
import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
|
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
|
import {
|
getFaultTypeList,
|
getServiceTypeList,
|
getSeverityList,
|
getPriorityLevelList,
|
getTimeSpentList
|
} from "@/api/common/other"
|
import Status from "@/common/const/commonStatus"
|
|
export default {
|
name: "AddClientServiceOrderDialog",
|
mixins: [pageMixin],
|
props: {
|
editCommonConfig: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
title: "新建",
|
infomation: {}
|
}
|
}
|
}
|
},
|
components: { SelectClientDialog, SelectCommonDialog, SelectContactDialog, SelectChanceDialog },
|
computed: {
|
clientList() {
|
return this.$store.state.getClientName.clientList
|
},
|
serviceContractList() {
|
return this.$store.state.getClientName.serviceContractList
|
},
|
salesDetailsList() {
|
return this.$store.state.getClientName.salesDetailsList
|
},
|
contactNamelist() {
|
return this.$store.state.getClientName.contactNamelist
|
},
|
saleChancelist() {
|
return this.$store.state.getClientName.saleChancelist
|
}
|
},
|
data() {
|
return {
|
dialogWidth: "80%",
|
editConfig: this.editCommonConfig,
|
rules: {
|
serviceNumber: [{ required: true, message: "请输入服务单编号", trigger: "blur" }],
|
faultTypeId: [{ required: true, message: "请选择故障类别", trigger: "change" }],
|
subject: [{ required: true, message: "请输入主题", trigger: "blur" }],
|
productCategory: [{ required: true, message: "请选择产品类别", trigger: "change" }],
|
serviceManId: [{ required: true, message: "请选择产品类别", trigger: "change" }],
|
status: [{ required: true, message: "请选择故障类别", trigger: "change" }],
|
problemDesc: [{ required: true, message: "请输入问题描述", trigger: "blur" }]
|
},
|
faultTypeOptions: [{ id: 1, name: "服务回访" }], // 故障类别
|
productCategoryOptions: [
|
{ id: 1, name: "ERP迷你版" },
|
{ id: 2, name: "ERP专业版-财务模块" }
|
], // 产品类别
|
productNameList: [], // 产品名称
|
serviceTypeOptions: [], // 服务方式
|
serviceManOptions: [], // 服务人员
|
severityOptions: [], // 严重程度
|
priorityLevelOptions: [], // 优先级别
|
statusOptions: Status.processStatus, // 处理状态
|
timeSpentOptions: [], // 花费时间
|
editSelectClientConfig: {
|
editVisible: false,
|
title: "",
|
infomation: {}
|
},
|
isRecordExpand: true,
|
recordTableList: {},
|
pagerOptions: {
|
currPage: 1,
|
pageSize: 5,
|
totalCount: 0
|
},
|
isConttractExpand: true,
|
tableList: {},
|
pagerOptions1: {
|
currPage: 1,
|
pageSize: 5,
|
totalCount: 0
|
},
|
editSelCommonConfig: {
|
editVisible: false,
|
title: "",
|
infomation: {}
|
},
|
editSelectContactConfig: {
|
editVisible: false,
|
title: "",
|
infomation: {}
|
},
|
editSelectChanceConfig: {
|
editVisible: false,
|
title: "",
|
infomation: {}
|
},
|
clientId: this.editCommonConfig.infomation.clientId,
|
contactId: this.editCommonConfig.infomation.contactId,
|
serviceContractId: this.editCommonConfig.infomation.contractId,
|
contractId: this.editCommonConfig.infomation.orderId,
|
productNameId: this.editCommonConfig.infomation.productId,
|
saleChanceId: this.editCommonConfig.infomation.saleChanceId
|
}
|
},
|
created() {
|
this.$store.dispatch("geClient")
|
this.getCommonData()
|
this.setTable()
|
},
|
methods: {
|
setTable() {
|
this.recordTableList = {
|
tableInfomation: [],
|
tableColumn: [
|
{ label: "服务单编号", prop: "number", min: 100 },
|
{ label: "主题", prop: "name" },
|
{ label: "服务人员", prop: "clientId", min: 130 },
|
{ label: "服务方式", prop: "contactName" },
|
{ label: "产品类别", prop: "name" },
|
{ label: "产品名称", prop: "orderType" },
|
{ label: "修改时间", prop: "reportSourceId" }
|
]
|
}
|
},
|
getCommonData() {
|
getAllData().then((res) => {
|
this.memberOptions = res.data.member
|
this.serviceManOptions = res.data.member
|
this.reportSourceOptions = res.data.reportSource
|
})
|
this.getServiceTypeList()
|
},
|
// 保存
|
saveClick(formName) {
|
this.$refs[formName].validate((valid) => {
|
if (valid) {
|
console.log(this.editConfig.infomation)
|
const params = this.saveParams()
|
console.log(params)
|
if (this.editConfig.title === "新建") {
|
getAddServiceOrder(params)
|
.then((res) => {
|
console.log(res)
|
this.editConfig.visible = false
|
if (res.code === 200) {
|
this.$message({
|
message: "添加成功",
|
type: "success"
|
})
|
this.$parent.getData()
|
}
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
} else {
|
getUpdateServiceOrder(params)
|
.then((res) => {
|
console.log(res)
|
this.editConfig.visible = false
|
if (res.code === 200) {
|
this.$message({
|
message: "编辑成功",
|
type: "success"
|
})
|
this.$parent.getData()
|
}
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
}
|
} else {
|
console.log("error submit")
|
return false
|
}
|
})
|
},
|
saveParams() {
|
let data = this.editConfig.infomation
|
let params = {
|
address: data.address || "",
|
appointmentTime: data.appointmentTime || "",
|
carFare: data.carFare || 0,
|
chargeAmount: data.chargeAmount || 0,
|
clientId: this.clientId,
|
contactId: this.contactId,
|
contractId: this.serviceContractId,
|
expectTime: data.expectTime || "",
|
faqId: data.faqId || 0,
|
faultTypeId: data.faultTypeId || 0,
|
id: data.id || 0,
|
orderId: this.contractId,
|
priorityLevelId: data.priorityLevelId || 0,
|
problemDesc: data.problemDesc || "",
|
productId: this.productNameId,
|
realTime: data.realTime || "",
|
remark: data.remark || "",
|
saleChanceId: this.saleChanceId,
|
serviceManId: data.serviceManId || 0,
|
serviceNumber: data.serviceNumber || "",
|
serviceTypeId: data.serviceTypeId || 0,
|
severity: data.severity || 0,
|
solution: data.solution || "",
|
solutionRemark: data.solutionRemark || "",
|
status: data.status || 0,
|
subject: data.subject || "",
|
timeSpentId: data.timeSpentId || 0
|
}
|
return params
|
},
|
handleClose() {
|
this.editConfig.visible = false
|
},
|
// 选择用户相关方法
|
querySearchAsync(queryString, cb, value) {
|
this.$store.dispatch("geServiceContract")
|
this.$store.dispatch("geSalesDetails")
|
this.$store.dispatch("geContact")
|
this.$store.dispatch("geChance")
|
var restaurants = []
|
if (value === "client") {
|
restaurants = this.clientList
|
} else if (value === "serviceContract") {
|
restaurants = this.serviceContractList
|
} else if (value === "contract") {
|
restaurants = this.salesDetailsList
|
} else if (value === "productName") {
|
restaurants = this.productNameList
|
} else if (value === "contact") {
|
restaurants = this.contactNamelist
|
} else if (value === "chance") {
|
restaurants = this.saleChancelist
|
}
|
var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants
|
cb(results)
|
},
|
createStateFilter(queryString, value) {
|
return (state) => {
|
if (value === "serviceContract" || value === "contract") {
|
return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
} else {
|
return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
}
|
}
|
},
|
handleSelectClient(value, item) {
|
if (value === "client") {
|
this.clientId = item.id
|
} else if (value === "serviceContract") {
|
this.serviceContractId = item.id
|
} else if (value === "contract") {
|
this.contractId = item.id
|
} else if (value === "productName") {
|
this.productCategoryId = item.id
|
} else if (value === "contact") {
|
this.contactId = item.id
|
} else if (value === "chance") {
|
this.saleChanceId = item.id
|
}
|
},
|
selClientClick(value) {
|
console.log(value)
|
if (value === "client") {
|
this.editSelectClientConfig.editVisible = true
|
} else if (value === "serviceContract") {
|
this.editSelCommonConfig.title = "服务合同"
|
this.editSelCommonConfig.editVisible = true
|
this.editSelCommonConfig.tableInfomation = [...this.serviceContractList]
|
} else if (value === "contract") {
|
this.editSelCommonConfig.title = "销售明细单"
|
this.editSelCommonConfig.editVisible = true
|
this.editSelCommonConfig.tableInfomation = [...this.salesDetailsList]
|
} else if (value === "productName") {
|
this.editSelCommonConfig.title = "产品名称"
|
this.editSelCommonConfig.editVisible = true
|
this.editSelCommonConfig.tableInfomation = [...this.productNameList]
|
} else if (value === "contact") {
|
this.editSelectContactConfig.editVisible = true
|
} else if (value === "chance") {
|
this.editSelectChanceConfig.editVisible = true
|
}
|
},
|
selClient(row, value) {
|
console.log(row, value)
|
if (value === "contact") {
|
this.editConfig.infomation.contact_name = row.name
|
this.contactId = row.id
|
} else if (value === "client") {
|
this.editConfig.infomation.client_name = row.name
|
this.clientId = row.id
|
} else if (value === "serviceContract") {
|
this.editConfig.infomation.service_number = row.number
|
this.serviceContractId = row.id
|
} else if (value === "contract") {
|
this.editConfig.infomation.number = row.number
|
this.contractId = row.id
|
} else if (value === "productName") {
|
this.editConfig.infomation.product_name = row.name
|
this.productNameId = row.id
|
} else if (value === "chance") {
|
this.editConfig.infomation.sale_chance_name = row.name
|
this.saleChanceId = row.id
|
}
|
},
|
// 清除已选择用户
|
clearupClient(value) {
|
if (value === "client") {
|
this.editConfig.infomation.client_name = ""
|
this.clientId = 0
|
} else if (value === "serviceContract") {
|
this.editConfig.infomation.service_number = ""
|
this.serviceContractId = 0
|
} else if (value === "contract") {
|
this.editConfig.infomation.number = ""
|
this.contractId = 0
|
} else if (value === "productName") {
|
this.editConfig.infomation.product_name = ""
|
this.productNameId = 0
|
} else if (value === "contact") {
|
this.editConfig.infomation.contact_name = ""
|
this.contactId = 0
|
} else if (value === "chance") {
|
this.editConfig.infomation.sale_chance_name = ""
|
this.saleChanceId = 0
|
}
|
},
|
// 添加附件
|
addAnnexClick() {},
|
// 设置允许上传文件格式
|
setFormatClick() {},
|
// 展开收起点击事件
|
expandClick(value) {
|
console.log(value)
|
if (value === "record") {
|
this.isRecordExpand = !this.isRecordExpand
|
} else if (value === "contract") {
|
this.isConttractExpand = !this.isConttractExpand
|
}
|
},
|
// 故障类别
|
async getFaultTypeList() {
|
await getFaultTypeList().then((res) => {
|
console.log(res)
|
this.faultTypeOptions = res.data.data
|
})
|
},
|
// 服务方式
|
async getServiceTypeList() {
|
await getServiceTypeList()
|
.then((res) => {
|
console.log(res)
|
this.serviceTypeOptions = res.data.data
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
},
|
// 严重程度
|
async getSeverityList() {
|
await getSeverityList()
|
.then((res) => {
|
console.log(res)
|
this.severityOptions = res.data.data
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
},
|
// 优先级别
|
async getPriorityLevelList() {
|
await getPriorityLevelList()
|
.then((res) => {
|
console.log(res)
|
this.priorityLevelOptions = res.data.data
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
},
|
// 花费时间
|
async getTimeSpentList() {
|
await getTimeSpentList()
|
.then((res) => {
|
console.log(res)
|
this.timeSpentOptions = res.data.data
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
::v-deep {
|
.iframe-dialog .el-dialog__body {
|
.basic-info {
|
.basic-info-title {
|
background-color: #f4f8fe;
|
padding-left: 10px;
|
font-size: 15px;
|
font-weight: bold;
|
color: #666;
|
height: 42px;
|
line-height: 42px;
|
}
|
.basic-info-view {
|
margin-top: 10px;
|
padding-right: 40px;
|
.custom-name,
|
.common-select {
|
display: flex;
|
.common-select-sel {
|
width: 270px;
|
}
|
.common-select-btn {
|
margin-left: 5px;
|
font-size: 16px;
|
cursor: pointer;
|
}
|
}
|
}
|
.annex-view {
|
display: flex;
|
color: #6166d3;
|
.setFormat {
|
margin-left: 10px;
|
}
|
}
|
.basic-info {
|
.basic-info-label {
|
padding-left: 10px;
|
height: 42px;
|
line-height: 42px;
|
background: #f4f8fe;
|
color: #333;
|
font-size: 14px;
|
}
|
.basic-info-content {
|
.list {
|
.page {
|
text-align: right;
|
margin-bottom: 5px;
|
}
|
}
|
.no-data {
|
height: 40px;
|
line-height: 40px;
|
margin-left: 10px;
|
}
|
}
|
}
|
}
|
.dialog-footer {
|
background-color: #f5f5f5;
|
height: 55px;
|
line-height: 55px;
|
}
|
}
|
}
|
</style>
|