From ac8749d1f785ee58cec73c27254562c940363205 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期一, 16 十月 2023 16:52:54 +0800
Subject: [PATCH] feat: 销售总单添加必填校验
---
src/views/sales/salesDetails/AddSalesDetailsDialog.vue | 127 +++++++++++++++++++++++++-----------------
1 files changed, 75 insertions(+), 52 deletions(-)
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index ddf96d5..76b4762 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -24,10 +24,26 @@
<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
- style="width:100%;"
+ style="width: 100%"
v-model="editConfig.infomation.client_name"
:fetch-suggestions="
(queryString, callback) => {
@@ -36,12 +52,17 @@
"
value-key="name"
@select="handleSelectClient('client', $event)"
+ :disabled="isNameChanceEdit"
></el-autocomplete>
- <div class="common-select-btn" @click="selClientClick('client')">
+ <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('client')">
<i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
</div>
<div
- v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
+ v-if="
+ editConfig.infomation.client_name &&
+ editConfig.infomation.client_name.length > 0 &&
+ !isNameChanceEdit
+ "
class="common-select-btn"
@click="clearupClient('client')"
>
@@ -50,31 +71,12 @@
</div>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="璁㈠崟缂栧彿" prop="number">
- <WordInput
- v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0"
- :codenumer="codenumer"
- :sum="sum"
- :disabled="editConfig.infomation.id || 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="saleChanceId">
<div class="custom-name">
<el-autocomplete
- style="width:100%"
+ style="width: 100%"
v-model="editConfig.infomation.sale_chance_name"
:fetch-suggestions="
(queryString, callback) => {
@@ -83,12 +85,17 @@
"
value-key="name"
@select="handleSelectClient('chance', $event)"
+ :disabled="isNameChanceEdit"
></el-autocomplete>
- <div class="common-select-btn" @click="selClientClick('chance')">
+ <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('chance')">
<i class="el-icon-circle-plus-outline"></i>
</div>
<div
- v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0"
+ v-if="
+ editConfig.infomation.sale_chance_name &&
+ editConfig.infomation.sale_chance_name.length > 0 &&
+ !isNameChanceEdit
+ "
class="common-select-btn"
@click="clearupClient('chance')"
>
@@ -117,7 +124,7 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="閫夋嫨鏃ユ湡"
- style="width:100%"
+ style="width: 100%"
>
</el-date-picker>
</el-form-item>
@@ -125,7 +132,6 @@
<el-col :span="12">
<el-form-item label="閿�鍞礋璐d汉" prop="memberId">
<el-select
-
v-model="editConfig.infomation.memberId"
placeholder="璇烽�夋嫨"
size="mini"
@@ -143,7 +149,7 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="閫夋嫨鏃ユ湡"
- style="width:100%"
+ style="width: 100%"
>
</el-date-picker>
</el-form-item>
@@ -190,7 +196,7 @@
<el-col :span="12">
<el-form-item label="鏀惰揣鍦板潃" prop="address">
<el-input
- style="width:100%"
+ style="width: 100%"
type="textarea"
:autosize="{ minRows: 2 }"
v-model="editConfig.infomation.address"
@@ -228,7 +234,7 @@
<el-col :span="24">
<el-form-item label="鏉℃涓庢潯浠�" prop="conditions" label-width="15%">
<el-input
- style="width:100%;"
+ style="width: 100%"
type="textarea"
:autosize="{ minRows: 4 }"
v-model="editConfig.infomation.conditions"
@@ -378,10 +384,13 @@
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
-import codeMixin from "@/views/client/followupRecords/mixin/codeMixin";
+import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getSaleChanceList} from "@/api/sales/salesOpportunity"
+import {mapActions} from "vuex"
+
export default {
name: "AddSalesDetailsDialog",
- mixins:[codeMixin],
+ mixins: [codeMixin],
props: {
editCommonConfig: {
type: Object,
@@ -405,7 +414,7 @@
},
data() {
return {
- dialogWidth: "60%",
+ dialogWidth: "50%",
editConfig: this.editCommonConfig,
rules: {
client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
@@ -445,7 +454,8 @@
title: "鏂板缓",
infomation: {}
},
- amountTotal: 0
+ amountTotal: 0,
+ isNameChanceEdit: false
}
},
created() {
@@ -453,27 +463,34 @@
this.$store.dispatch("geChance")
this.setTableForm()
this.getCommonData()
- this.formInfo();
+ this.formInfo()
+ if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.client_name.length > 0) {
+ this.isNameChanceEdit = true
+ }
+ // else {
+
+ // }
},
- watch:{
- 'editClientManageConfig.visible'(val){
- if(val){
+ watch: {
+ "editClientManageConfig.visible"(val) {
+ if (val) {
this.formInfo()
}
},
- 'editClientManageConfig.infomation.codeStandID'(){
+ "editClientManageConfig.infomation.codeStandID"() {
this.formInfo()
}
},
methods: {
- formInfo(){
- this.objCode.type='閿�鍞槑缁嗙紪鐮�'
- this.objCode.codeStandID = ''
- if(this.editConfig.infomation.codeStandID){
- this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
+ ...mapActions(["getChanceFilter"]),
+ formInfo() {
+ this.objCode.type = "閿�鍞槑缁嗙紪鐮�"
+ this.objCode.codeStandID = ""
+ if (this.editConfig.infomation.codeStandID) {
+ this.objCode.codeStandID = this.editConfig.infomation.codeStandID
}
- this.getRCodeStandardList();
- },
+ this.getRCodeStandardList()
+ },
getCommonData() {
getAllData()
.then((res) => {
@@ -561,7 +578,7 @@
logisticCompany: data.logisticCompany || "",
logisticCost: data.logisticCost || 0,
logisticNumber: data.logisticNumber || "",
- codeRule:this.codeRule,
+ codeRule: this.codeRule
}
let params = {}
if (this.editConfig.title === "鏂板缓") {
@@ -596,10 +613,16 @@
return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
}
},
- handleSelectClient(value, item) {
+ async handleSelectClient(value, item) {
if (value === "client") {
this.clientId = item.id
this.editConfig.infomation.client_name = item.name
+ // 闇�瑕佷慨鏀�
+ await getSaleChanceList({
+ client_id:this.clientId
+ }).then((res)=>{
+ this.getChanceFilter(res.data.list)
+ })
} else if (value === "chance") {
this.saleChanceId = item.id
this.editConfig.infomation.client_name = item.name
@@ -662,7 +685,7 @@
{ label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
{ label: "浜у搧缂栧彿", prop: "number" },
{ label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
- { label: "閿�鍞崟浠�", prop: "price",inputFloat: true },
+ { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
{ label: "浠风◣鍚堣", prop: "total", inputFloat: true }
]
}
@@ -722,8 +745,8 @@
<style lang="scss" scoped>
::v-deep {
.iframe-dialog .el-dialog__body {
- .el-form{
- .el-form-item{
+ .el-form {
+ .el-form-item {
width: 100%;
}
}
--
Gitblit v1.8.0