From ab5f30b92641cc3559522b5eda3c525323e24d35 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期六, 09 九月 2023 09:47:18 +0800 Subject: [PATCH] # --- pages/business/plan/addPlan3.vue | 322 +++++++ pages/business/plan/addPlan4.vue | 322 +++++++ pages/business/plan/addPlan2.vue | 487 +++++++++++ pages/business/plan/planDetails.vue | 8 pages.json | 84 + pages/business/plan/plan.vue | 274 ++++++ pages/business/business.vue | 2 pages/business/plan/addPlan6.vue | 322 +++++++ pages/business/plan/addPlan5.vue | 322 +++++++ pages/business/plan/addPlan.vue | 475 ++++++++++ 10 files changed, 2,605 insertions(+), 13 deletions(-) diff --git a/pages.json b/pages.json index c6cedf2..4c9cafe 100644 --- a/pages.json +++ b/pages.json @@ -54,6 +54,18 @@ } }, { + "path": "pages/business/cstmr/addCsmtr", + "style": { + "navigationBarTitleText": "娣诲姞鐢叉柟鍗曚綅" + } + }, + { + "path": "pages/business/cstmr/cstmrDetails", + "style": { + "navigationBarTitleText": "璧勬枡璇︽儏" + } + }, + { "path": "pages/business/saleManage/saleManage", "style": { // "navigationStyle": "custom" @@ -71,21 +83,9 @@ } }, { - "path": "pages/business/cstmr/addCsmtr", - "style": { - "navigationBarTitleText": "娣诲姞鐢叉柟鍗曚綅" - } - }, - { "path": "pages/business/saleManage/addSaleManage", "style": { "navigationBarTitleText": "娣诲姞璺熻釜椤圭洰" - } - }, - { - "path": "pages/business/cstmr/cstmrDetails", - "style": { - "navigationBarTitleText": "璧勬枡璇︽儏" } }, { @@ -93,9 +93,69 @@ "style": { "navigationBarTitleText": "璧勬枡璇︽儏" } + }, + { + "path": "pages/business/plan/plan", + "style": { + // "navigationStyle": "custom" + "navigationBarTitleText": "瑙勫垝鐢宠鍗�", + "titleNView": { + "buttons": [ + { + "text":"娣诲姞", + "fontSize":"14px", + "float":"right", + "width": "44px" + } + ] + } + } + }, + { + "path": "pages/business/plan/addPlan", + "style": { + "navigationBarTitleText": "娣诲姞瑙勫垝鐢宠鍗�-绔嬩綋搴擄紙璐ф灦锛�" + } + }, + { + "path": "pages/business/plan/addPlan2", + "style": { + "navigationBarTitleText": "娣诲姞瑙勫垝鐢宠鍗�-绔嬩綋搴擄紙闆嗘垚锛�" + } + }, + { + "path": "pages/business/plan/addPlan3", + "style": { + "navigationBarTitleText": "鍥涘悜绌挎搴�/涓ゅ悜绌挎搴�" + } + }, + { + "path": "pages/business/plan/addPlan4", + "style": { + "navigationBarTitleText": "闃佹ゼ璐ф灦/閽㈠钩鍙�" + } + }, + { + "path": "pages/business/plan/addPlan5", + "style": { + "navigationBarTitleText": "鍛ㄨ浆瀹瑰櫒" + } + }, + { + "path": "pages/business/plan/addPlan6", + "style": { + "navigationBarTitleText": "骞冲簱" + } + }, + { + "path": "pages/business/plan/planDetails", + "style": { + "navigationBarTitleText": "璧勬枡璇︽儏" + } } + ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/business/business.vue b/pages/business/business.vue index d8ad6d2..a42cba2 100644 --- a/pages/business/business.vue +++ b/pages/business/business.vue @@ -60,7 +60,7 @@ break; case 3: uni.navigateTo({ - url:'/pages/business/cstmr/csmtr' + url:'/pages/business/plan/plan' }) break; diff --git a/pages/business/plan/addPlan.vue b/pages/business/plan/addPlan.vue new file mode 100644 index 0000000..1d5ce63 --- /dev/null +++ b/pages/business/plan/addPlan.vue @@ -0,0 +1,475 @@ +<template> + <view> + <view class="container"> + <uni-forms ref="baseForm" :modelValue="baseFormData"> + <uni-forms-item label="鍞墠瑙勫垝鍗曞悕绉�" required name="name"> + <uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О" /> + </uni-forms-item> + <uni-forms-item label="璺熻釜椤圭洰" required name="orderId" > + <view @click="autoLoad('order','')"> + <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨璺熻釜椤圭洰" + v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="涓氬姟鍛�" required name="userId"> + <view @click="autoLoad('user','')"> + <uni-combox :candidates="users" placeholder="璇烽�夋嫨涓氬姟鍛�" + v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="鎵�闇�" name="planNeed"> + <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" /> + </uni-forms-item> + <uni-forms-item label="鐢宠鏃ユ湡" required name="appleTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" /> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鍚嶇О" required 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="涓氬姟绫诲瀷" required name="planType"> + <uni-easyinput disabled placeholder="璇疯緭鍏ュ唴瀹�" v-model="baseFormData.planType"></uni-easyinput> + </uni-forms-item> + <uni-forms-item label="绔嬮」" name="beItem"> + <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" /> + </uni-forms-item> + + + <uni-forms-item label="璐х墿瑙勬牸" required name="input_1"> + <uni-easyinput v-model="baseFormData.input_1" placeholder="璇疯緭鍏ヨ揣鐗╄鏍�" /> + </uni-forms-item> + <uni-forms-item label="璐х墿閲嶉噺" required name="input_2"> + <uni-easyinput v-model="baseFormData.input_2" placeholder="璇疯緭鍏ヨ揣鐗╅噸閲�" /> + </uni-forms-item> + <uni-forms-item label="浠撳簱娓╁害" required name="input_6"> + <uni-easyinput v-model="baseFormData.input_6" placeholder="璇疯緭鍏ヤ粨搴撴俯搴�" /> + </uni-forms-item> + <uni-forms-item label="椤堕儴鏈�浣庣偣绂诲湴璺濈" required name="input_8"> + <uni-easyinput v-model="baseFormData.input_8" placeholder="璇疯緭鍏ヨ揣鐗╄鏍�" /> + </uni-forms-item> + <uni-forms-item label="杩涘弶鏂瑰悜" required name="input_4"> + <uni-easyinput v-model="baseFormData.input_4" placeholder="璇疯緭鍏ヨ揣鐗╄鏍�" /> + </uni-forms-item> + <uni-forms-item label="鍘傛埧鍙敤楂樺害" required name="input_5"> + <uni-easyinput v-model="baseFormData.input_5" placeholder="璇疯緭鍏ヨ揣鐗╄鏍�" /> + </uni-forms-item> + <uni-forms-item label="閫氶亾澶у皬鏈夋棤瑕佹眰" required name="input_7"> + <uni-easyinput v-model="baseFormData.input_7" placeholder="璇疯緭鍏ヨ揣鐗╄鏍�" /> + </uni-forms-item> + <uni-forms-item label="骞冲簱璐ф灦绫诲瀷" required name="select_2"> + <uni-combox :candidates="selList" placeholder="璇烽�夋嫨骞冲簱璐ф灦绫诲瀷" + v-model="baseFormData.select_2"></uni-combox> + </uni-forms-item> + <uni-forms-item label="鏄惁闇�瑕佽法姊�" name="radio_1"> + <uni-data-checkbox v-model="baseFormData.radio_1" :localdata="radio_1" /> + </uni-forms-item> + <uni-forms-item label="鏄惁闇�瑕佺綉灞傛澘" name="radio_2"> + <uni-data-checkbox v-model="baseFormData.radio_2" :localdata="radio_2" /> + </uni-forms-item> + <uni-forms-item label="鏄惁闇�瑕佸眰鏉�" name="radio_8"> + <uni-data-checkbox v-model="baseFormData.radio_8" :localdata="radio_8" /> + </uni-forms-item> + <uni-forms-item label="鍦伴潰鏈夋棤鐢电紗娌�" name="radio_3"> + <uni-data-checkbox v-model="baseFormData.radio_3" :localdata="radio_3" /> + </uni-forms-item> + <uni-forms-item label="鍦伴潰骞虫暣搴﹀拰鍦伴潰娌夐檷鏄惁婊¤冻鏍囧噯" name="radio_5"> + <uni-data-checkbox v-model="baseFormData.radio_5" :localdata="radio_5" /> + </uni-forms-item> + <uni-forms-item label="甯冨眬鍖哄煙鏄惁鎻愪緵CAD鍦哄湴鍥剧焊/鍦哄湴" name="radio_7"> + <uni-data-checkbox v-model="baseFormData.radio_7" :localdata="radio_7" /> + </uni-forms-item> + <uni-forms-item label="鍏朵粬瑕佹眰鍙婃敞鎰忕偣" required name="textarea_2"> + <uni-easyinput type="textarea" v-model="baseFormData.textarea_2" placeholder="璇疯緭鍏�" /> + </uni-forms-item> + <br> + + <uni-forms-item label="瑙勫垝鍛�" name="planner$"> + <uni-easyinput v-model="baseFormData.planner$" placeholder="璇疯緭鍏ヨ鍒掑憳" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规" name="change"> + <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规鍘熷洜" name="changeReason"> + <uni-easyinput v-model="baseFormData.changeReason" placeholder="璇疯緭鍏ユ洿鏀规柟妗堝師鍥�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸缁勯暱濂栭噾" name="planLeaderBonus"> + <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="璇疯緭鍏ヨ鏍肩粍闀垮閲�" /> + </uni-forms-item> + <uni-forms-item label="瀹屾垚鏃堕棿" name="finishTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.datetimesingle"/> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="鏇存敼娆℃暟" name="changeTime"> + <uni-easyinput v-model="baseFormData.changeTime" placeholder="璇疯緭鍏ユ洿鏀规鏁�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸濂栭噾" name="planBonus"> + <uni-easyinput v-model="baseFormData.planBonus" placeholder="璇疯緭鍏ヨ鏍煎閲�" /> + </uni-forms-item> + </uni-forms> + <button type="primary" @click="addCstmr()">娣诲姞</button> + </view> + </view> +</template> + +<script> + import test from '../../../static/js/citys-data.js' + export default { + data() { + return { + orderIds: [], + orderList: [], + users: [], + userList: [], + cstmrs: [], + cstmrList: [], + baseFormData: { + name: '', + orderId: '', + userId: '', + appleTime: '', + cstmrId: '', + planType: '绔嬩綋搴擄紙璐ф灦锛�', + select_2: '', + changeReason: '', + changeTime: '', + planBonus: '', + planLeaderBonus: '' + }, + selList: ['妯寮�','椹跺叆寮�','鎮寮�','娴佸埄寮�','閲嶅姏寮�','鍏朵粬'], + rules: { + name: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О', + }] + }, + orderId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨璺熻釜椤圭洰', + }] + }, + userId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨涓氬姟鍛�', + }] + }, + appleTime: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨鐢宠鏃ユ湡', + }] + }, + cstmrId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨瀹㈡埛鍚嶇О', + }] + }, + planType: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ笟鍔$被鍨�', + }] + }, + input_1: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヨ揣鐗╄鏍�', + }] + }, + input_2: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヨ揣鐗╅噸閲�', + }] + }, + input_6: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ粨搴撴俯搴�', + }] + }, + input_8: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ラ《閮ㄦ渶浣庣偣绂诲湴璺濈', + }] + }, + input_4: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヨ繘鍙夋柟鍚�', + }] + }, + input_5: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ巶鎴垮彲鐢ㄩ珮搴�', + }] + }, + input_7: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ラ�氶亾澶у皬鏈夋棤瑕佹眰', + }] + }, + select_2: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨骞冲簱璐ф灦绫诲瀷', + }] + }, + + }, + // 鏄惁闇�瑕佽法姊� + radio_1: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + // 鏄惁闇�瑕佺綉灞傛澘 + radio_2: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_8: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_3: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_5: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_7: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + changeValue: [ + { + text: '鏄�', + value: '1' + }, + { + text: '鍚�', + value: '0' + } + ], + // 鍗曢�夋暟鎹簮 + beItem$: [{ + text: '鏄�', + value: '1' + }, { + text: '鍚︼紙闇�鍞墠鎶�鏈窡杩涢」鐩紝涓庡鎴风洿鎺ユ矡閫氱瓑锛�', + value: '0' + }], + citysData: [], + citysDataTemp: '', + planNeeds: [ + { + text: '绯荤粺 鏂规瑙勫垝璁捐', + value: 1 + }, + { + text: '鎻愪緵閫夋潗娓呭崟', + value: 2 + }, + { + text: '绔嬩綋搴撹璁℃柟妗�', + value: 3 + } + ] + + } + }, + onReady() { + // 闇�瑕佸湪onReady涓缃鍒� + this.$refs.baseForm.setRules(this.rules) + }, + onShow() { + // 鑾峰彇鐪佸競鍖� + this.citysData = test.citysData + }, + methods: { + bindPickerChange: function(e) { + this.cstmrTypeIndex = e.detail.value + this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id + }, + areaChange(e) { + this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value + }, + autoLoad(type,condition) { + let that = this + that.orderIds = [] + that.users = [] + that.cstmrs = [] + var a = that.baseUrl + '/' + type + 'Query/auth' + uni.request({ + url: that.baseUrl + '/' + type + 'Query' +'/auth', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + var res = result.data + if (res.code === 200) { + var element; + if (type == 'order') { + for(element of res.data) { + that.orderIds.push(element.name) + that.orderList.push(element) + } + return + } + if (type == 'user') { + for(element of res.data) { + that.users.push(element.value) + that.userList.push(element) + } + return + } + if (type == 'cstmr') { + for(element of res.data) { + that.cstmrs.push(element.value) + that.cstmrList.push(element) + } + return + } + } + } + }) + }, + getOrderId() { + let that = this + uni.request({ + url: that.baseUrl + '/order/all/get/kv', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + } + }) + }, + // 娣诲姞鐢ㄦ埛 + addCstmr() { + let that = this + var element + for (element of that.cstmrList) { + if(element.value == that.baseFormData.cstmrId) { + that.baseFormData.cstmrId = element.id + } + } + for (element of that.orderList) { + if(element.name == that.baseFormData.orderId) { + that.baseFormData.orderId = element.id + } + } + for (element of that.userList) { + if(element.value == that.baseFormData.userId) { + that.baseFormData.userId = element.id + } + } + for(var i = 1;i <= that.selList.length; i++) { + if (that.selList[i] == that.baseFormData.select_2) { + that.baseFormData.select_2 = 'value' + i + } + } + that.baseFormData.planType = 4 + var temp + for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) { + if (i == 0) { + temp = that.baseFormData.planNeed[i] + } else { + temp = temp + '-' + that.baseFormData.planNeed[i] + } + + } + that.baseFormData.planNeed = temp + this.$refs.baseForm.validate().then(res=>{ + for (let k in res) { + if (res[k] == undefined) { + res[k] = '' + } + } + uni.request({ + url: that.baseUrl + '/plan/add/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type':'application/x-www-form-urlencoded', + }, + data: res, + method: 'POST', + success(result) { + var res = result.data + if (res.code === 200) { + uni.navigateBack() + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }) + }).catch(err =>{ + }) + } + } + + } +</script> + +<style> + .container { + min-height: 50rpx; + padding: 15px; + background-color: #fff; + /* background-color: aqua; */ + } +</style> \ No newline at end of file diff --git a/pages/business/plan/addPlan2.vue b/pages/business/plan/addPlan2.vue new file mode 100644 index 0000000..2384db9 --- /dev/null +++ b/pages/business/plan/addPlan2.vue @@ -0,0 +1,487 @@ +<template> + <view> + <view class="container"> + <uni-forms ref="baseForm" :modelValue="baseFormData"> + <uni-forms-item label="鍞墠瑙勫垝鍗曞悕绉�" required name="name"> + <uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О" /> + </uni-forms-item> + <uni-forms-item label="璺熻釜椤圭洰" required name="orderId" > + <view @click="autoLoad('order','')"> + <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨璺熻釜椤圭洰" + v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="涓氬姟鍛�" required name="userId"> + <view @click="autoLoad('user','')"> + <uni-combox :candidates="users" placeholder="璇烽�夋嫨涓氬姟鍛�" + v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox> + </view> + </uni-forms-item> + + <uni-forms-item label="涓氬姟鍛樿仈绯绘柟寮�" required name="userXmlSelPhone"> + <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="璇疯緭鍏ヤ笟鍔″憳鑱旂郴鏂瑰紡" /> + </uni-forms-item> + <uni-forms-item label="鎵�闇�" name="planNeed"> + <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" /> + </uni-forms-item> + <uni-forms-item label="鐢宠鏃ユ湡" required name="appleTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" /> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鍚嶇О" required 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="涓氬姟绫诲瀷" required name="planType"> + <uni-easyinput disabled placeholder="璇疯緭鍏ヤ笟鍔$被鍨�" v-model="baseFormData.planType"></uni-easyinput> + </uni-forms-item> + <uni-forms-item label="绔嬮」" name="beItem"> + <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" /> + </uni-forms-item> + + + <uni-forms-item label="璐х墿瑙勬牸" required name="input_2"> + <uni-easyinput v-model="baseFormData.input_2" placeholder="璇疯緭鍏ヨ揣鐗╄鏍�" /> + </uni-forms-item> + <uni-forms-item label="璐х墿閲嶉噺" required name="input_5"> + <uni-easyinput v-model="baseFormData.input_5" placeholder="璇疯緭鍏ヨ揣鐗╅噸閲�" /> + </uni-forms-item> + <uni-forms-item label="鍘傛埧鍙敤楂樺害" required name="input_4"> + <uni-easyinput v-model="baseFormData.input_4" placeholder="璇疯緭鍏ュ巶鎴垮彲鐢ㄩ珮搴�" /> + </uni-forms-item> + <uni-forms-item label="椤堕儴鏈�浣庣偣绂诲湴璺濈" required name="input_9"> + <uni-easyinput v-model="baseFormData.input_9" placeholder="璇疯緭鍏ラ《閮ㄦ渶浣庣偣绂诲湴璺濈" /> + </uni-forms-item> + <uni-forms-item label="杩涘弶鏂瑰悜" required name="input_3"> + <uni-easyinput v-model="baseFormData.input_3" placeholder="璇疯緭鍏ヨ繘鍙夋柟鍚�" /> + </uni-forms-item> + <uni-forms-item label="浠撳簱娓╁害" required name="input_7"> + <uni-easyinput v-model="baseFormData.input_7" placeholder="璇疯緭鍏ヤ粨搴撴俯搴�" /> + </uni-forms-item> + <uni-forms-item label="鎶楅渿璁鹃槻鐑堝害" required name="input_6"> + <uni-easyinput v-model="baseFormData.input_6" placeholder="璇疯緭鍏ユ姉闇囪闃茬儓搴�" /> + </uni-forms-item> + <uni-forms-item label="鍩烘湰鍦伴渿鍔犻�熷害" required name="input_11"> + <uni-easyinput v-model="baseFormData.input_11" placeholder="璇疯緭鍏ュ熀鏈湴闇囧姞閫熷害" /> + </uni-forms-item> + <uni-forms-item label="绔嬩綋搴撹揣鏋剁被鍨�" required name="select_3"> + <uni-combox :candidates="selList" placeholder="璇疯緭鍏ョ珛浣撳簱璐ф灦绫诲瀷" + v-model="baseFormData.select_3"></uni-combox> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鎶�鏈鎺ヨ仈绯绘柟寮忥紙閫夊~锛�" name="input_8"> + <uni-easyinput v-model="baseFormData.input_8" placeholder="璇疯緭鍏ョ珛浣撳簱璐ф灦绫诲瀷" /> + </uni-forms-item> + + + + + <uni-forms-item label="鏄惁鏈夋秷闃茶姹�" name="radio_5"> + <uni-data-checkbox v-model="baseFormData.radio_5" :localdata="radio_5" /> + </uni-forms-item> + <uni-forms-item label="鍚﹂渶瑕佽揣鏋惰儗缃�" name="radio_8"> + <uni-data-checkbox v-model="baseFormData.radio_8" :localdata="radio_8" /> + </uni-forms-item> + <uni-forms-item label="鍦伴潰鏈夋棤鐢电紗娌�" name="radio_7"> + <uni-data-checkbox v-model="baseFormData.radio_7" :localdata="radio_7" /> + </uni-forms-item> + <uni-forms-item label="甯冨眬鍖哄煙鏄惁鎻愪緵CAD鍦哄湴鍥剧焊/鍦哄湴" name="radio_6"> + <uni-data-checkbox v-model="baseFormData.radio_6" :localdata="radio_6" /> + </uni-forms-item> + <uni-forms-item label="鍦伴潰骞虫暣搴﹀拰鍦伴潰娌夐檷鏄惁婊¤冻鏍囧噯" name="radio_10"> + <uni-data-checkbox v-model="baseFormData.radio_10" :localdata="radio_10" /> + </uni-forms-item> + <uni-forms-item label="鍏朵粬瑕佹眰鍙婃敞鎰忕偣" required name="textarea_2"> + <uni-easyinput type="textarea" v-model="baseFormData.textarea_2" placeholder="璇疯緭鍏�" /> + </uni-forms-item> + <br> + + <uni-forms-item label="瑙勫垝鍛�" name="planner$"> + <uni-easyinput v-model="baseFormData.planner$" placeholder="璇疯緭鍏ヨ鍒掑憳" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规" name="change"> + <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规鍘熷洜" name="changeReason"> + <uni-easyinput v-model="baseFormData.changeReason" placeholder="璇疯緭鍏ユ洿鏀规柟妗堝師鍥�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸缁勯暱濂栭噾" name="planLeaderBonus"> + <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="璇疯緭鍏ヨ鏍肩粍闀垮閲�" /> + </uni-forms-item> + <uni-forms-item label="瀹屾垚鏃堕棿" name="finishTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.datetimesingle"/> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="鏇存敼娆℃暟" name="changeTime"> + <uni-easyinput v-model="baseFormData.changeTime" placeholder="璇疯緭鍏ユ洿鏀规鏁�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸濂栭噾" name="planBonus"> + <uni-easyinput v-model="baseFormData.planBonus" placeholder="璇疯緭鍏ヨ鏍煎閲�" /> + </uni-forms-item> + </uni-forms> + <button type="primary" @click="addCstmr()">娣诲姞</button> + </view> + </view> +</template> + +<script> + import test from '../../../static/js/citys-data.js' + export default { + data() { + return { + orderIds: [], + orderList: [], + users: [], + userList: [], + cstmrs: [], + cstmrList: [], + baseFormData: { + name: '', + orderId: '', + userId: '', + appleTime: '', + cstmrId: '', + planType: '绔嬩綋搴擄紙璐ф灦锛�', + select_2: '', + changeReason: '', + changeTime: '', + planBonus: '', + planLeaderBonus: '' + }, + selList: ['鐗涜吙寮�','妯寮�','鏂拌兘婧�','鍏朵粬'], + rules: { + name: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О', + }] + }, + orderId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨璺熻釜椤圭洰', + }] + }, + userId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨涓氬姟鍛�', + }] + }, + userXmlSelPhone: { + rules: [{ + required: true, + errorMessage: '璇峰~鍐欎笟鍔″憳鑱旂郴鏂瑰紡', + }] + }, + appleTime: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨鐢宠鏃ユ湡', + }] + }, + cstmrId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨瀹㈡埛鍚嶇О', + }] + }, + planType: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ笟鍔$被鍨�', + }] + }, + input_2: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヨ揣鐗╄鏍�', + }] + }, + input_5: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヨ揣鐗╅噸閲�', + }] + }, + input_4: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ巶鎴垮彲鐢ㄩ珮搴�', + }] + }, + input_9: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ラ《閮ㄦ渶浣庣偣绂诲湴璺濈', + }] + }, + input_3: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヨ繘鍙夋柟鍚�', + }] + }, + input_7: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ粨搴撴俯搴�', + }] + }, + input_6: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ユ姉闇囪闃茬儓搴�', + }] + }, + input_11: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ熀鏈湴闇囧姞閫熷害', + }] + }, + select_3: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨绔嬪簱璐ф灦绫诲瀷', + }] + }, + + }, + radio_5: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_6: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_7: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_8: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + radio_10: [ + { + text: '鏄�', + value: 'value1' + }, + { + text: '鍚�', + value: 'value2' + } + ], + changeValue: [ + { + text: '鏄�', + value: '1' + }, + { + text: '鍚�', + value: '0' + } + ], + // 鍗曢�夋暟鎹簮 + beItem$: [{ + text: '鏄�', + value: '1' + }, { + text: '鍚︼紙闇�鍞墠鎶�鏈窡杩涢」鐩紝涓庡鎴风洿鎺ユ矡閫氱瓑锛�', + value: '0' + }], + citysData: [], + citysDataTemp: '', + planNeeds: [ + { + text: '绯荤粺 鏂规瑙勫垝璁捐', + value: 1 + }, + { + text: '鎻愪緵閫夋潗娓呭崟', + value: 2 + }, + { + text: '绔嬩綋搴撹璁℃柟妗�', + value: 3 + } + ] + + } + }, + onReady() { + // 闇�瑕佸湪onReady涓缃鍒� + this.$refs.baseForm.setRules(this.rules) + }, + onShow() { + // 鑾峰彇鐪佸競鍖� + this.citysData = test.citysData + }, + methods: { + bindPickerChange: function(e) { + this.cstmrTypeIndex = e.detail.value + this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id + }, + areaChange(e) { + this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value + }, + autoLoad(type,condition) { + let that = this + that.orderIds = [] + that.users = [] + that.cstmrs = [] + var a = that.baseUrl + '/' + type + 'Query/auth' + uni.request({ + url: that.baseUrl + '/' + type + 'Query' +'/auth', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + var res = result.data + if (res.code === 200) { + var element; + if (type == 'order') { + for(element of res.data) { + that.orderIds.push(element.name) + that.orderList.push(element) + } + return + } + if (type == 'user') { + for(element of res.data) { + that.users.push(element.value) + that.userList.push(element) + } + return + } + if (type == 'cstmr') { + for(element of res.data) { + that.cstmrs.push(element.value) + that.cstmrList.push(element) + } + return + } + } + } + }) + }, + getOrderId() { + let that = this + uni.request({ + url: that.baseUrl + '/order/all/get/kv', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + } + }) + }, + // 娣诲姞鐢ㄦ埛 + addCstmr() { + let that = this + var element + + for (element of that.cstmrList) { + if(element.value == that.baseFormData.cstmrId) { + that.baseFormData.cstmrId = element.id + } + } + for (element of that.orderList) { + if(element.name == that.baseFormData.orderId) { + that.baseFormData.orderId = element.id + } + } + for (element of that.userList) { + if(element.value == that.baseFormData.userId) { + that.baseFormData.userId = element.id + } + } + for(var i = 1;i <= that.selList.length; i++) { + if (that.selList[i] == that.baseFormData.select_3) { + that.baseFormData.select_3 = 'value' + i + } + } + that.baseFormData.planType = 5 + var temp + for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) { + if (i == 0) { + temp = that.baseFormData.planNeed[i] + } else { + temp = temp + '-' + that.baseFormData.planNeed[i] + } + + } + that.baseFormData.planNeed = temp + this.$refs.baseForm.validate().then(res=>{ + for (let k in res) { + if (res[k] == undefined) { + res[k] = '' + } + } + uni.request({ + url: that.baseUrl + '/plan/add/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type':'application/x-www-form-urlencoded', + }, + data: res, + method: 'POST', + success(result) { + var res = result.data + if (res.code === 200) { + uni.navigateBack() + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }) + }).catch(err =>{ + }) + } + } + + } +</script> + +<style> + .container { + min-height: 50rpx; + padding: 15px; + background-color: #fff; + /* background-color: aqua; */ + } +</style> \ No newline at end of file diff --git a/pages/business/plan/addPlan3.vue b/pages/business/plan/addPlan3.vue new file mode 100644 index 0000000..ff1dc03 --- /dev/null +++ b/pages/business/plan/addPlan3.vue @@ -0,0 +1,322 @@ +<template> + <view> + <view class="container"> + <uni-forms ref="baseForm" :modelValue="baseFormData"> + <uni-forms-item label="鍞墠瑙勫垝鍗曞悕绉�" required name="name"> + <uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О" /> + </uni-forms-item> + <uni-forms-item label="璺熻釜椤圭洰" required name="orderId" > + <view @click="autoLoad('order','')"> + <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨璺熻釜椤圭洰" + v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="涓氬姟鍛�" required name="userId"> + <view @click="autoLoad('user','')"> + <uni-combox :candidates="users" placeholder="璇烽�夋嫨涓氬姟鍛�" + v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox> + </view> + </uni-forms-item> + + <uni-forms-item label="涓氬姟鍛樿仈绯绘柟寮�" required name="userXmlSelPhone"> + <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="璇疯緭鍏ヤ笟鍔″憳鑱旂郴鏂瑰紡" /> + </uni-forms-item> + <uni-forms-item label="鎵�闇�" name="planNeed"> + <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" /> + </uni-forms-item> + <uni-forms-item label="鐢宠鏃ユ湡" required name="appleTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" /> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鍚嶇О" required 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="涓氬姟绫诲瀷" required name="planType"> + <uni-easyinput disabled placeholder="璇疯緭鍏ヤ笟鍔$被鍨�" v-model="baseFormData.planType"></uni-easyinput> + </uni-forms-item> + <uni-forms-item label="绔嬮」" name="beItem"> + <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" /> + </uni-forms-item> + + + + <uni-forms-item label="瑙勫垝鍛�" name="planner$"> + <uni-easyinput v-model="baseFormData.planner$" placeholder="璇疯緭鍏ヨ鍒掑憳" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规" name="change"> + <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规鍘熷洜" name="changeReason"> + <uni-easyinput v-model="baseFormData.changeReason" placeholder="璇疯緭鍏ユ洿鏀规柟妗堝師鍥�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸缁勯暱濂栭噾" name="planLeaderBonus"> + <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="璇疯緭鍏ヨ鏍肩粍闀垮閲�" /> + </uni-forms-item> + <uni-forms-item label="瀹屾垚鏃堕棿" name="finishTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.datetimesingle"/> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="鏇存敼娆℃暟" name="changeTime"> + <uni-easyinput v-model="baseFormData.changeTime" placeholder="璇疯緭鍏ユ洿鏀规鏁�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸濂栭噾" name="planBonus"> + <uni-easyinput v-model="baseFormData.planBonus" placeholder="璇疯緭鍏ヨ鏍煎閲�" /> + </uni-forms-item> + </uni-forms> + <button type="primary" @click="addCstmr()">娣诲姞</button> + </view> + </view> +</template> + +<script> + import test from '../../../static/js/citys-data.js' + export default { + data() { + return { + orderIds: [], + orderList: [], + users: [], + userList: [], + cstmrs: [], + cstmrList: [], + baseFormData: { + name: '', + orderId: '', + userId: '', + appleTime: '', + cstmrId: '', + planType: '绔嬩綋搴擄紙璐ф灦锛�', + select_2: '', + changeReason: '', + changeTime: '', + planBonus: '', + planLeaderBonus: '' + }, + rules: { + name: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О', + }] + }, + orderId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨璺熻釜椤圭洰', + }] + }, + userId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨涓氬姟鍛�', + }] + }, + userXmlSelPhone: { + rules: [{ + required: true, + errorMessage: '璇峰~鍐欎笟鍔″憳鑱旂郴鏂瑰紡', + }] + }, + appleTime: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨鐢宠鏃ユ湡', + }] + }, + cstmrId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨瀹㈡埛鍚嶇О', + }] + }, + planType: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ笟鍔$被鍨�', + }] + }, + }, + changeValue: [ + { + text: '鏄�', + value: '1' + }, + { + text: '鍚�', + value: '0' + } + ], + // 鍗曢�夋暟鎹簮 + beItem$: [{ + text: '鏄�', + value: '1' + }, { + text: '鍚︼紙闇�鍞墠鎶�鏈窡杩涢」鐩紝涓庡鎴风洿鎺ユ矡閫氱瓑锛�', + value: '0' + }], + citysData: [], + citysDataTemp: '', + planNeeds: [ + { + text: '绯荤粺 鏂规瑙勫垝璁捐', + value: 1 + }, + { + text: '鎻愪緵閫夋潗娓呭崟', + value: 2 + }, + { + text: '绔嬩綋搴撹璁℃柟妗�', + value: 3 + } + ] + + } + }, + onReady() { + // 闇�瑕佸湪onReady涓缃鍒� + this.$refs.baseForm.setRules(this.rules) + }, + onShow() { + // 鑾峰彇鐪佸競鍖� + this.citysData = test.citysData + }, + methods: { + bindPickerChange: function(e) { + this.cstmrTypeIndex = e.detail.value + this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id + }, + areaChange(e) { + this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value + }, + autoLoad(type,condition) { + let that = this + that.orderIds = [] + that.users = [] + that.cstmrs = [] + var a = that.baseUrl + '/' + type + 'Query/auth' + uni.request({ + url: that.baseUrl + '/' + type + 'Query' +'/auth', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + var res = result.data + if (res.code === 200) { + var element; + if (type == 'order') { + for(element of res.data) { + that.orderIds.push(element.name) + that.orderList.push(element) + } + return + } + if (type == 'user') { + for(element of res.data) { + that.users.push(element.value) + that.userList.push(element) + } + return + } + if (type == 'cstmr') { + for(element of res.data) { + that.cstmrs.push(element.value) + that.cstmrList.push(element) + } + return + } + } + } + }) + }, + getOrderId() { + let that = this + uni.request({ + url: that.baseUrl + '/order/all/get/kv', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + } + }) + }, + // 娣诲姞鐢ㄦ埛 + addCstmr() { + let that = this + var element + + for (element of that.cstmrList) { + if(element.value == that.baseFormData.cstmrId) { + that.baseFormData.cstmrId = element.id + } + } + for (element of that.orderList) { + if(element.name == that.baseFormData.orderId) { + that.baseFormData.orderId = element.id + } + } + for (element of that.userList) { + if(element.value == that.baseFormData.userId) { + that.baseFormData.userId = element.id + } + } + that.baseFormData.planType = 5 + var temp + for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) { + if (i == 0) { + temp = that.baseFormData.planNeed[i] + } else { + temp = temp + '-' + that.baseFormData.planNeed[i] + } + + } + that.baseFormData.planNeed = temp + this.$refs.baseForm.validate().then(res=>{ + for (let k in res) { + if (res[k] == undefined) { + res[k] = '' + } + } + uni.request({ + url: that.baseUrl + '/plan/add/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type':'application/x-www-form-urlencoded', + }, + data: res, + method: 'POST', + success(result) { + var res = result.data + if (res.code === 200) { + uni.navigateBack() + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }) + }).catch(err =>{ + }) + } + } + + } +</script> + +<style> + .container { + min-height: 50rpx; + padding: 15px; + background-color: #fff; + /* background-color: aqua; */ + } +</style> \ No newline at end of file diff --git a/pages/business/plan/addPlan4.vue b/pages/business/plan/addPlan4.vue new file mode 100644 index 0000000..ff1dc03 --- /dev/null +++ b/pages/business/plan/addPlan4.vue @@ -0,0 +1,322 @@ +<template> + <view> + <view class="container"> + <uni-forms ref="baseForm" :modelValue="baseFormData"> + <uni-forms-item label="鍞墠瑙勫垝鍗曞悕绉�" required name="name"> + <uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О" /> + </uni-forms-item> + <uni-forms-item label="璺熻釜椤圭洰" required name="orderId" > + <view @click="autoLoad('order','')"> + <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨璺熻釜椤圭洰" + v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="涓氬姟鍛�" required name="userId"> + <view @click="autoLoad('user','')"> + <uni-combox :candidates="users" placeholder="璇烽�夋嫨涓氬姟鍛�" + v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox> + </view> + </uni-forms-item> + + <uni-forms-item label="涓氬姟鍛樿仈绯绘柟寮�" required name="userXmlSelPhone"> + <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="璇疯緭鍏ヤ笟鍔″憳鑱旂郴鏂瑰紡" /> + </uni-forms-item> + <uni-forms-item label="鎵�闇�" name="planNeed"> + <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" /> + </uni-forms-item> + <uni-forms-item label="鐢宠鏃ユ湡" required name="appleTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" /> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鍚嶇О" required 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="涓氬姟绫诲瀷" required name="planType"> + <uni-easyinput disabled placeholder="璇疯緭鍏ヤ笟鍔$被鍨�" v-model="baseFormData.planType"></uni-easyinput> + </uni-forms-item> + <uni-forms-item label="绔嬮」" name="beItem"> + <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" /> + </uni-forms-item> + + + + <uni-forms-item label="瑙勫垝鍛�" name="planner$"> + <uni-easyinput v-model="baseFormData.planner$" placeholder="璇疯緭鍏ヨ鍒掑憳" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规" name="change"> + <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规鍘熷洜" name="changeReason"> + <uni-easyinput v-model="baseFormData.changeReason" placeholder="璇疯緭鍏ユ洿鏀规柟妗堝師鍥�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸缁勯暱濂栭噾" name="planLeaderBonus"> + <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="璇疯緭鍏ヨ鏍肩粍闀垮閲�" /> + </uni-forms-item> + <uni-forms-item label="瀹屾垚鏃堕棿" name="finishTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.datetimesingle"/> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="鏇存敼娆℃暟" name="changeTime"> + <uni-easyinput v-model="baseFormData.changeTime" placeholder="璇疯緭鍏ユ洿鏀规鏁�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸濂栭噾" name="planBonus"> + <uni-easyinput v-model="baseFormData.planBonus" placeholder="璇疯緭鍏ヨ鏍煎閲�" /> + </uni-forms-item> + </uni-forms> + <button type="primary" @click="addCstmr()">娣诲姞</button> + </view> + </view> +</template> + +<script> + import test from '../../../static/js/citys-data.js' + export default { + data() { + return { + orderIds: [], + orderList: [], + users: [], + userList: [], + cstmrs: [], + cstmrList: [], + baseFormData: { + name: '', + orderId: '', + userId: '', + appleTime: '', + cstmrId: '', + planType: '绔嬩綋搴擄紙璐ф灦锛�', + select_2: '', + changeReason: '', + changeTime: '', + planBonus: '', + planLeaderBonus: '' + }, + rules: { + name: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О', + }] + }, + orderId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨璺熻釜椤圭洰', + }] + }, + userId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨涓氬姟鍛�', + }] + }, + userXmlSelPhone: { + rules: [{ + required: true, + errorMessage: '璇峰~鍐欎笟鍔″憳鑱旂郴鏂瑰紡', + }] + }, + appleTime: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨鐢宠鏃ユ湡', + }] + }, + cstmrId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨瀹㈡埛鍚嶇О', + }] + }, + planType: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ笟鍔$被鍨�', + }] + }, + }, + changeValue: [ + { + text: '鏄�', + value: '1' + }, + { + text: '鍚�', + value: '0' + } + ], + // 鍗曢�夋暟鎹簮 + beItem$: [{ + text: '鏄�', + value: '1' + }, { + text: '鍚︼紙闇�鍞墠鎶�鏈窡杩涢」鐩紝涓庡鎴风洿鎺ユ矡閫氱瓑锛�', + value: '0' + }], + citysData: [], + citysDataTemp: '', + planNeeds: [ + { + text: '绯荤粺 鏂规瑙勫垝璁捐', + value: 1 + }, + { + text: '鎻愪緵閫夋潗娓呭崟', + value: 2 + }, + { + text: '绔嬩綋搴撹璁℃柟妗�', + value: 3 + } + ] + + } + }, + onReady() { + // 闇�瑕佸湪onReady涓缃鍒� + this.$refs.baseForm.setRules(this.rules) + }, + onShow() { + // 鑾峰彇鐪佸競鍖� + this.citysData = test.citysData + }, + methods: { + bindPickerChange: function(e) { + this.cstmrTypeIndex = e.detail.value + this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id + }, + areaChange(e) { + this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value + }, + autoLoad(type,condition) { + let that = this + that.orderIds = [] + that.users = [] + that.cstmrs = [] + var a = that.baseUrl + '/' + type + 'Query/auth' + uni.request({ + url: that.baseUrl + '/' + type + 'Query' +'/auth', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + var res = result.data + if (res.code === 200) { + var element; + if (type == 'order') { + for(element of res.data) { + that.orderIds.push(element.name) + that.orderList.push(element) + } + return + } + if (type == 'user') { + for(element of res.data) { + that.users.push(element.value) + that.userList.push(element) + } + return + } + if (type == 'cstmr') { + for(element of res.data) { + that.cstmrs.push(element.value) + that.cstmrList.push(element) + } + return + } + } + } + }) + }, + getOrderId() { + let that = this + uni.request({ + url: that.baseUrl + '/order/all/get/kv', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + } + }) + }, + // 娣诲姞鐢ㄦ埛 + addCstmr() { + let that = this + var element + + for (element of that.cstmrList) { + if(element.value == that.baseFormData.cstmrId) { + that.baseFormData.cstmrId = element.id + } + } + for (element of that.orderList) { + if(element.name == that.baseFormData.orderId) { + that.baseFormData.orderId = element.id + } + } + for (element of that.userList) { + if(element.value == that.baseFormData.userId) { + that.baseFormData.userId = element.id + } + } + that.baseFormData.planType = 5 + var temp + for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) { + if (i == 0) { + temp = that.baseFormData.planNeed[i] + } else { + temp = temp + '-' + that.baseFormData.planNeed[i] + } + + } + that.baseFormData.planNeed = temp + this.$refs.baseForm.validate().then(res=>{ + for (let k in res) { + if (res[k] == undefined) { + res[k] = '' + } + } + uni.request({ + url: that.baseUrl + '/plan/add/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type':'application/x-www-form-urlencoded', + }, + data: res, + method: 'POST', + success(result) { + var res = result.data + if (res.code === 200) { + uni.navigateBack() + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }) + }).catch(err =>{ + }) + } + } + + } +</script> + +<style> + .container { + min-height: 50rpx; + padding: 15px; + background-color: #fff; + /* background-color: aqua; */ + } +</style> \ No newline at end of file diff --git a/pages/business/plan/addPlan5.vue b/pages/business/plan/addPlan5.vue new file mode 100644 index 0000000..ff1dc03 --- /dev/null +++ b/pages/business/plan/addPlan5.vue @@ -0,0 +1,322 @@ +<template> + <view> + <view class="container"> + <uni-forms ref="baseForm" :modelValue="baseFormData"> + <uni-forms-item label="鍞墠瑙勫垝鍗曞悕绉�" required name="name"> + <uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О" /> + </uni-forms-item> + <uni-forms-item label="璺熻釜椤圭洰" required name="orderId" > + <view @click="autoLoad('order','')"> + <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨璺熻釜椤圭洰" + v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="涓氬姟鍛�" required name="userId"> + <view @click="autoLoad('user','')"> + <uni-combox :candidates="users" placeholder="璇烽�夋嫨涓氬姟鍛�" + v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox> + </view> + </uni-forms-item> + + <uni-forms-item label="涓氬姟鍛樿仈绯绘柟寮�" required name="userXmlSelPhone"> + <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="璇疯緭鍏ヤ笟鍔″憳鑱旂郴鏂瑰紡" /> + </uni-forms-item> + <uni-forms-item label="鎵�闇�" name="planNeed"> + <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" /> + </uni-forms-item> + <uni-forms-item label="鐢宠鏃ユ湡" required name="appleTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" /> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鍚嶇О" required 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="涓氬姟绫诲瀷" required name="planType"> + <uni-easyinput disabled placeholder="璇疯緭鍏ヤ笟鍔$被鍨�" v-model="baseFormData.planType"></uni-easyinput> + </uni-forms-item> + <uni-forms-item label="绔嬮」" name="beItem"> + <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" /> + </uni-forms-item> + + + + <uni-forms-item label="瑙勫垝鍛�" name="planner$"> + <uni-easyinput v-model="baseFormData.planner$" placeholder="璇疯緭鍏ヨ鍒掑憳" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规" name="change"> + <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规鍘熷洜" name="changeReason"> + <uni-easyinput v-model="baseFormData.changeReason" placeholder="璇疯緭鍏ユ洿鏀规柟妗堝師鍥�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸缁勯暱濂栭噾" name="planLeaderBonus"> + <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="璇疯緭鍏ヨ鏍肩粍闀垮閲�" /> + </uni-forms-item> + <uni-forms-item label="瀹屾垚鏃堕棿" name="finishTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.datetimesingle"/> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="鏇存敼娆℃暟" name="changeTime"> + <uni-easyinput v-model="baseFormData.changeTime" placeholder="璇疯緭鍏ユ洿鏀规鏁�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸濂栭噾" name="planBonus"> + <uni-easyinput v-model="baseFormData.planBonus" placeholder="璇疯緭鍏ヨ鏍煎閲�" /> + </uni-forms-item> + </uni-forms> + <button type="primary" @click="addCstmr()">娣诲姞</button> + </view> + </view> +</template> + +<script> + import test from '../../../static/js/citys-data.js' + export default { + data() { + return { + orderIds: [], + orderList: [], + users: [], + userList: [], + cstmrs: [], + cstmrList: [], + baseFormData: { + name: '', + orderId: '', + userId: '', + appleTime: '', + cstmrId: '', + planType: '绔嬩綋搴擄紙璐ф灦锛�', + select_2: '', + changeReason: '', + changeTime: '', + planBonus: '', + planLeaderBonus: '' + }, + rules: { + name: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О', + }] + }, + orderId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨璺熻釜椤圭洰', + }] + }, + userId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨涓氬姟鍛�', + }] + }, + userXmlSelPhone: { + rules: [{ + required: true, + errorMessage: '璇峰~鍐欎笟鍔″憳鑱旂郴鏂瑰紡', + }] + }, + appleTime: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨鐢宠鏃ユ湡', + }] + }, + cstmrId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨瀹㈡埛鍚嶇О', + }] + }, + planType: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ笟鍔$被鍨�', + }] + }, + }, + changeValue: [ + { + text: '鏄�', + value: '1' + }, + { + text: '鍚�', + value: '0' + } + ], + // 鍗曢�夋暟鎹簮 + beItem$: [{ + text: '鏄�', + value: '1' + }, { + text: '鍚︼紙闇�鍞墠鎶�鏈窡杩涢」鐩紝涓庡鎴风洿鎺ユ矡閫氱瓑锛�', + value: '0' + }], + citysData: [], + citysDataTemp: '', + planNeeds: [ + { + text: '绯荤粺 鏂规瑙勫垝璁捐', + value: 1 + }, + { + text: '鎻愪緵閫夋潗娓呭崟', + value: 2 + }, + { + text: '绔嬩綋搴撹璁℃柟妗�', + value: 3 + } + ] + + } + }, + onReady() { + // 闇�瑕佸湪onReady涓缃鍒� + this.$refs.baseForm.setRules(this.rules) + }, + onShow() { + // 鑾峰彇鐪佸競鍖� + this.citysData = test.citysData + }, + methods: { + bindPickerChange: function(e) { + this.cstmrTypeIndex = e.detail.value + this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id + }, + areaChange(e) { + this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value + }, + autoLoad(type,condition) { + let that = this + that.orderIds = [] + that.users = [] + that.cstmrs = [] + var a = that.baseUrl + '/' + type + 'Query/auth' + uni.request({ + url: that.baseUrl + '/' + type + 'Query' +'/auth', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + var res = result.data + if (res.code === 200) { + var element; + if (type == 'order') { + for(element of res.data) { + that.orderIds.push(element.name) + that.orderList.push(element) + } + return + } + if (type == 'user') { + for(element of res.data) { + that.users.push(element.value) + that.userList.push(element) + } + return + } + if (type == 'cstmr') { + for(element of res.data) { + that.cstmrs.push(element.value) + that.cstmrList.push(element) + } + return + } + } + } + }) + }, + getOrderId() { + let that = this + uni.request({ + url: that.baseUrl + '/order/all/get/kv', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + } + }) + }, + // 娣诲姞鐢ㄦ埛 + addCstmr() { + let that = this + var element + + for (element of that.cstmrList) { + if(element.value == that.baseFormData.cstmrId) { + that.baseFormData.cstmrId = element.id + } + } + for (element of that.orderList) { + if(element.name == that.baseFormData.orderId) { + that.baseFormData.orderId = element.id + } + } + for (element of that.userList) { + if(element.value == that.baseFormData.userId) { + that.baseFormData.userId = element.id + } + } + that.baseFormData.planType = 5 + var temp + for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) { + if (i == 0) { + temp = that.baseFormData.planNeed[i] + } else { + temp = temp + '-' + that.baseFormData.planNeed[i] + } + + } + that.baseFormData.planNeed = temp + this.$refs.baseForm.validate().then(res=>{ + for (let k in res) { + if (res[k] == undefined) { + res[k] = '' + } + } + uni.request({ + url: that.baseUrl + '/plan/add/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type':'application/x-www-form-urlencoded', + }, + data: res, + method: 'POST', + success(result) { + var res = result.data + if (res.code === 200) { + uni.navigateBack() + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }) + }).catch(err =>{ + }) + } + } + + } +</script> + +<style> + .container { + min-height: 50rpx; + padding: 15px; + background-color: #fff; + /* background-color: aqua; */ + } +</style> \ No newline at end of file diff --git a/pages/business/plan/addPlan6.vue b/pages/business/plan/addPlan6.vue new file mode 100644 index 0000000..ff1dc03 --- /dev/null +++ b/pages/business/plan/addPlan6.vue @@ -0,0 +1,322 @@ +<template> + <view> + <view class="container"> + <uni-forms ref="baseForm" :modelValue="baseFormData"> + <uni-forms-item label="鍞墠瑙勫垝鍗曞悕绉�" required name="name"> + <uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О" /> + </uni-forms-item> + <uni-forms-item label="璺熻釜椤圭洰" required name="orderId" > + <view @click="autoLoad('order','')"> + <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨璺熻釜椤圭洰" + v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox> + </view> + </uni-forms-item> + <uni-forms-item label="涓氬姟鍛�" required name="userId"> + <view @click="autoLoad('user','')"> + <uni-combox :candidates="users" placeholder="璇烽�夋嫨涓氬姟鍛�" + v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox> + </view> + </uni-forms-item> + + <uni-forms-item label="涓氬姟鍛樿仈绯绘柟寮�" required name="userXmlSelPhone"> + <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="璇疯緭鍏ヤ笟鍔″憳鑱旂郴鏂瑰紡" /> + </uni-forms-item> + <uni-forms-item label="鎵�闇�" name="planNeed"> + <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" /> + </uni-forms-item> + <uni-forms-item label="鐢宠鏃ユ湡" required name="appleTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" /> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="瀹㈡埛鍚嶇О" required 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="涓氬姟绫诲瀷" required name="planType"> + <uni-easyinput disabled placeholder="璇疯緭鍏ヤ笟鍔$被鍨�" v-model="baseFormData.planType"></uni-easyinput> + </uni-forms-item> + <uni-forms-item label="绔嬮」" name="beItem"> + <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" /> + </uni-forms-item> + + + + <uni-forms-item label="瑙勫垝鍛�" name="planner$"> + <uni-easyinput v-model="baseFormData.planner$" placeholder="璇疯緭鍏ヨ鍒掑憳" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规" name="change"> + <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" /> + </uni-forms-item> + <uni-forms-item label="鏇存敼鏂规鍘熷洜" name="changeReason"> + <uni-easyinput v-model="baseFormData.changeReason" placeholder="璇疯緭鍏ユ洿鏀规柟妗堝師鍥�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸缁勯暱濂栭噾" name="planLeaderBonus"> + <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="璇疯緭鍏ヨ鏍肩粍闀垮閲�" /> + </uni-forms-item> + <uni-forms-item label="瀹屾垚鏃堕棿" name="finishTime"> + <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.datetimesingle"/> + </uni-data-picker> + </uni-forms-item> + <uni-forms-item label="鏇存敼娆℃暟" name="changeTime"> + <uni-easyinput v-model="baseFormData.changeTime" placeholder="璇疯緭鍏ユ洿鏀规鏁�" /> + </uni-forms-item> + <uni-forms-item label="瑙勬牸濂栭噾" name="planBonus"> + <uni-easyinput v-model="baseFormData.planBonus" placeholder="璇疯緭鍏ヨ鏍煎閲�" /> + </uni-forms-item> + </uni-forms> + <button type="primary" @click="addCstmr()">娣诲姞</button> + </view> + </view> +</template> + +<script> + import test from '../../../static/js/citys-data.js' + export default { + data() { + return { + orderIds: [], + orderList: [], + users: [], + userList: [], + cstmrs: [], + cstmrList: [], + baseFormData: { + name: '', + orderId: '', + userId: '', + appleTime: '', + cstmrId: '', + planType: '绔嬩綋搴擄紙璐ф灦锛�', + select_2: '', + changeReason: '', + changeTime: '', + planBonus: '', + planLeaderBonus: '' + }, + rules: { + name: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ュ敭鍓嶈鍒掑崟鍚嶇О', + }] + }, + orderId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨璺熻釜椤圭洰', + }] + }, + userId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨涓氬姟鍛�', + }] + }, + userXmlSelPhone: { + rules: [{ + required: true, + errorMessage: '璇峰~鍐欎笟鍔″憳鑱旂郴鏂瑰紡', + }] + }, + appleTime: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨鐢宠鏃ユ湡', + }] + }, + cstmrId: { + rules: [{ + required: true, + errorMessage: '璇烽�夋嫨瀹㈡埛鍚嶇О', + }] + }, + planType: { + rules: [{ + required: true, + errorMessage: '璇疯緭鍏ヤ笟鍔$被鍨�', + }] + }, + }, + changeValue: [ + { + text: '鏄�', + value: '1' + }, + { + text: '鍚�', + value: '0' + } + ], + // 鍗曢�夋暟鎹簮 + beItem$: [{ + text: '鏄�', + value: '1' + }, { + text: '鍚︼紙闇�鍞墠鎶�鏈窡杩涢」鐩紝涓庡鎴风洿鎺ユ矡閫氱瓑锛�', + value: '0' + }], + citysData: [], + citysDataTemp: '', + planNeeds: [ + { + text: '绯荤粺 鏂规瑙勫垝璁捐', + value: 1 + }, + { + text: '鎻愪緵閫夋潗娓呭崟', + value: 2 + }, + { + text: '绔嬩綋搴撹璁℃柟妗�', + value: 3 + } + ] + + } + }, + onReady() { + // 闇�瑕佸湪onReady涓缃鍒� + this.$refs.baseForm.setRules(this.rules) + }, + onShow() { + // 鑾峰彇鐪佸競鍖� + this.citysData = test.citysData + }, + methods: { + bindPickerChange: function(e) { + this.cstmrTypeIndex = e.detail.value + this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id + }, + areaChange(e) { + this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value + }, + autoLoad(type,condition) { + let that = this + that.orderIds = [] + that.users = [] + that.cstmrs = [] + var a = that.baseUrl + '/' + type + 'Query/auth' + uni.request({ + url: that.baseUrl + '/' + type + 'Query' +'/auth', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + var res = result.data + if (res.code === 200) { + var element; + if (type == 'order') { + for(element of res.data) { + that.orderIds.push(element.name) + that.orderList.push(element) + } + return + } + if (type == 'user') { + for(element of res.data) { + that.users.push(element.value) + that.userList.push(element) + } + return + } + if (type == 'cstmr') { + for(element of res.data) { + that.cstmrs.push(element.value) + that.cstmrList.push(element) + } + return + } + } + } + }) + }, + getOrderId() { + let that = this + uni.request({ + url: that.baseUrl + '/order/all/get/kv', + header:{'token':uni.getStorageSync('token')}, + data: {condition:condition}, + method: 'GET', + success(result) { + } + }) + }, + // 娣诲姞鐢ㄦ埛 + addCstmr() { + let that = this + var element + + for (element of that.cstmrList) { + if(element.value == that.baseFormData.cstmrId) { + that.baseFormData.cstmrId = element.id + } + } + for (element of that.orderList) { + if(element.name == that.baseFormData.orderId) { + that.baseFormData.orderId = element.id + } + } + for (element of that.userList) { + if(element.value == that.baseFormData.userId) { + that.baseFormData.userId = element.id + } + } + that.baseFormData.planType = 5 + var temp + for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) { + if (i == 0) { + temp = that.baseFormData.planNeed[i] + } else { + temp = temp + '-' + that.baseFormData.planNeed[i] + } + + } + that.baseFormData.planNeed = temp + this.$refs.baseForm.validate().then(res=>{ + for (let k in res) { + if (res[k] == undefined) { + res[k] = '' + } + } + uni.request({ + url: that.baseUrl + '/plan/add/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type':'application/x-www-form-urlencoded', + }, + data: res, + method: 'POST', + success(result) { + var res = result.data + if (res.code === 200) { + uni.navigateBack() + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }) + }).catch(err =>{ + }) + } + } + + } +</script> + +<style> + .container { + min-height: 50rpx; + padding: 15px; + background-color: #fff; + /* background-color: aqua; */ + } +</style> \ No newline at end of file diff --git a/pages/business/plan/plan.vue b/pages/business/plan/plan.vue new file mode 100644 index 0000000..703dd23 --- /dev/null +++ b/pages/business/plan/plan.vue @@ -0,0 +1,274 @@ +<template> + <view> + <!-- 鎼滅储妗� --> + <view class="search-bg"> + <uni-search-bar placeholder="瀹㈡埛浠e彿/鍚嶇О" bgColor="#f4f4f4" @confirm="search" /> + </view> + <view> + <!-- 瀹㈡埛鍒楄〃 --> + <view class="c-list" @click="getDetails(item.id)" v-for="(item,index) in csmtrList" :key="index"> + <view class="titles"> + <y-title :title="item.name"></y-title> + </view> + <view style="display: grid;grid-template-columns: 1fr 3fr;"> + <view class="list-item1">瀹㈡埛浠e彿</view><view class="list-item2">{{item.uuid}}</view> + <view class="list-item1">璇︾粏鍦板潃</view><view class="list-item2">{{item.addr}}</view> + <view class="list-item1">鐢佃瘽</view><view class="list-item2">{{item.tel}}</view> + <view class="list-item1">澶囨敞</view><view class="list-item2">{{item.remarks ? item.remarks : '--'}}</view> + <view class="list-item1">瀹㈡埛绫诲埆</view><view class="list-item2">{{item.cstmrType$}}</view> + <view class="list-item1">鍒涘缓浜�</view><view class="list-item2">{{item.createBy$}}</view> + <view class="list-item1">鍒涘缓鏃堕棿</view><view class="list-item2">{{item.createTime$}}</view> + </view> + </view> + </view> + <uni-load-more :status="status" :icon-size="16" :content-text="contentText" /> + <view> + <!-- 鏅�氬脊绐� --> + <uni-popup ref="popup" background-color="#fff"> + <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"> + <view> + <button v-for="item in planType" class="button btnn" type="primary" @click="add(item.value)">{{item.name}}</button> + </view> + </view> + </uni-popup> + </view> + </view> +</template> + +<script> + export default { + data() { + return { + csmtrList: [], + last_id: '', + reload: false, + status: 'more', + curr:2, + contentText: { + contentdown: '涓婃媺鍔犺浇鏇村', + contentrefresh: '鍔犺浇涓�', + contentnomore: '娌℃湁鏇村' + }, + type: 'center', + planType :[ + { + name:'绔嬩綋搴擄紙璐ф灦锛�', + value: 1 + }, + { + name:'绔嬩綋搴擄紙闆嗘垚锛�', + value: 2 + }, + { + name:'鍥涘悜绌挎搴�/涓ゅ悜绌挎搴�', + value: 3 + }, + { + name:'闃佹ゼ璐ф灦/閽㈠钩鍙�', + value: 4 + }, + { + name:'鍛ㄨ浆瀹瑰櫒', + value: 5 + }, + { + name:'骞冲簱', + value: 6 + }, + ] + } + }, + // 鏂板缓鎸夐挳浜嬩欢 + onNavigationBarButtonTap(e) { + this.toggle('right') + // uni.navigateTo({ + // url:'/pages/business/cstmr/addCsmtr', + // }) + + }, + onLoad() { + + }, + onShow() { + setTimeout(()=> { + this.getCsmtr1() + },500) + }, + onReachBottom() { + this.status = 'more'; + this.getCsmtr() + }, + methods: { + add(val) { + switch (val) { + case 1: + uni.navigateTo({ + url:'/pages/business/plan/addPlan', + }) + break; + case 2: + uni.navigateTo({ + url:'/pages/business/plan/addPlan2', + }) + break; + default: + console.log(val); + break; + } + }, + toggle(type) { + this.type = type + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴�� + this.$refs.popup.open(type) + }, + getCsmtr1(e) { + let that = this + that.csmtrList = [] + uni.request({ + url: that.baseUrl + '/plan/page/auth', + header: {'token' : uni.getStorageSync('token'),}, + data: {curr:1,limit:4,deptId:19}, + method:'GET', + success(result) { + if (result.statusCode === 404) { + uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'}) + return + } + var res = result.data + if (res.code === 200) { + let list = res.data.records + that.csmtrList = that.reload ? list : that.csmtrList.concat(list); + if (res.data.records.length == 0) { + that.status = 'noMore' + } + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + }, + fail(result) { + uni.showToast({title: '璇锋眰澶辫触'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + }, + }) + }, + getCsmtr() { + let that = this + uni.request({ + url: that.baseUrl + '/cstmr/page/auth', + header: {'token' : uni.getStorageSync('token'),}, + data: {curr:that.curr,limit:4}, + method:'GET', + success(result) { + if (result.statusCode === 404) { + uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'}) + return + } + var res = result.data + if (res.code === 200) { + let list = res.data.records + that.csmtrList = that.reload ? list : that.csmtrList.concat(list); + that.curr = that.curr + 1 + if (res.data.records.length == 0) { + that.status = 'noMore' + } + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + }, + fail(result) { + uni.showToast({title: '璇锋眰澶辫触'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + }, + }) + }, + getDetails(id) { + uni.navigateTo({ + url: '/pages/business/cstmr/cstmrDetails?id=' + id + }) + }, + // --- + search() { + + } + } + } +</script> + +<style> + .btnn { + margin-top: 10px; + } + .btnn:first-child { + margin-top: 20px; + } + .popup-content { + display: flex; + align-items: center; + justify-content: center; + background-color: #fff; + } + .popup-height { + display: height; + width: 300px; + } + .c-list { + width: 96%; + min-height: 100rpx; + background-color: #fff; + border-radius: 10rpx; + margin: 20rpx 2% 0 2%; + display: flex; + flex-direction: column; + font-size: 24rpx; + } + /* 鐖秜iew 鎹� scroll-view */ + .c-list:last-child { + margin-bottom: 20px; + } + .list-item1 { + + height: 45rpx; + line-height: 45rpx; + color: #909399; + text-indent: 30rpx; + } + .list-item2 { + height: 45rpx; + line-height: 45rpx; + color: black; + } + .titles { + padding-left: 10rpx; + text-indent: 5rpx; + margin-top: 10rpx; + } + /* .title { + height: 60rpx; + line-height: 70rpx; + font-size: 28rpx; + font-weight: 900; + color: #303133; + } */ +</style> \ No newline at end of file diff --git a/pages/business/plan/planDetails.vue b/pages/business/plan/planDetails.vue new file mode 100644 index 0000000..02409e3 --- /dev/null +++ b/pages/business/plan/planDetails.vue @@ -0,0 +1,8 @@ +<template> +</template> + +<script> +</script> + +<style> +</style> \ No newline at end of file -- Gitblit v1.9.1