From 75e27a973b76fa78ff12b96b503487c3d7e33688 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 27 十二月 2023 16:06:13 +0800
Subject: [PATCH] Merge branch 'wn' of http://192.168.5.5:10010/r/web/crm-web into dev
---
src/views/client/salesLead/AddSalesLeadDialog.vue | 90 +++++++++++++++++++++++++++-----------------
1 files changed, 55 insertions(+), 35 deletions(-)
diff --git a/src/views/client/salesLead/AddSalesLeadDialog.vue b/src/views/client/salesLead/AddSalesLeadDialog.vue
index 074aa09..a804ec8 100644
--- a/src/views/client/salesLead/AddSalesLeadDialog.vue
+++ b/src/views/client/salesLead/AddSalesLeadDialog.vue
@@ -22,7 +22,20 @@
<el-row>
<el-col :span="12">
<el-form-item label="閿�鍞嚎绱㈢紪鍙�" prop="number">
- <WordInput
+ <el-input
+ v-if="
+ editConfig.title == '缂栬緫' ||
+ (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
+ "
+ :disabled="editConfig.title == '缂栬緫'"
+ v-model="editConfig.infomation.number"
+ placeholder="璇疯緭鍏ョ紪鐮�"
+ >
+ </el-input>
+ <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+ >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
+ >
+ <!-- <WordInput
v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0"
:codenumer="codenumer"
:sum="sum"
@@ -37,7 +50,7 @@
</el-button
></span
>
- <span v-else>鑷姩鐢熸垚</span>
+ <span v-else>鑷姩鐢熸垚</span> -->
</el-form-item>
</el-col>
<el-col :span="12">
@@ -101,7 +114,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="璐熻矗浜�" prop="member_id">
- <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" style="width: 100%" size="mini">
+ <el-select
+ v-model="editConfig.infomation.member_id"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ size="mini"
+ >
<el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
</el-option>
</el-select>
@@ -247,7 +265,7 @@
import { getAddSalesLeads, getUpdateSalesLeads } from "@/api/client/salesLead"
import { getAllData } from "@/api/client/client"
import { getCityList } from "@/api/common/address"
-import codeMixin from "@/views/client/followupRecords/mixin/codeMixin";
+import codeMixin from "@/components/makepager/mixin/codeMixin"
export default {
name: "AddSalesLeadDialog",
mixins: [codeMixin],
@@ -270,17 +288,17 @@
dialogWidth: "50%",
editConfig: this.editSalesLeadConfig,
rules: {
- name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: ["change",'blur' ]}],
- number: [{ required: true, message: "璇疯緭鍏ラ攢鍞嚎绱㈢紪鍙�", trigger: ["change",'blur' ] }],
- businessStatus: [{ required: true, message: "璇疯緭鍏ョ嚎绱㈢姸鎬�", trigger: ["change",'blur' ] }],
- sales_sources_id: [{ required: true, message: "璇烽�夋嫨绾跨储鏉ユ簮", trigger: ["change",'blur' ] }],
+ name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: ["change", "blur"] }],
+ number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }],
+ businessStatus: [{ required: true, message: "璇疯緭鍏ョ嚎绱㈢姸鎬�", trigger: ["change", "blur"] }],
+ sales_sources_id: [{ required: true, message: "璇烽�夋嫨绾跨储鏉ユ簮", trigger: ["change", "blur"] }],
contact_phone: [
- { required: true, message: "璇疯緭鍏ユ墜鏈哄彿鐮�", trigger: ["change",'blur' ] },
- { len: 11, message: "闀垮害鍦�11涓瓧绗�", trigger: ["change",'blur' ] },
+ { required: true, message: "璇疯緭鍏ユ墜鏈哄彿鐮�", trigger: ["change", "blur"] },
+ { len: 11, message: "闀垮害鍦�11涓瓧绗�", trigger: ["change", "blur"] },
{
pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
message: "璇疯緭鍏ユ纭殑鎵嬫満鍙�",
- trigger: ["change",'blur' ]
+ trigger: ["change", "blur"]
}
]
},
@@ -296,7 +314,8 @@
editVisible: false,
title: "",
infomation: {}
- }
+ },
+ defaultMemberId: 0
}
},
created() {
@@ -304,27 +323,24 @@
this.getCityList(this.editConfig.infomation.province_id, "edit")
}
this.getCommonData()
- this.formInfo();
+ this.formInfo()
},
mounted() {},
- watch:{
- 'editSalesLeadConfig.visible'(val){
- if(val){
+ watch: {
+ "editSalesLeadConfig.visible"(val) {
+ if (val) {
this.formInfo()
}
- },
- 'editSalesLeadConfig.infomation.codeStandID'(){
- this.formInfo()
}
},
methods: {
- formInfo(){
- this.objCode.type='閿�鍞嚎绱㈢紪鐮�'
- this.objCode.codeStandID = ''
- if(this.editConfig.infomation.codeStandID){
- this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
+ formInfo() {
+ this.objCode.type = "閿�鍞嚎绱㈢紪鐮�"
+ this.objCode.codeStandID = ""
+ if (this.editConfig.infomation.codeStandID) {
+ this.objCode.codeStandID = this.editConfig.infomation.codeStandID
}
- this.getRCodeStandardList();
+ this.getRCodeStandardList()
},
getCommonData() {
this.editConfig.infomation.country_id = 1
@@ -340,6 +356,14 @@
this.provinceOptions = res.data.province
this.regionOptions = res.data.region
this.memberOptions = res.data.member
+ if (this.editConfig.title === "鏂板缓") {
+ let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1")
+ res.data.member.map((item) => {
+ if (item.username == username) {
+ this.$set(this.editConfig.infomation, "member_id", item.id)
+ }
+ })
+ }
})
.catch((err) => {
console.log(err)
@@ -351,9 +375,7 @@
// 淇濆瓨
saveClick(formName) {
this.$refs[formName].validate((valid) => {
- this.validateFormNumber()
if (valid) {
- console.log(this.editConfig.infomation)
let params = {
city_id: this.editConfig.infomation.city_id || 0,
contact_name: this.editConfig.infomation.contact_name || "",
@@ -369,10 +391,8 @@
region_id: this.editConfig.infomation.region_id || 0,
sales_sources_id: this.editConfig.infomation.sales_sources_id || 0,
detail_address: this.editConfig.infomation.detail_address || "",
- codeStandID:this.editConfig.infomation.ID,
- codeRule:this.codeRule,
+ codeStandID: this.editConfig.infomation.ID
}
- console.log(params)
if (this.editConfig.title === "鏂板缓") {
getAddSalesLeads(params).then((res) => {
console.log(res)
@@ -420,8 +440,8 @@
},
// 閫夋嫨鐪佷唤
selProvinceChange(val) {
- this.cityOptions=[]
- if(val){
+ this.cityOptions = []
+ if (val) {
this.getCityList(val, "sel")
}
},
@@ -429,7 +449,7 @@
await getCityList({ province_id: val }).then((res) => {
console.log(res)
if (res.code === 200) {
- this.cityOptions = res.data.list?res.data.list:[]
+ this.cityOptions = res.data.list ? res.data.list : []
if (value === "sel") {
this.editConfig.infomation.city_id = ""
}
@@ -459,7 +479,7 @@
.common-select {
display: flex;
.common-select-sel {
- width:100%;
+ width: 100%;
}
.common-select-btn {
margin-left: 5px;
@@ -474,7 +494,7 @@
height: 30px;
justify-content: center;
align-items: center;
- cursor:pointer;
+ cursor: pointer;
color: #6166d3;
}
}
--
Gitblit v1.8.0