From 4a2ae34a3cf85f5e8b0409b858cfbb12ef8b5ee2 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 02 八月 2023 11:18:51 +0800
Subject: [PATCH] 注掉暂不支持内容
---
src/views/sales/contractManage/AddContractManageDialog.vue | 92 ++++++++++++++++++++++++++++++++++------------
1 files changed, 68 insertions(+), 24 deletions(-)
diff --git a/src/views/sales/contractManage/AddContractManageDialog.vue b/src/views/sales/contractManage/AddContractManageDialog.vue
index a1e40fc..c6926a3 100644
--- a/src/views/sales/contractManage/AddContractManageDialog.vue
+++ b/src/views/sales/contractManage/AddContractManageDialog.vue
@@ -21,11 +21,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>
@@ -42,7 +51,7 @@
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>
@@ -150,9 +159,15 @@
</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="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>
@@ -160,6 +175,7 @@
<script>
import { getAllData } from "@/api/client/client"
import { getAddContract, getUpdateContract } from "@/api/sales/contractManage"
+import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
name: "AddContractManageDialog",
props: {
@@ -174,8 +190,12 @@
}
}
},
- components: {},
- computed: {},
+ components: { SelectClientDialog },
+ computed: {
+ clientList() {
+ return this.$store.state.getClientName.clientList
+ }
+ },
data() {
return {
dialogWidth: "80%",
@@ -185,18 +205,19 @@
member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
},
memberOptions: [],
- statusOptions: [
- { value: "1", label: "寰呭鎵�" },
- { value: "2", label: "瀹℃壒涓�" },
- { value: "3", label: "宸插鎵�" },
- { value: "4", label: "宸插綊妗�" }
- ], // 鍚堝悓鐘舵��
+ statusOptions: [], // 鍚堝悓鐘舵��
approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
unflodCollapseStr: "鏀惰捣",
- isUnflod: true
+ isUnflod: true,
+ editSelectClientConfig: {
+ editVisible: false,
+ title: "",
+ infomation: {}
+ }
}
},
created() {
+ this.$store.dispatch("geClient")
this.getCommonData()
},
methods: {
@@ -204,6 +225,7 @@
getAllData()
.then((res) => {
this.memberOptions = res.data.member
+ this.statusOptions = res.data.serviceContractStatus
})
.catch((err) => {
console.log(err)
@@ -259,8 +281,8 @@
let data = this.editConfig.infomation
let params = {
id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
- client_id: data.client_id || 0,
- file: data.file || "",
+ client_id: parseInt(data.client_id) || 0,
+ file: "",
member_id: data.member_id || 0,
number: data.number || "",
quotation_id: data.quotation_id || 0,
@@ -270,6 +292,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() {},
@@ -305,7 +354,8 @@
.basic-info-view {
margin-top: 10px;
padding-right: 40px;
- .custom-name {
+ .custom-name,
+ .common-select {
display: flex;
.common-select-btn {
margin-left: 5px;
@@ -313,14 +363,8 @@
}
}
.common-select {
- display: flex;
.common-select-sel {
width: 270px;
- }
- .common-select-btn {
- margin-left: 5px;
- font-size: 16px;
- cursor: pointer;
}
}
}
--
Gitblit v1.8.0