wtt
2025-09-11 bc7cca2032fbc9c359ab80080b6da2421a29d6d2
修改登录服务器选择功能,采购入库光标默认根据客户设置
2个文件已修改
102 ■■■■■ 已修改文件
pages/caigouruku/form.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/login.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/caigouruku/form.vue
@@ -378,8 +378,15 @@
                this.RoadBillMain(e.HInterID)
                this.barCodeFocus = true
            } else {
                this.getNewData()
                this.HSourceBillNoFocus = true
                this.getNewData();
                //如果服务器地址时海诚
                if(this.serverUrl=='http://122.228.39.234:7177/API/')
                {
                    this.barCodeFocus = true
                }else{
                    this.HSourceBillNoFocus = true
                }
            }
            this.getHSupList()
pages/index/login.vue
@@ -45,28 +45,17 @@
                    <view class="apibtn" @tap="changeApi=true">修改服务器地址</view> -->
                </view>
            </view>
            <!-- <hFormAlert v-if="changeApi" placeholder="请输入服务器地址" @confirm="confirm" @cancel="cancel"></hFormAlert> -->
            <uni-popup ref="popup" type="center">
                <uni-popup-dialog title="服务器设置" mode="input" @confirm="confirmHandler">
                    <view class="popup-content">
                        <picker class="pop-item" :range="arrayServerOrganization" :value="serverOrganization"
                            @change="serverOrganizationChange">
                            <view class="right" style="display: flex;align-items: center;">
                                <input type="text" disabled v-model="serverOrganization" placeholder="请选择当前组织">
                                <uni-icons type="forward" color="#808080"
                                    style="border-left: 1px solid #aaaaaa;padding: 0 8rpx;" size="18"></uni-icons>
                            </view>
                        </picker>
                        <view class="pop-item">
                            <input type="text" :value="serverUrlCache" placeholder="请输入服务器地址" />
                        </view>
                    </view>
                </uni-popup-dialog>
            </uni-popup>
            <uni-popup ref="popup" type="center">
                <uni-popup-dialog title="服务器设置" mode="input" @confirm="confirmHandler" :before-close="true" @close="close">
                    <view class="popup-content">
                        <input type="text" v-model="serverUrlName" placeholder="请输入服务器名称">
                    </view>
                </uni-popup-dialog>
            </uni-popup>
            <view class="btn" @tap="submit">登 录</view>
            <!-- <view class="btn apibtn" @tap="changeApi=true">服务器设置</view> -->
            <view class="btn apibtn" @click="openServerSettingHandler">服务器设置</view>
            <view class="btn apibtn" @click="openServerSettingHandler">服务器设置</view>
        </view>
    </view>
</template>
@@ -89,13 +78,10 @@
                CommonUtils,
                arrayDataBases: [],
                DataBases: '',
                arrayServerOrganization: ["浙江智云迈思", "温州海诚"],
                arrayServerOrganizationValues: [
                    'http://47.96.97.237/API/',
                    'http://122.228.39.234:7177/API/'
                ],
                serverOrganization: '',
                serverUrlandName:{"浙江智云迈思":'http://47.96.97.237/API/',"温州海诚光学":'http://122.228.39.234:7177/API/',"宁波惠康工业":'http://172.16.72.30:6699/API/'},
                serverUrlName:'浙江智云迈思',
                arrayOrganization: [],
                Organization: '',
                HOrgNameList: [],
@@ -103,7 +89,6 @@
                HOrgName: '',
                UserName: '', //admin    001
                PassWord: '', //123456
                changeApi: false,
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                serverUrlCache: '',
            }
@@ -118,16 +103,6 @@
                this.UserName = logindata.UserName
                this.PassWord = logindata.PassWord
            }
            this.serverUrlCache = this.serverUrl
            console.log('this.serverUrlCache: ', this.serverUrlCache);
            let index = this.arrayServerOrganizationValues.findIndex((e) => {
                return e == this.serverUrlCache
            })
            if (index == -1) {
                index = 0
            }
            this.serverOrganization = this.arrayServerOrganization[index]
            this.getOrganization()
            this.getDataBases()
        },
@@ -147,22 +122,26 @@
                    }
                })
            },
            confirm(e) {
                console.log(e)
                uni.setStorageSync('serverUrl', e)
                this.serverUrl = e
                this.changeApi = false
                this.getOrganization()
            },
            confirmHandler() {
                uni.setStorageSync('serverUrl', this.serverUrlCache)
                this.serverUrl = this.serverUrlCache
                // this.changeApi = false
                this.getOrganization()
                console.log(this.serverUrlName)
                console.log(this.serverUrlandName[this.serverUrlName])
                let url = this.serverUrlandName[this.serverUrlName];
                if(url!=undefined){
                    uni.setStorageSync('serverUrl', url)
                    this.serverUrl = url
                    this.changeApi = false
                    this.getOrganization()
                    this.$refs.popup.close()
                }else{
                    uni.showToast({
                        title: '服务器名称错误请重新输入',
                        icon: 'none',
                    })
                }
            },
            cancel() {
                this.changeApi = false
            },
            close(){
                this.$refs.popup.close()
            },
            openServerSettingHandler() {
                this.$refs.popup.open()
            },
@@ -218,12 +197,6 @@
                // console.log(e.detail.value)
                this.Organization = this.arrayOrganization[e.detail.value]
                this.HOrgName = this.HOrgNameList[e.detail.value]
            },
            serverOrganizationChange(e) {
                // console.log(e.detail.value)
                let index = e.detail.value
                this.serverOrganization = this.arrayServerOrganization[index]
                this.serverUrlCache = this.arrayServerOrganizationValues[index]
            },
            submit() {
                if (!this.Organization) {