From a63bbe043b87d9becfe483bb1477d471a79edcd8 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期日, 23 七月 2023 11:45:24 +0800 Subject: [PATCH] 全部删除接口联调 --- src/views/sales/quotation/AddQuotationDialog.vue | 82 ++++++++++++++++++++++++++++++---------- 1 files changed, 61 insertions(+), 21 deletions(-) diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue index 2316083..576dfc2 100644 --- a/src/views/sales/quotation/AddQuotationDialog.vue +++ b/src/views/sales/quotation/AddQuotationDialog.vue @@ -22,11 +22,20 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="client_id"> + <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.client_id"></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 class="common-select-btn" @click="clearupClient"> + <i class="el-icon-edit-outline" title="娓呴櫎"></i> + </div> </div> </el-form-item> </el-col> @@ -80,7 +89,7 @@ size="mini" style="width: 63%" > - <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :value="item.id"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -193,21 +202,26 @@ </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" + /> </el-dialog> </div> </template> <script> -// import CommonSelectView from "@/components/makepager/CommonSelectView" // import CommonFormTableView from "@/components/makepager/CommonFormTableView" import { getAllData } from "@/api/client/client" import { getAddQuotation, getUpdateQuotation } from "@/api/sales/quotation" +import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" export default { name: "QuotationDialog", props: { @@ -222,10 +236,13 @@ } } }, - // components: { CommonSelectView, CommonFormTableView }, + components: { SelectClientDialog }, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight + }, + clientList() { + return this.$store.state.getClientName.clientList } }, data() { @@ -240,11 +257,7 @@ }, memberOptions: [], quotationStatusOptions: [{ id: 1, name: "涓嶇煡閬�" }], // 鎶ヤ环鍗曠姸鎬� - currencyOptions: [ - { value: "1", label: "浜烘皯甯�(楼)" }, - { value: "2", label: "鑻遍晳(拢)" }, - { value: "3", label: "娆у厓(鈧�)" } - ], // 甯佺 + currencyOptions: [], // 甯佺 approvalWorkflowOptions: [], // 瀹℃壒娴佺▼ productTableList: {}, showSummary: { @@ -252,10 +265,16 @@ total: true, sumProp: ["other1", "other2", "other3", "other4"], mergeNumber: 3 + }, + editSelectClientConfig: { + editVisible: false, + title: "", + infomation: {} } } }, created() { + this.$store.dispatch("geClient") this.setTableForm() this.getCommonData() }, @@ -263,8 +282,8 @@ getCommonData() { getAllData() .then((res) => { - // 缂� 甯佺 鎶ヤ环鍗曠姸鎬� this.memberOptions = res.data.member + this.quotationStatusOptions = res.data.quotationStatus }) .catch((err) => { console.log(err) @@ -335,6 +354,33 @@ 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() {}, // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 @@ -391,13 +437,7 @@ .basic-info-view { margin-top: 10px; padding-right: 40px; - .custom-name { - display: flex; - .common-select-btn { - margin-left: 5px; - font-size: 18px; - } - } + .custom-name, .common-select { display: flex; .common-select-sel { -- Gitblit v1.8.0