Browse Source

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

hella_online_20240911
gaojs 3 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 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 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 VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = false

5
public/systemConfig.js

@ -13,5 +13,8 @@ let systemConfig = {
tenant: '["成都"]', tenant: '["成都"]',
systermUpdateAlert: true, systermUpdateAlert: true,
systermUpdateUrl: 'https://scptest.faway-hella.com/', 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 systermUpdateAlert = ref(import.meta.env.VITE_SYSTERM_UPDATE_ALERT)
const systermUpdateUrl = ref(import.meta.env.VITE_SYSTERM_UPDATE_URL) const systermUpdateUrl = ref(import.meta.env.VITE_SYSTERM_UPDATE_URL)
const needCode = ref(import.meta.env.VITE_NEED_CODE) 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) const mode = ref(import.meta.env.MODE)
// 获取baseUrl // 获取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-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px" v-if="needCode"> <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"> <el-form-item prop="code">
<div class="flex w-[100%]"> <div class="flex w-[100%]">
<el-input v-model="loginData.loginForm.code" :placeholder="t('login.codePlaceholder')" <el-input v-model="loginData.loginForm.code" :placeholder="t('login.codePlaceholder')"
@ -47,7 +52,7 @@
</div> </div>
</div> </div>
</el-form-item> </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-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px">
<el-form-item> <el-form-item>
<el-row justify="space-between" style="width: 100%"> <el-row justify="space-between" style="width: 100%">
@ -69,14 +74,8 @@
<XButton :loading="loginLoading" :title="t('login.login')" class="w-[100%]" type="primary" <XButton :loading="loginLoading" :title="t('login.login')" class="w-[100%]" type="primary"
@click="handleLogin()" /> @click="handleLogin()" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <Verify
ref="verify"
:captchaType="captchaType"
:imgSize="{ width: '400px', height: '200px' }"
mode="pop"
@success="handleLogin"
/> -->
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
@ -99,6 +98,8 @@
import { getTenant } from '@/utils/systemParam' import { getTenant } from '@/utils/systemParam'
import { getSystermUpdateAlert,getSystermUpdateUrl,getNeedCode } from '@/utils/systemParam' import { getSystermUpdateAlert,getSystermUpdateUrl,getNeedCode } from '@/utils/systemParam'
import {validateResetTime} from "@/api/system/password"; import {validateResetTime} from "@/api/system/password";
import { Verify } from '@/components/Verifition'
const needCode = ref(getNeedCode()==true||getNeedCode()=='true') const needCode = ref(getNeedCode()==true||getNeedCode()=='true')
defineOptions({ name: 'LoginForm' }) defineOptions({ name: 'LoginForm' })
@ -115,8 +116,7 @@
const permissionStore = usePermissionStore() const permissionStore = usePermissionStore()
const redirect = ref<string>('') const redirect = ref<string>('')
const loginLoading = ref(false) const loginLoading = ref(false)
const verify = ref() const VerifySlide = ref()
const captchaType = ref('blockPuzzle') // blockPuzzle clickWord
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
@ -184,16 +184,18 @@
} }
} }
function getCode() { function getCode() {
console.log('getCode')
if(!needCode.value){ if(!needCode.value){
return return
} }
getCodeImg().then(res => { VerifySlide.value.refresh()
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; // getCodeImg().then(res => {
if (captchaEnabled.value) { // captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
codeUrl.value = "data:image/gif;base64," + res.img; // if (captchaEnabled.value) {
loginData.loginForm.uuid = res.uuid; // codeUrl.value = "data:image/gif;base64," + res.img;
} // loginData.loginForm.uuid = res.uuid;
}); // }
// });
} }
//ID //ID
const getTenantId = async () => { const getTenantId = async () => {
@ -221,10 +223,23 @@
name: 'ForgetPassword', 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 loading = ref() // ElLoading.service
// //
const handleLogin = async (params) => { const handleLogin = async () => {
console.log('登录-185') console.log('登录-185')
if(getSystermUpdateAlert()=='true'||getSystermUpdateAlert()===true){ if(getSystermUpdateAlert()=='true'||getSystermUpdateAlert()===true){
await ElMessageBox.alert( await ElMessageBox.alert(
@ -237,8 +252,10 @@
) )
} }
loginLoading.value = true loginLoading.value = true
try { try {
await getTenantId() await getTenantId()
const data = await validForm() const data = await validForm()
if (!data) { if (!data) {
return return
@ -249,6 +266,8 @@
}else{ }else{
res = await LoginApi.login(loginData.loginForm) res = await LoginApi.login(loginData.loginForm)
} }
console.log('登陆res',res)
try{ try{
await PassWordApi.validateResetTime(res.userId) await PassWordApi.validateResetTime(res.userId)
}catch (e) { }catch (e) {
@ -293,9 +312,9 @@
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList()) wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
}finally { }finally {
console.log('登录-224') console.log('登录-224')
getCode()
loginLoading.value = false loginLoading.value = false
loading?.value?.close() 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 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> <vue-qr :text="apkUrl" :size="200" ></vue-qr>
</div> </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> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { downloadApk } from "@/api/login"; import { downloadApk } from "@/api/login";
import { getPDAUrl,getNeedCode } from '@/utils/systemParam'
// import logoImg from '@/assets/imgs/logo_white_blue.png' // import logoImg from '@/assets/imgs/logo_white_blue.png'
import vueQr from 'vue-qr/src/packages/vue-qr.vue' import vueQr from 'vue-qr/src/packages/vue-qr.vue'
const pdaUrl = ref(getPDAUrl()==true||getPDAUrl()=='true')
const apkUrl = ref('') const apkUrl = ref('')
const showCode = ref(false) const showCode = ref(false)
const handleClose = async ()=>{ const handleClose = async ()=>{

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

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

Loading…
Cancel
Save