From 3933f2736aea7d9bcabecae636461026d1746f13 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 15 十二月 2022 17:04:28 +0800
Subject: [PATCH] #
---
pages/business/cstmr/addCsmtr.vue | 83 ++++++++++++++++++++++++++++++++---------
1 files changed, 64 insertions(+), 19 deletions(-)
diff --git a/pages/business/cstmr/addCsmtr.vue b/pages/business/cstmr/addCsmtr.vue
index e4a7230..4e3133e 100644
--- a/pages/business/cstmr/addCsmtr.vue
+++ b/pages/business/cstmr/addCsmtr.vue
@@ -9,8 +9,28 @@
<uni-easyinput v-model="baseFormData.rela" placeholder="璇疯緭鍏ュ鎴峰叧绯�" />
</uni-forms-item>
<uni-forms-item label="瀹㈡埛绫诲埆" required name="cstmrType">
- <uni-combox :candidates="cstmrTypes" placeholder="璇烽�夋嫨瀹㈡埛绫诲埆"
- v-model="baseFormData.cstmrType" @input="autoLoad('cstmrType',baseFormData.cstmrType)"></uni-combox>
+ <view class="uni-list">
+ <view class="uni-list-cell">
+ <view class="uni-list-cell-db" >
+ <picker style="border: 1px solid #e5e5e5;height: 80rpx;border-radius: 4px;line-height: 80rpx;padding-left: 10px;font-size: 14px;" @change="bindPickerChange" :value="cstmrTypeIndex" :range="cstmrTypes" range-key="value">
+ <view class="uni-input">{{cstmrTypes[cstmrTypeIndex].value}}</view>
+ </picker>
+ </view>
+ </view>
+ </view>
+
+
+
+
+
+
+
+
+
+
+
+ <!-- <uni-combox :candidates="cstmrTypes" placeholder="璇烽�夋嫨瀹㈡埛绫诲埆"
+ v-model="baseFormData.cstmrType" @input="autoLoad('cstmrType',baseFormData.cstmrType)"></uni-combox> -->
<!-- <uni-easyinput v-model="baseFormData.cstmrType" placeholder="璇疯緭鍏ュ鎴风被鍒�" /> -->
</uni-forms-item>
<uni-forms-item label="鍖哄垎" required name="type">
@@ -51,6 +71,7 @@
baseUrl: '',
cstmrTypes: [],
cstmrType: '',
+ cstmrTypeIndex: 0,
directors: [],
director: '',
baseFormData: {
@@ -117,7 +138,8 @@
value: 2
}],
citysData: [],
- userArea: ''
+ userArea: '',
+ cstmrList: [],
}
},
onReady() {
@@ -135,6 +157,12 @@
// this.getUser()
},
methods: {
+ bindPickerChange: function(e) {
+ console.log(e);
+ console.log('picker鍙戦�侀�夋嫨鏀瑰彉锛屾惡甯﹀�间负锛�' + e.detail.value)
+ console.log(this.cstmrTypes[e.detail.value].id);
+ this.cstmrTypeIndex = e.detail.value
+ },
autoLoad(type,condition) {
let that = this
var a = that.baseUrl + '/' + type + 'Query/auth'
@@ -145,11 +173,12 @@
method: 'GET',
success(result) {
var res = result.data
+ console.log(res);
if (res.code === 200) {
var element;
if (type == 'cstmrType') {
for(element of res.data) {
- that.cstmrTypes.push(element.value)
+ that.cstmrTypes.push(element)
}
return
}
@@ -166,24 +195,40 @@
},
// 娣诲姞鐢ㄦ埛
addCstmr() {
+
let that = this
+ uni.request({
+ // url: that.baseUrl + '/cstmr/add/auth',
+ url: "http://localhost:9528" + '/cstmr/add/auth',
+ header:{
+ 'token':uni.getStorageSync('token'),
+ // 'content-type':'application/json',
+ },
+ data: {
+ addr: "婊ㄦ睙璺�35鍙�",
+ contacts: "绋嬬嚂",
+ cstmrType: 1,
+ cstmrType$: "绗竴绫�",
+ director: "19",
+ director$: "瓒呯骇绠$悊鍛�",
+ id: "",
+ name: "娴嬭瘯2",
+ pcd:"14000,140100,140105",
+ rela: "",
+ remarks: "",
+ tel: "15987462587",
+ type: "1"
+ },
+ method: 'POST',
+ success(result) {
+ var res = result.data
+ console.log(res);
+ }
+ })
+ return
this.$refs.baseForm.validate().then(res=>{
console.log(res);
- var a = JSON.stringify(res)
- console.log(a);
- uni.request({
- url: that.baseUrl + '/cstmr/add/auth',
- header:{
- 'token':uni.getStorageSync('token'),
- // 'content-type':'application/json',
- },
- data: a,
- method: 'POST',
- success(result) {
- var res = result.data
- console.log(res);
- }
- })
+
}).catch(err =>{
})
}
--
Gitblit v1.9.1