| | |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="308px" |
| | | label-width="168px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="回访单编号" prop="number"> |
| | | <WordInput |
| | | v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" |
| | | :codenumer="codenumer" |
| | | :sum="sum" |
| | | :disabled="editConfig.title !== '新建' || isIdDisabled" |
| | | :inputValue="inputValue" |
| | | @codeList="codeList" |
| | | /> |
| | | <span v-else-if="method == 0" style="color: #f56c6c" |
| | | >请优先配置编码规范 <el-button type="text" @click="numberClick"> 配置规范 </el-button></span |
| | | > |
| | | <span v-else>{{ editConfig.title === "新建" ? "自动生成" : editConfig.infomation.number }}</span> |
| | | </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.client_name" |
| | | :fetch-suggestions="querySearchAsync" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'client') |
| | | } |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient" |
| | | @select="handleSelectClient('client', $event)" |
| | | style="width: 100%" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick"> |
| | | <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"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | <div |
| | | v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient('client')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="回访单编号" prop="number"> |
| | | <el-input v-model="editConfig.infomation.number"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人姓名" prop="contactId"> |
| | | <el-form-item label="联系人姓名" prop="contact_name"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.contactId"></el-input> |
| | | <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div> |
| | | <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.contact_name" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'contact') |
| | | } |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('contact', $event)" |
| | | style="width: 100%" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('contact')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.contact_name && editConfig.infomation.contact_name.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient('contact')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户服务单" prop="customServiceForm"> |
| | | <el-form-item label="客户服务单" prop="service_number"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.customServiceForm"></el-input> |
| | | <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div> |
| | | <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.service_number" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'customService') |
| | | } |
| | | " |
| | | value-key="serviceNumber" |
| | | @select="handleSelectClient('customService', $event)" |
| | | style="width: 100%" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('customService')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.service_number && editConfig.infomation.service_number.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient('customService')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="回访人" prop="memberId"> |
| | | <el-select v-model="editConfig.infomation.memberId" size="mini"> |
| | | <el-select v-model="editConfig.infomation.memberId" size="mini" style="width: 100%"> |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item label="项目计划" prop="planId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.planId"></el-input> |
| | |
| | | <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="满意度" prop="satisfaction"> |
| | | <el-form-item label="满意度" prop="satisfactionId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.satisfaction" |
| | | v-model="editConfig.infomation.satisfactionId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in satisfactionOptions" :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 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="timelyRate"> |
| | | <el-form-item label="及时率" prop="timelyRateId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.timelyRate" |
| | | v-model="editConfig.infomation.timelyRateId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in timelyRateOptions" :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 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="solveRate"> |
| | | <el-form-item label="解决率" prop="solveRateId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.solveRate" |
| | | v-model="editConfig.infomation.solveRateId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in solveRateOptions" :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 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="oldMemberId"> |
| | | <el-select v-model="editConfig.infomation.oldMemberId" size="mini"> |
| | | <el-select v-model="editConfig.infomation.oldMemberId" size="mini" style="width: 100%"> |
| | | <el-option v-for="item in oldMemberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="服务人员是否来过" prop="isVisit"> |
| | | <el-form-item label="服务人员是否来过" prop="isVisitId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.isVisit" |
| | | v-model="editConfig.infomation.isVisitId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in isVisitOptions" :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 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-title">附件信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | :edit-common-config="editSelectClientConfig" |
| | | @selClient="selClient" |
| | | /> |
| | | <!-- 选择联系人 --> |
| | | <SelectContactDialog |
| | | v-if="editSelectContactConfig.editVisible" |
| | | :edit-common-config="editSelectContactConfig" |
| | | @selClient="selClient" |
| | | /> |
| | | <!-- 客户服务订单 --> |
| | | <SelectCommonDialog |
| | | v-if="editSelCommonConfig.editVisible" |
| | | :edit-common-config="editSelCommonConfig" |
| | | @selClient="selClient" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import { getAllData } from "@/api/client/client" |
| | | import { getAddServiceFollowup, getUpdateServiceFollowup } from "@/api/serviceManage/serviceFollowup" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog" |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" |
| | | export default { |
| | | name: "AddServiceFollowupDialog", |
| | | mixins: [codeMixin], |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: { SelectClientDialog }, |
| | | components: { SelectClientDialog, SelectContactDialog, SelectCommonDialog }, |
| | | computed: { |
| | | searchCommonHeight() { |
| | | return this.$refs.searchCommonView.offsetHeight |
| | | }, |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | }, |
| | | contactNamelist() { |
| | | return this.$store.state.getClientName.contactNamelist |
| | | }, |
| | | serviceOrderList() { |
| | | return this.$store.state.getClientName.serviceOrderList |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | dialogWidth: "50%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | number: [{ required: true, message: "请输入回访单单编号", trigger: "blur" }], |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: "change" }], |
| | | service_number: [{ required: true, message: "请选择客户服务单", trigger: "change" }], |
| | | memberId: [{ required: true, message: "请选择", trigger: "change" }] |
| | | }, |
| | | satisfactionOptions: [], // 满意度 |
| | |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | } |
| | | }, |
| | | editSelectContactConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | editSelCommonConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | clientId: this.editCommonConfig.infomation.clientId, |
| | | contactId: this.editCommonConfig.infomation.contactId, |
| | | serviceOrderId: this.editCommonConfig.infomation.serviceOrderId |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geContact") |
| | | this.$store.dispatch("geServiceOrder") |
| | | this.getCommonData() |
| | | this.formInfo() |
| | | }, |
| | | watch: { |
| | | "editCommonConfig.visible"(val) { |
| | | if (val) { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | "editCommonConfig.infomation.codeStandID"() { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | methods: { |
| | | formInfo() { |
| | | this.objCode.type = "服务回访编码" |
| | | this.objCode.codeStandID = "" |
| | | if (this.editConfig.infomation.codeStandID) { |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID |
| | | } |
| | | this.getRCodeStandardList() |
| | | }, |
| | | getCommonData() { |
| | | getAllData() |
| | | .then((res) => { |
| | |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | this.validateFormNumber() |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddServiceFollowup(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) |
| | | }) |
| | | getAddServiceFollowup(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } else { |
| | | getUpdateServiceFollowup(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) |
| | | }) |
| | | getUpdateServiceFollowup(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | |
| | | let data = this.editConfig.infomation |
| | | let params = { |
| | | id: this.editConfig.title === "新建" ? 0 : data.id, |
| | | clientId: data.clientId || 0, |
| | | contactId: data.contactId || 0, |
| | | clientId: this.clientId || 0, |
| | | contactId: this.contactId || 0, |
| | | file: data.file || "", |
| | | isVisit: data.isVisit || 0, |
| | | isVisit: data.isVisitId || 0, |
| | | memberId: data.memberId || 0, |
| | | number: data.number || "", |
| | | oldMemberId: data.oldMemberId || 0, |
| | | planId: data.planId || 0, |
| | | remark: data.remark || "", |
| | | satisfaction: data.satisfaction || 0, |
| | | serviceId: data.serviceId || 0, |
| | | solveRate: data.solveRate || 0, |
| | | timelyRate: data.timelyRate || 0 |
| | | satisfaction: data.satisfactionId || 0, |
| | | serviceOrderId: this.serviceOrderId || 0, |
| | | solveRate: data.solveRateId || 0, |
| | | timelyRate: data.timelyRateId || 0, |
| | | codeStandID: data.ID, |
| | | codeRule: this.codeRule |
| | | } |
| | | return params |
| | | }, |
| | |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb) { |
| | | var restaurants = this.clientList |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants |
| | | querySearchAsync(queryString, cb, value) { |
| | | var restaurants = [] |
| | | if (value === "client") { |
| | | restaurants = this.clientList |
| | | } else if (value === "contact") { |
| | | restaurants = this.contactNamelist |
| | | } else if (value === "customService") { |
| | | console.log(this.serviceOrderList) |
| | | restaurants = this.serviceOrderList |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | | }, |
| | | createStateFilter(queryString) { |
| | | createStateFilter(queryString, value) { |
| | | return (state) => { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | if (value === "customService") { |
| | | return state.serviceNumber.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } else { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | } |
| | | }, |
| | | handleSelectClient(item) { |
| | | this.editConfig.infomation.client_id = item.id |
| | | handleSelectClient(value, item) { |
| | | console.log(value) |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | } else if (value === "contact") { |
| | | this.contactId = item.id |
| | | } else if (value === "customService") { |
| | | this.serviceOrderId = item.id |
| | | } |
| | | }, |
| | | selClientClick() { |
| | | this.editSelectClientConfig.editVisible = true |
| | | selClientClick(value) { |
| | | if (value === "client") { |
| | | this.editSelectClientConfig.editVisible = true |
| | | } else if (value === "contact") { |
| | | this.editSelectContactConfig.editVisible = true |
| | | } else if (value === "customService") { |
| | | this.editSelCommonConfig.title = "客户服务单" |
| | | this.editSelCommonConfig.editVisible = true |
| | | this.editSelCommonConfig.tableInfomation = [...this.serviceOrderList] |
| | | } |
| | | }, |
| | | selClient(row) { |
| | | console.log(row) |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.editConfig.infomation.client_id = row.id |
| | | selClient(row, value) { |
| | | console.log(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 === "customService") { |
| | | this.editConfig.infomation.service_number = row.serviceNumber |
| | | this.serviceOrderId = row.id |
| | | } |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient() { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.editConfig.infomation.client_id = 0 |
| | | clearupClient(value) { |
| | | if (value === "client") { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.clientId = 0 |
| | | } else if (value === "contact") { |
| | | this.editConfig.infomation.contact_name = "" |
| | | this.contactId = 0 |
| | | } else if (value === "customService") { |
| | | this.editConfig.infomation.service_number = "" |
| | | this.serviceOrderId = 0 |
| | | } |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |