Browse Source

Merge remote-tracking branch 'origin/master_hella' into master_hella

hella_online_20240911
gaojs 2 months ago
parent
commit
fa60bc5084
  1. 4
      .env.prod
  2. 4
      .env.test
  3. 3
      .env.test-scp
  4. 5
      public/systemConfig.js
  5. 4
      src/api/wms/rawMaterialConsumptionInfo/index.ts
  6. 10
      src/utils/systemParam.ts
  7. 57
      src/views/login/components/LoginForm.vue
  8. 6
      src/views/login/components/QRCodePDA.vue
  9. 24
      src/views/wms/productionManage/productreceiptAssemble/rawMaterialConsumptionInfo/index.vue

4
.env.prod

@ -48,3 +48,7 @@ VITE_SYSTERM_UPDATE_URL = 'https://scptest.faway-hella.com/'
# 是否需要验证码
VITE_NEED_CODE = true
# 是否需要下载PDA链接
VITE_PDA_URL = false

4
.env.test

@ -44,3 +44,7 @@ VITE_REPORT_URL = 'http://dev.ccwin-in.com:25400'
# 是否需要验证码
VITE_NEED_CODE = true
# 是否需要下载PDA链接
VITE_PDA_URL = true

3
.env.test-scp

@ -45,3 +45,6 @@ VITE_REPORT_URL = 'http://dev.ccwin-in.com:25400'
# 是否需要验证码
VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = false

5
public/systemConfig.js

@ -13,5 +13,8 @@ let systemConfig = {
tenant: '["成都"]',
systermUpdateAlert: true,
systermUpdateUrl: 'https://scptest.faway-hella.com/',
needCode:false
//是否需要验证码
needCode:false,
//是否需要PDA下载链接
pdaUrl:false,
}

4
src/api/wms/rawMaterialConsumptionInfo/index.ts

@ -54,4 +54,8 @@ export const exportAssemblyMaterialUsage = async (params) => {
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/backflush-record-detailb/get-import-template-error' })
}

10
src/utils/systemParam.ts

@ -7,6 +7,7 @@ const tenant = ref(import.meta.env.VITE_TENANT)
const systermUpdateAlert = ref(import.meta.env.VITE_SYSTERM_UPDATE_ALERT)
const systermUpdateUrl = ref(import.meta.env.VITE_SYSTERM_UPDATE_URL)
const needCode = ref(import.meta.env.VITE_NEED_CODE)
const pdaUrl = ref(import.meta.env.VITE_PDA_URL)
const mode = ref(import.meta.env.MODE)
// 获取baseUrl
@ -85,4 +86,13 @@ export const getNeedCode = () => {
}
}
//是否需要PDA下载链接
export const getPDAUrl = () => {
if(mode.value === 'prod') {
return systemConfig.pdaUrl
} else {
return pdaUrl.value
}
}

57
src/views/login/components/LoginForm.vue

