新增订单时增加检查质保协议

This commit is contained in:
Rhett霍 2026-04-14 09:21:44 +08:00
parent 81179bd404
commit 26a1f81df1
3 changed files with 88 additions and 31 deletions

View File

@ -61,6 +61,16 @@ export function salemainpiAoKouList(data) {
})
}
// 点击新增的时候先调用检查质保协议
export function salemaincheckQa(data) {
return request({
url: '/bussiness/salemain/checkQa',
method: 'post',
params: data,
isEncrypt: false
})
}
// 新增
export function addsalemain(data) {
return request({

View File

@ -12,7 +12,7 @@
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" :type="passwordVisible ? 'text' : 'password'" class="input" placeholder="请输入密码" maxlength="20" />
<input v-model="loginForm.password" :type="passwordVisible ? 'text' : 'password'" class="input" placeholder="请输入密码" maxlength="20" :show-password="false" />
<view class="password-eye" @click="togglePasswordVisible">
<uni-icons :type="passwordVisible ? 'eye-slash' : 'eye'" size="20" color="#999"></uni-icons>
</view>
@ -103,14 +103,20 @@
// IDautobindID
async function pwdLogin() {
// ID
const storedWeixinId = uni.getStorageSync('weixinId')
// 使使
const currentWeixinId = weixinId.value || storedWeixinId
// proxy.$modal.msgSuccess("currentWeixinIdID" + currentWeixinId)
// ID
if (weixinId.value) {
if (currentWeixinId) {
const params = {
username: loginForm.value.username,
password: loginForm.value.password,
code: loginForm.value.code,
uuid: loginForm.value.uuid,
weixinId: weixinId.value
weixinId: currentWeixinId
}
autobind(params).then(res => {
@ -119,13 +125,18 @@
// token
if (res.data && res.data.token) {
setToken(res.data.token)
}
proxy.$modal.msgSuccess("绑定成功,登录中...")
// URL
removeWeixinIdFromUrl()
// ID
uni.removeStorageSync('weixinId')
setTimeout(() => {
loginSuccess()
}, 1500)
} else {
proxy.$modal.msgError("绑定失败,请重试")
if (captchaEnabled.value) {
getCode()
}
}
} else {
proxy.$modal.msgError(res.msg || "绑定失败,请重试")
if (captchaEnabled.value) {
@ -215,11 +226,14 @@
const id = getWeixinIdFromUrl()
if (id) {
// weixinId
// weixinId
weixinId.value = id
//
uni.removeStorageSync('weixinId')
uni.setStorageSync('weixinId', id)
autoLoginExecuted = true
// URL
// URL
removeWeixinIdFromUrl()
//
@ -236,13 +250,13 @@
// token
if (res.data && res.data.token) {
setToken(res.data.token)
}
proxy.$modal.msgSuccess("登录成功")
// ID
uni.removeStorageSync('weixinId')
//
useUserStore().getInfo().then(() => {
proxy.$tab.reLaunch('/pages/work/index')
}).catch(() => {
// 使token
if (getToken()) {
proxy.$tab.reLaunch('/pages/work/index')
} else {
@ -251,15 +265,19 @@
}
})
} else {
proxy.$modal.msgWarning(res?.msg || "请绑定账号后登录")
//
proxy.$modal.msgError("登录异常,请使用账号密码登录")
getCode()
}
}).catch(error => {
} else if (res && res.code === 500) {
proxy.$modal.msgError(res?.msg || "服务器错误")
getCode()
} else {
proxy.$modal.msgError(res?.msg || "自动登录失败")
getCode()
}
}).catch(() => {
proxy.$modal.closeLoading()
console.error('自动登录错误:', error)
proxy.$modal.msgError(error.message || "自动登录失败,请使用账号密码登录")
//
// weixinId
getCode()
})
} else {

View File

@ -182,7 +182,8 @@
<script setup>
import { onMounted, ref, nextTick } from 'vue'
import { productListWithUserId, addsalemain, getsalemaincheckAmount, listsaleBusGoodsList, salemainpiAoKouList } from '../../../../api/orderManager/index.js'
import { productListWithUserId, addsalemain, getsalemaincheckAmount, listsaleBusGoodsList,
salemainpiAoKouList, salemaincheckQa } from '../../../../api/orderManager/index.js'
import { useUserStore } from '@/store'
import MBLoading from "@/components/MB/MBLoading.vue";
const userStore = useUserStore()
@ -322,7 +323,35 @@ function getEdu() {
}
GetlistsaleBusGoodsList()
getsalemainpiAoKouList()
getQa()
})
}
//
const getQa = () => {
return new Promise((resolve) => {
const huozhuid = form.value.companyId
const paramsdata= {
companyId:huozhuid,
}
salemaincheckQa(paramsdata).then(res => {
if(res.code === 500 || res.code === 601){
proxy.$modal.msgError(res.msg)
btnloading.value = true; //
resolve(false)
}else if(res.code === 200){
btnloading.value = false; //
resolve(true)
}else{
//
btnloading.value = true; //
resolve(false)
}
}).catch(() => {
btnloading.value = true; //
resolve(false)
});
});
}
/** 显示补差列表 */