From 155f2b80f2a9b6f900c73f6e4461e9cebb7cd028 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 10 十月 2023 17:12:20 +0800
Subject: [PATCH] #
---
pages/business/saleManage/addSaleManage.vue | 111 ++++++++++++++++++++-----------------------------------
1 files changed, 40 insertions(+), 71 deletions(-)
diff --git a/pages/business/saleManage/addSaleManage.vue b/pages/business/saleManage/addSaleManage.vue
index 819b12c..975270a 100644
--- a/pages/business/saleManage/addSaleManage.vue
+++ b/pages/business/saleManage/addSaleManage.vue
@@ -11,9 +11,11 @@
v-model="baseFormData.company" @input="autoLoad('company',baseFormData.company)"></uni-combox>
</view>
</uni-forms-item>
- <uni-forms-item label="鐪佸競鍖�" name="citysData">
- <uni-data-picker @change="areaChange" placeholder="璇烽�夋嫨鐪佸競鍖�" popup-title="璇烽�夋嫨鎵�鍦ㄥ湴鍖�" :localdata="citysData" v-model="baseFormData.pcd">
- </uni-data-picker>
+ <uni-forms-item label="鐢叉柟鍗曚綅" name="cstmrId">
+ <view @click="autoLoad('cstmr','')">
+ <uni-combox :candidates="cstmrs" placeholder="璇烽�夋嫨鐢叉柟鍗曚綅"
+ v-model="baseFormData.cstmrId" @input="autoLoad('cstmr',baseFormData.cstmrId)"></uni-combox>
+ </view>
</uni-forms-item>
<uni-forms-item label="璐熻矗浜�" name="director">
<view @click="autoLoad('user','')">
@@ -21,11 +23,9 @@
v-model="baseFormData.director" @input="autoLoad('user',baseFormData.director)"></uni-combox>
</view>
</uni-forms-item>
- <uni-forms-item label="鐢叉柟鍗曚綅" name="cstmr">
- <view @click="autoLoad('cstmr','')">
- <uni-combox :candidates="cstmrs" placeholder="璇烽�夋嫨鐢叉柟鍗曚綅"
- v-model="baseFormData.cstmr" @input="autoLoad('user',baseFormData.cstmr)"></uni-combox>
- </view>
+ <uni-forms-item label="鐪佸競鍖�" name="citysData">
+ <uni-data-picker @change="areaChange" placeholder="璇烽�夋嫨鐪佸競鍖�" popup-title="璇烽�夋嫨鎵�鍦ㄥ湴鍖�" :localdata="citysData" v-model="baseFormData.pcd">
+ </uni-data-picker>
</uni-forms-item>
<uni-forms-item label="椤圭洰鎬婚噾棰�" name="money">
<uni-easyinput v-model="baseFormData.money" placeholder="璇疯緭鍏ラ」鐩�婚噾棰�" />
@@ -38,7 +38,7 @@
<uni-easyinput type="textarea" v-model="baseFormData.remarks" placeholder="璇疯緭鍏ュ娉�" />
</uni-forms-item>
</uni-forms>
- <button type="primary" @click="addCstmr()">娣诲姞</button>
+ <button type="primary" @click="addOrder()">娣诲姞</button>
</view>
</view>
</template>
@@ -51,13 +51,14 @@
cstmrTypes: [],
cstmrType: '',
companies: [],
- company: '',
directors: [],
director: '',
cstmrs: [],
cstmr: '',
cstmrTypeList: [],
+ cstmrList: [],
directorList: [],
+ companyList: [],
baseFormData: {
citysData: [],
cstmrType: '',
@@ -65,7 +66,9 @@
director: '',
rela: '',
remarks: '',
- cstmr: ''
+ cstmrId: '',
+ addr: '',
+ money: ''
},
rules: {
name: {
@@ -74,48 +77,12 @@
errorMessage: '璇峰~鍐欏鎴峰悕绉�',
}]
},
- rela: {
- rules: [{
- required: false,
- errorMessage: '璇峰~鍐欏鎴峰悕绉�',
- }]
- },
- cstmrType: {
- rules: [{
- required: true,
- errorMessage: '璇烽�夋嫨瀹㈡埛绫诲埆',
- }]
- },
company: {
rules: [{
required: true,
errorMessage: '璇烽�夋墍灞炲叕鍙�',
}]
},
- type: {
- rules: [{
- required: true,
- errorMessage: '璇烽�夋嫨鍖哄垎',
- }]
- },
- tel: {
- rules: [{
- required: true,
- errorMessage: '璇疯緭鍏ョ數璇濆彿鐮�',
- }]
- },
- contacts: {
- rules: [{
- required: true,
- errorMessage: '璇疯緭鍏ュ鎴疯仈绯讳汉',
- }]
- },
- remarks: {
- rules: [{
- required: false,
- errorMessage: '璇疯緭鍏ュ鎴疯仈绯讳汉',
- }]
- }
},
// 鍗曢�夋暟鎹簮
type$: [{
@@ -136,8 +103,6 @@
onShow() {
// 鑾峰彇鐪佸競鍖�
this.citysData = test.citysData
- this.autoLoad('company','')
- this.autoLoad('user','')
},
methods: {
bindPickerChange: function(e) {
@@ -149,10 +114,8 @@
},
autoLoad(type,condition) {
let that = this
- that.cstmrTypes = []
that.companies = []
that.directors = []
- that.directorList = []
that.cstmrs = []
var a = that.baseUrl + '/' + type + 'Query/auth'
uni.request({
@@ -164,13 +127,6 @@
var res = result.data
if (res.code === 200) {
var element;
- if (type == 'cstmrType') {
- for(element of res.data) {
- that.cstmrTypes.push(element.value)
- that.cstmrTypeList.push(element)
- }
- return
- }
if (type == 'user') {
for(element of res.data) {
that.directors.push(element.value)
@@ -181,46 +137,59 @@
if (type == 'company') {
for (element of res.data) {
that.companies.push(element.name)
-
+ that.listAuth(type)
+ that.companyList.push(element)
}
return
}
if (type == 'cstmr') {
for (element of res.data) {
that.cstmrs.push(element.value)
-
+ that.cstmrList.push(element)
}
return
}
-
}
+
}
})
},
- // 娣诲姞鐢ㄦ埛
- addCstmr() {
+ listAuth(type) {
+
+ },
+ // 娣诲姞璺熻釜椤圭洰
+ addOrder() {
let that = this
var element;
+ // 鎵�灞炲叕鍙�
+ for (element of that.companyList) {
+ if(element.name == that.baseFormData.company) {
+ that.baseFormData.company = element.id
+ }
+ }
+ for (element of that.cstmrList) {
+ if(element.value == that.baseFormData.cstmrId) {
+ that.baseFormData.cstmrId = element.id
+ }
+ }
for (element of that.directorList) {
if(element.value == that.baseFormData.director) {
that.baseFormData.director = element.id
}
}
- for (element of that.cstmrTypeList) {
- if(element.value == that.baseFormData.cstmrType) {
- that.baseFormData.cstmrType = element.id
- }
- }
this.$refs.baseForm.validate().then(res=>{
- if (res.rela == undefined) {
- res.rela = ''
+ if (res.addr == undefined) {
+ res.addr = ''
+ }
+ if(res.money == undefined) {
+ res.money = ''
}
if(res.remarks == undefined) {
res.remarks = ''
}
res.pcd = this.citysDataTemp
uni.request({
- url: that.baseUrl + '/cstmr/add/auth',
+ url: that.baseUrl + '/order/add/auth',
header:{
'token':uni.getStorageSync('token'),
'content-type':'application/x-www-form-urlencoded',
--
Gitblit v1.9.1