xiaohaizhao 5 mēneši atpakaļ
vecāks
revīzija
93b358f4b3

+ 6 - 1
pages/generalServices/detail.vue

@@ -177,7 +177,7 @@
     <view class="main" v-if="time && workDetail.nodes.length">
     <view class="main" v-if="time && workDetail.nodes.length">
         <Nodes ref="Nodes" status="已完结" :nodes="workDetail.nodes" />
         <Nodes ref="Nodes" status="已完结" :nodes="workDetail.nodes" />
     </view>
     </view>
-    <handle ref="Handle" :sa_serviceorderid="sa_serviceorderid" @callBack="callBack" />
+    <handle ref="Handle" :sa_serviceorderid="sa_serviceorderid" sa_workorderid @callBack="callBack" />
     <view style="height: 50px;" />
     <view style="height: 50px;" />
 </template>
 </template>
 
 
@@ -264,8 +264,13 @@ function openAllot() {
 }
 }
 
 
 function changeUser() {
 function changeUser() {
+    Handle.value.sa_workorderid = workDetail.value.sa_workorderid
     if (workDetail.value.team.length) {
     if (workDetail.value.team.length) {
         Handle.value.activeUser2 = workDetail.value.team[0]
         Handle.value.activeUser2 = workDetail.value.team[0]
+    } else {
+        Handle.value.activeUser2 = {
+            userid: null
+        }
     }
     }
     openAllot()
     openAllot()
 }
 }

+ 22 - 10
pages/generalServices/modules/handle.vue

@@ -122,7 +122,8 @@ let allot = ref(false),
     servicetype = '',
     servicetype = '',
     activeUser2 = ref({
     activeUser2 = ref({
         userid: null
         userid: null
-    });
+    }),
+    sa_workorderid = ref(0);
 
 
 function getModals() {
 function getModals() {
     $Http.basic({ "id": "20230206155803", "content": {} }).then(res => {
     $Http.basic({ "id": "20230206155803", "content": {} }).then(res => {
@@ -139,25 +140,36 @@ function confirmAllot() {
         content: text,
         content: text,
         complete: ({ confirm }) => {
         complete: ({ confirm }) => {
             if (!confirm) return uModal2.value.loading = false;
             if (!confirm) return uModal2.value.loading = false;
-            $Http.basic({
-                "id": "20230207091003",
+            let params = sa_workorderid.value ? {
+                "id": "2025101710510903",
                 "content": {
                 "content": {
-                    sa_serviceorderid,
-                    "type": servicetype,
-                    "sa_workorder_templateid": modals.value.find(item => item.type == servicetype)?.sa_workorder_templateid || '',
+                    "ismanage": 1,
+                    "sa_workorderid": sa_workorderid.value,
                     "projectlearders": activeUser.value.userid == null ? [] : [activeUser.value.userid]
                     "projectlearders": activeUser.value.userid == null ? [] : [activeUser.value.userid]
                 }
                 }
             }
             }
+                : {
+                    "id": "20230207091003",
+                    "content": {
+                        sa_serviceorderid,
+                        "type": servicetype,
+                        "sa_workorder_templateid": modals.value.find(item => item.type == servicetype)?.sa_workorder_templateid || '',
+                        "projectlearders": activeUser.value.userid == null ? [] : [activeUser.value.userid]
+                    }
+                }
+            $Http.basic(params
             ).then(res => {
             ).then(res => {
                 console.log("工单分配", res)
                 console.log("工单分配", res)
                 uni.showToast({ title: res.code !== 1 ? res.msg : '工单分配成功', icon: 'none' });
                 uni.showToast({ title: res.code !== 1 ? res.msg : '工单分配成功', icon: 'none' });
                 if (res.code !== 1) return uModal2.value.loading = false;
                 if (res.code !== 1) return uModal2.value.loading = false;
                 allot.value = false;
                 allot.value = false;
+                activeUser2.value = null;
                 emit('callBack', {
                 emit('callBack', {
                     status: 'alloted',
                     status: 'alloted',
-                    id: res.data,
+                    id: res.data == '成功' ? sa_workorderid.value : res.data,
                     isMy: activeUser.value.userid == uni.getStorageSync('userMsg').userid ? true : false
                     isMy: activeUser.value.userid == uni.getStorageSync('userMsg').userid ? true : false
                 });
                 });
+                sa_workorderid.value = null;
             })
             })
         },
         },
     })
     })
@@ -167,11 +179,10 @@ function openAllotfunc(id, type) {
     servicetype = type;
     servicetype = type;
     sa_serviceorderid = id;
     sa_serviceorderid = id;
     activeUser.value = activeUser2.value;
     activeUser.value = activeUser2.value;
-    console.log("activeUser.value", activeUser.value)
     users.value = [];
     users.value = [];
     $Http.basic({
     $Http.basic({
         "id": 20230213143003,
         "id": 20230213143003,
-        "content": { "pageNumber": 1, "pageSize": 20, "nocache": true, "where": { "isleader": 0 } }
+        "content": { "pageNumber": 1, "pageSize": 999, "nocache": true, "where": { "isleader": 0 } }
     }
     }
     ).then(res => {
     ).then(res => {
         console.log("服务人员", res)
         console.log("服务人员", res)
@@ -195,7 +206,8 @@ function clickRadio(item) {
 defineExpose({
 defineExpose({
     openRefusefunc,
     openRefusefunc,
     openAllotfunc,
     openAllotfunc,
-    activeUser2
+    activeUser2,
+    sa_workorderid
 });
 });
 </script>
 </script>
 
 

+ 44 - 34
pages/login/login.vue

@@ -233,48 +233,58 @@ function logIn() {
     })
     })
 }
 }
 
 
-function accLogIn() {
+async function accLogIn() {
     if (isAgreement.value == false) return showModal.value = true;
     if (isAgreement.value == false) return showModal.value = true;
     loading.value = true;
     loading.value = true;
-    $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wechatsaletool" }).then(res => {
-        if (res.code == 1) {
-            if (res.remindchangepassword) return uni.showModal({
-                title: '提示',
-                content: '当前密码为系统初始化密码,请修改后重新登录',
-                showCancel: false,
-                confirmText: "前去修改",
-                complete: () => {
-                    uni.removeStorageSync('accountno');
-                    uni.setStorageSync('accountno', accountno.value);
-                    uni.navigateTo({
-                        url: '/pages/index/changePassword?token=' + res.account_list[0].token
-                    })
-                    $Http.claerPassword = function () {
-                        phonenumber.value = '';
-                    }.bind(this);
-                    loading.value = false;
-                }
-            })
-            if (res.account_list.length == 1) {
-                handleLogin1(res.account_list[0]);
-            } else {
-                account_list = reactive([res.account_list]);
+
+    let isRelease = uni.getAccountInfoSync().miniProgram.envVersion == 'release';
+    const s = isRelease ? await $Http.OldLogin(`?username=${accountno.value}&password=${encodeURIComponent(password1.value)}`) : {
+        success: false
+    };
+    console.log("单点登录", s)
+    let res = s.success == true ? await $Http.SSO({
+        "accountno": s.data.userinfo.username,
+        "password": s.data.cookie.split("=")[1],
+        "imagecaptcha": imagecaptcha.value || '',
+        "systemclient": "wechatsaletool"
+    }) : await $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wechatsaletool" });
+
+    if (res.code == 1) {
+        if (res.remindchangepassword) return uni.showModal({
+            title: '提示',
+            content: '当前密码为系统初始化密码,请修改后重新登录',
+            showCancel: false,
+            confirmText: "前去修改",
+            complete: () => {
+                uni.removeStorageSync('accountno');
+                uni.setStorageSync('accountno', accountno.value);
+                uni.navigateTo({
+                    url: '/pages/index/changePassword?token=' + res.account_list[0].token
+                })
+                $Http.claerPassword = function () {
+                    phonenumber.value = '';
+                }.bind(this);
+                loading.value = false;
             }
             }
+        })
+        if (res.account_list.length == 1) {
+            handleLogin1(res.account_list[0]);
         } else {
         } else {
-            loading.value = false;
-            imagecaptcha.value = '';
-            changeTimestamp();
-            uni.showToast({
-                title: res.msg,
-                icon: 'none',
-            });
+            account_list = reactive([res.account_list]);
         }
         }
-    })
+    } else {
+        loading.value = false;
+        imagecaptcha.value = '';
+        changeTimestamp();
+        uni.showToast({
+            title: res.msg,
+            icon: 'none',
+        });
+    }
 }
 }
 
 
 function onCancel() {
 function onCancel() {
     account_list = reactive([]);
     account_list = reactive([]);
-
 }
 }
 function onConfirm(e) {
 function onConfirm(e) {
     handleLogin(e.value[0]);
     handleLogin(e.value[0]);
@@ -365,7 +375,7 @@ function checkTheAgreement() {
         title: "加载中...",
         title: "加载中...",
     });
     });
     uni.downloadFile({
     uni.downloadFile({
-        url: "https://yossys22170.obs.cn-east-2.myhuaweicloud.com:443/202309261695715892017B6ef5bd76.docx",
+        url: 'https://crm.meida.com:16691/yos/rest/tool/attachment/download/YOSSYS/202512021764653461493B1119e706.docx',
         success: (res) => {
         success: (res) => {
             uni.openDocument({
             uni.openDocument({
                 filePath: res.tempFilePath,
                 filePath: res.tempFilePath,

+ 18 - 5
utils/Http.js

@@ -55,7 +55,7 @@ class HTTP {
     }
     }
 
 
     request({
     request({
-        url,
+        url = "",
         data = {},
         data = {},
         method = "POST",
         method = "POST",
         header = {
         header = {
@@ -64,7 +64,7 @@ class HTTP {
             // 添加Cookie字段
             // 添加Cookie字段
             "Cookie": `JSESSIONID=${this.jsessionid}`
             "Cookie": `JSESSIONID=${this.jsessionid}`
         },
         },
-        showLoading = ''
+        suffix = '/yos/rest'
     }) {
     }) {
         // 如果data.content.pageNumber存在但pageTotal不存在,则设置pageTotal为1
         // 如果data.content.pageNumber存在但pageTotal不存在,则设置pageTotal为1
         // 如果pageNumber大于pageTotal,则直接返回空结果
         // 如果pageNumber大于pageTotal,则直接返回空结果
@@ -75,10 +75,23 @@ class HTTP {
             }
             }
         } catch (error) { }
         } catch (error) { }
         return new Promise((resolve, reject) => {
         return new Promise((resolve, reject) => {
-            this._request(url, resolve, reject, data, method, header, showLoading);
-        });
+            this._request((suffix == '/yos/rest' ? this.baseUrl : "") + suffix + url, resolve, reject, data, method, header);
+        })
     }
     }
 
 
+    getRequest({
+        url,
+        method = "GET",
+        header = {
+            "Cookie": `JSESSIONID=${this.jsessionid}`
+        }
+    }) {
+        return new Promise((resolve, reject) => {
+            this._request(url, resolve, reject, {}, method, header);
+        })
+    }
+
+
     _request(url, resolve, reject, data, method, header, showLoading) {
     _request(url, resolve, reject, data, method, header, showLoading) {
         if (showLoading) uni.showLoading({
         if (showLoading) uni.showLoading({
             title: showLoading,
             title: showLoading,
@@ -86,7 +99,7 @@ class HTTP {
         });
         });
 
 
         uni.request({
         uni.request({
-            url: this.baseUrl + '/yos/rest' + url,
+            url,
             data: data,
             data: data,
             method: method,
             method: method,
             header: header,
             header: header,

+ 12 - 0
utils/api.js

@@ -22,6 +22,18 @@ class ApiModel extends HTTP {
             data
             data
         })
         })
     }
     }
+    /* 老CRM登录 */
+    OldLogin(data) {
+        return this.getRequest({
+            url: 'http://61.164.207.46:9082/dmsService/rest/login' + data
+        })
+    }
+    SSO(data) {
+        return this.request({
+            data,
+            suffix: 'http://61.164.207.46:9089/yos/rest/sso/crm'
+        })
+    }
     /* 验证码登录 */
     /* 验证码登录 */
     plogin(data) {
     plogin(data) {
         return this.request({
         return this.request({