| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col v-if="isUnflod" :span="12"> |
| | | <el-form-item label="客户名称" prop="clientId"> |
| | | <el-form-item label="客户名称" prop="client_name"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.clientId"></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.client_name" |
| | | :fetch-suggestions="querySearchAsync" |
| | | value-key="name" |
| | | @select="handleSelectClient" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | size="mini" |
| | | style="width: 63%" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </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" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | <script> |
| | | import { getAllData } from "@/api/client/client" |
| | | import { getAddPlan, getUpdatePlan } from "@/api/sales/generatePlan" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | export default { |
| | | name: "AddGeneratePlanDialog", |
| | | props: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: {}, |
| | | computed: {}, |
| | | components: { SelectClientDialog }, |
| | | computed: { |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | |
| | | }, |
| | | memberOptions: [], |
| | | unflodCollapseStr: "收起", |
| | | isUnflod: true |
| | | isUnflod: true, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | |
| | | let params = { |
| | | id: this.editConfig.title === "新建" ? 0 : data.id, |
| | | plan: { |
| | | clientId: data.clientId || 0, |
| | | clientId: parseInt(data.clientId) || 0, |
| | | content: data.content || "", |
| | | endTime: data.endTime || "", |
| | | file: data.file || "", |
| | |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb) { |
| | | var restaurants = this.clientList |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants |
| | | cb(results) |
| | | }, |
| | | createStateFilter(queryString) { |
| | | return (state) => { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | }, |
| | | handleSelectClient(item) { |
| | | this.editConfig.infomation.client_id = item.id |
| | | }, |
| | | selClientClick() { |
| | | this.editSelectClientConfig.editVisible = true |
| | | }, |
| | | selClient(row) { |
| | | console.log(row) |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.editConfig.infomation.client_id = row.id |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient() { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.editConfig.infomation.client_id = 0 |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |