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 | 114 +++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 94 insertions(+), 20 deletions(-)
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 91a283a..76b4762 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -13,7 +13,7 @@
:model="editConfig.infomation"
:rules="rules"
label-position="right"
- label-width="308px"
+ label-width="30%"
size="mini"
style="height: 60vh; overflow-x: hidden"
>
@@ -24,9 +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%"
v-model="editConfig.infomation.client_name"
:fetch-suggestions="
(queryString, callback) => {
@@ -35,29 +52,31 @@
"
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')"
>
- <i class="el-icon-edit-outline" title="娓呴櫎"></i>
+ <i class="el-icon-remove-outline" title="娓呴櫎"></i>
</div>
</div>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="璁㈠崟缂栧彿" prop="number">
- <el-input v-model="editConfig.infomation.number"></el-input>
- </el-form-item>
- </el-col>
+
<el-col :span="12">
<el-form-item label="閿�鍞満浼�" prop="saleChanceId">
<div class="custom-name">
<el-autocomplete
+ style="width: 100%"
v-model="editConfig.infomation.sale_chance_name"
:fetch-suggestions="
(queryString, callback) => {
@@ -66,16 +85,21 @@
"
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')"
>
- <i class="el-icon-edit-outline"></i>
+ <i class="el-icon-remove-outline"></i>
</div>
</div>
</el-form-item>
@@ -100,6 +124,7 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="閫夋嫨鏃ユ湡"
+ style="width: 100%"
>
</el-date-picker>
</el-form-item>
@@ -110,7 +135,7 @@
v-model="editConfig.infomation.memberId"
placeholder="璇烽�夋嫨"
size="mini"
- style="width: 63%"
+ style="width: 100%"
>
<el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
</el-option>
@@ -124,6 +149,7 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="閫夋嫨鏃ユ湡"
+ style="width: 100%"
>
</el-date-picker>
</el-form-item>
@@ -167,9 +193,10 @@
<el-input v-model="editConfig.infomation.phone"></el-input>
</el-form-item>
</el-col>
- <el-col :span="24">
+ <el-col :span="12">
<el-form-item label="鏀惰揣鍦板潃" prop="address">
<el-input
+ style="width: 100%"
type="textarea"
:autosize="{ minRows: 2 }"
v-model="editConfig.infomation.address"
@@ -205,8 +232,9 @@
<div class="basic-info-view">
<el-row>
<el-col :span="24">
- <el-form-item label="鏉℃涓庢潯浠�" prop="conditions">
+ <el-form-item label="鏉℃涓庢潯浠�" prop="conditions" label-width="15%">
<el-input
+ style="width: 100%"
type="textarea"
:autosize="{ minRows: 4 }"
v-model="editConfig.infomation.conditions"
@@ -220,7 +248,7 @@
<div class="basic-info-view">
<el-row>
<el-col :span="24">
- <el-form-item label="澶囨敞" prop="remark">
+ <el-form-item label="澶囨敞" prop="remark" label-width="15%">
<el-input
type="textarea"
:autosize="{ minRows: 2 }"
@@ -356,8 +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 { getSaleChanceList} from "@/api/sales/salesOpportunity"
+import {mapActions} from "vuex"
+
export default {
name: "AddSalesDetailsDialog",
+ mixins: [codeMixin],
props: {
editCommonConfig: {
type: Object,
@@ -381,7 +414,7 @@
},
data() {
return {
- dialogWidth: "80%",
+ dialogWidth: "50%",
editConfig: this.editCommonConfig,
rules: {
client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
@@ -421,7 +454,8 @@
title: "鏂板缓",
infomation: {}
},
- amountTotal: 0
+ amountTotal: 0,
+ isNameChanceEdit: false
}
},
created() {
@@ -429,8 +463,34 @@
this.$store.dispatch("geChance")
this.setTableForm()
this.getCommonData()
+ this.formInfo()
+ if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.client_name.length > 0) {
+ this.isNameChanceEdit = true
+ }
+ // else {
+
+ // }
+ },
+ watch: {
+ "editClientManageConfig.visible"(val) {
+ if (val) {
+ this.formInfo()
+ }
+ },
+ "editClientManageConfig.infomation.codeStandID"() {
+ this.formInfo()
+ }
},
methods: {
+ ...mapActions(["getChanceFilter"]),
+ formInfo() {
+ this.objCode.type = "閿�鍞槑缁嗙紪鐮�"
+ this.objCode.codeStandID = ""
+ if (this.editConfig.infomation.codeStandID) {
+ this.objCode.codeStandID = this.editConfig.infomation.codeStandID
+ }
+ this.getRCodeStandardList()
+ },
getCommonData() {
getAllData()
.then((res) => {
@@ -517,7 +577,8 @@
wechatOrderStatus: data.wechatOrderStatus || 0,
logisticCompany: data.logisticCompany || "",
logisticCost: data.logisticCost || 0,
- logisticNumber: data.logisticNumber || ""
+ logisticNumber: data.logisticNumber || "",
+ codeRule: this.codeRule
}
let params = {}
if (this.editConfig.title === "鏂板缓") {
@@ -552,11 +613,19 @@
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
}
},
selClientClick(value) {
@@ -676,6 +745,11 @@
<style lang="scss" scoped>
::v-deep {
.iframe-dialog .el-dialog__body {
+ .el-form {
+ .el-form-item {
+ width: 100%;
+ }
+ }
.basic-info {
.basic-info-title {
background-color: #f4f8fe;
--
Gitblit v1.8.0