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/salesReturn/AddSalesReturnDialog.vue | 96 +++++++++++++++++++++++++++++++++++++-----------
1 files changed, 74 insertions(+), 22 deletions(-)
diff --git a/src/views/sales/salesReturn/AddSalesReturnDialog.vue b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
index bc222ca..731a46a 100644
--- a/src/views/sales/salesReturn/AddSalesReturnDialog.vue
+++ b/src/views/sales/salesReturn/AddSalesReturnDialog.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) => {
@@ -49,15 +66,12 @@
</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="鍚堝悓璁㈠崟">
+ <el-form-item label="閿�鍞槑缁嗗崟">
<div class="custom-name">
<el-autocomplete
+ style="width: 100%"
v-model="editConfig.infomation.salesDetailNumber"
:fetch-suggestions="
(queryString, callback) => {
@@ -82,7 +96,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="閫�鍏ヤ粨搴�" prop="repository">
- <el-select v-model="editConfig.infomation.repository" size="mini" style="width: 63%">
+ <el-select v-model="editConfig.infomation.repository" size="mini" style="width: 100%">
<el-option v-for="item in repositoryOptions" :key="item.id" :label="item.name" :value="item.name">
</el-option>
</el-select>
@@ -94,7 +108,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>
@@ -108,6 +122,7 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="閫夋嫨鏃ユ湡"
+ style="width: 100%"
>
</el-date-picker>
</el-form-item>
@@ -115,13 +130,14 @@
</el-row>
</div>
<!-- 鍔ㄦ�佷俊鎭� -->
- <div class="basic-info-title">鍔ㄦ�佷俊鎭�</div>
- <div class="basic-info-view">
+ <!-- <div class="basic-info-title">鍔ㄦ�佷俊鎭�</div> -->
+ <!-- <div class="basic-info-view">
<el-row>
<el-col :span="12">
<el-form-item label="鐘舵��" prop="salesReturnStatusId">
<div class="common-select">
<el-select
+ style="width: 100%"
v-model="editConfig.infomation.salesReturnStatusId"
placeholder="璇烽�夋嫨"
class="common-select-sel"
@@ -129,20 +145,22 @@
>
<el-option v-for="item in statusOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
- </el-select>
+ </el-select> -->
<!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> -->
- </div>
+ <!-- </div>
</el-form-item>
</el-col>
</el-row>
- </div>
+ </div> -->
+
<!-- 澶囨敞淇℃伅 -->
<div class="basic-info-title">澶囨敞淇℃伅</div>
<div class="basic-info-view">
<el-row>
<el-col :span="24">
- <el-form-item label="閫�璐у師鍥�" prop="reason">
+ <el-form-item label="閫�璐у師鍥�" prop="reason" label-width="15%">
<el-input
+ style="width: 100%"
type="textarea"
:autosize="{ minRows: 2 }"
v-model="editConfig.infomation.reason"
@@ -229,8 +247,13 @@
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import { getProductList } from "@/api/common/other"
import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
+import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getSalesDetailsList } from "@/api/sales/salesDetails"
+import {mapActions} from "vuex"
+
export default {
name: "AddSalesReturnDialog",
+ mixins: [codeMixin],
props: {
editCommonConfig: {
type: Object,
@@ -254,7 +277,7 @@
},
data() {
return {
- dialogWidth: "80%",
+ dialogWidth: "50%",
editConfig: this.editCommonConfig,
rules: {
number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -295,8 +318,28 @@
this.setTableForm()
this.getCommonData()
this.getProductList()
+ this.formInfo()
+ },
+ watch: {
+ "editClientManageConfig.visible"(val) {
+ if (val) {
+ this.formInfo()
+ }
+ },
+ "editClientManageConfig.infomation.codeStandID"() {
+ this.formInfo()
+ }
},
methods: {
+ ...mapActions(["getSalesDetailsFliter"]),
+ 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) => {
@@ -311,12 +354,12 @@
// 鑾峰彇浜у搧鍒楄〃
async getProductList() {
await getProductList({
- page: 0,
- pageSize: 0,
+ page: 1,
+ pageSize: 15,
productName: "",
- productNumber: ""
+ productNumber: "",
+ // clientId:"100"
}).then((res) => {
- console.log(res)
})
},
// 淇濆瓨
@@ -378,7 +421,8 @@
salesReturnStatusId: data.salesReturnStatusId || 0,
sourceId: this.SalesDetailsId,
sourceType: 1
- }
+ },
+ codeRule: this.codeRule
}
return params
},
@@ -405,10 +449,18 @@
}
}
},
- handleSelectClient(value, item) {
+ async handleSelectClient(value, item) {
if (value === "client") {
this.clientId = item.id
+ await getSalesDetailsList({
+ clientId:this.clientId
+ }).then((res)=>{
+ this.getSalesDetailsFliter(res.data.list)
+ })
+
} else if (value === "contract") {
+ console.log(item,item.number,"閫夋嫨妗�66")
+ this.productTableList.tableData=item.products
this.SalesDetailsId = item.id
}
},
--
Gitblit v1.8.0