@ -34,6 +34,11 @@
</el-form-item>
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px" v-if="needCode">
<el-form-item prop="code">
<Verify ref="VerifySlide" captchaType="blockPuzzle" mode="" :imgSize="{ width: '450px', height: '225px' }" @success="capctchaCheckSuccess" @error="capctchaCheckError"></Verify>
</el-form-item>
</el-col>
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px" v-if="needCode">
<el-form-item prop="code">
<div class="flex w-[100%]">
<el-input v-model="loginData.loginForm.code" :placeholder="t('login.codePlaceholder')"
@ -47,7 +52,7 @@
</div>
</div>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px">
<el-form-item>
<el-row justify="space-between" style="width: 100%">
@ -69,14 +74,8 @@
<XButton :loading="loginLoading" :title="t('login.login')" class="w-[100%]" type="primary"
@click="handleLogin()" />
</el-form-item>
</el-col>
<!-- <Verify
ref="verify"
:captchaType="captchaType"
:imgSize="{ width: '400px', height: '200px' }"
mode="pop"
@success="handleLogin"
/> -->
</el-row>
</el-form>
</template>
@ -99,6 +98,8 @@
import { getTenant } from '@/utils/systemParam'
import { getSystermUpdateAlert,getSystermUpdateUrl,getNeedCode } from '@/utils/systemParam'
import {validateResetTime} from "@/api/system/password";
import { Verify } from '@/components/Verifition'
const needCode = ref(getNeedCode()==true||getNeedCode()=='true')
defineOptions({ name: 'LoginForm' })
@ -115,8 +116,7 @@
const permissionStore = usePermissionStore()
const redirect = ref<string>('')
const loginLoading = ref(false)
const verify = ref()
const captchaType = ref('blockPuzzle') // blockPuzzle clickWord
const VerifySlide = ref()
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
@ -184,16 +184,18 @@
}
}
function getCode() {
console.log('getCode')
if(!needCode.value){
return
}
getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (captchaEnabled.value) {
codeUrl.value = "data:image/gif;base64," + res.img;
loginData.loginForm.uuid = res.uuid;
}
});
VerifySlide.value.refresh()
// getCodeImg().then(res => {
// captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
// if (captchaEnabled.value) {
// codeUrl.value = "data:image/gif;base64," + res.img;
// loginData.loginForm.uuid = res.uuid;
// }
// });
}
//ID
const getTenantId = async () => {
@ -221,10 +223,23 @@
name: 'ForgetPassword',
})
};
//
const capctchaCheckSuccess = async ({captchaVerification})=>{
console.log('capctchaCheckSuccess',captchaVerification)
if(captchaVerification){
loginData.loginForm.code = captchaVerification
await handleLogin()
}
}
//
const capctchaCheckError = ()=>{
VerifySlide.value.refresh()
}
const loading = ref() // ElLoading.service
//
const handleLogin = async (params) => {
const handleLogin = async () => {
console.log('登录-185')
if(getSystermUpdateAlert()=='true'||getSystermUpdateAlert()===true){
await ElMessageBox.alert(
@ -237,8 +252,10 @@
)
}
loginLoading.value = true
try {
await getTenantId()
const data = await validForm()
if (!data) {
return
@ -249,6 +266,8 @@
}else{
res = await LoginApi.login(loginData.loginForm)
}
console.log('登陆res',res)
try{
await PassWordApi.validateResetTime(res.userId)
}catch (e) {
@ -293,9 +312,9 @@
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
}finally {
console.log('登录-224')
getCode()
loginLoading.value = false
loading?.value?.close()
getCode()
}
}
//

6
src/views/login/components/QRCodePDA.vue

@ -5,14 +5,18 @@
<!-- <vue-qr bgSrc='https://img2.baidu.com/it/u=1188690822,3145215011&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1038' logoSrc="https://img1.baidu.com/it/u=605875105,1314303687&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" text="Hello world!" :size="200"></vue-qr> -->
<vue-qr :text="apkUrl" :size="200" ></vue-qr>
</div>
<el-button type="primary" link @click="handleClose">PDA安装程序下载链接</el-button>
<el-button type="primary" v-if="pdaUrl" link @click="handleClose">PDA安装程序下载链接</el-button>
</div>
</template>
<script setup lang="ts">
import { downloadApk } from "@/api/login";
import { getPDAUrl,getNeedCode } from '@/utils/systemParam'
// import logoImg from '@/assets/imgs/logo_white_blue.png'
import vueQr from 'vue-qr/src/packages/vue-qr.vue'
const pdaUrl = ref(getPDAUrl()==true||getPDAUrl()=='true')
const apkUrl = ref('')
const showCode = ref(false)
const handleClose = async ()=>{

24
src/views/wms/productionManage/productreceiptAssemble/rawMaterialConsumptionInfo/index.vue

@ -33,6 +33,10 @@
</Table>
</ContentWrap>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/backflush-record-detailb/importError" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
@ -73,6 +77,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -84,6 +89,8 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'import') { //
handleImport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
@ -107,6 +114,22 @@ const searchFormClick = (searchData) => {
getList() //
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importSuccess = () => {
getList()
}
const handleExport = async () => {
try {
//
@ -124,5 +147,6 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await RawMaterialConsumptionInfoApi.importTemplate()
})
</script>

Loading…
Cancel
Save