add:CTU出入库功能;

This commit is contained in:
2025-10-16 16:55:56 +08:00
parent f7512364cd
commit 3d038430f3
24 changed files with 632 additions and 83 deletions

View File

@@ -60,6 +60,12 @@ export const constantRouterMap = [
meta: { title: i18n.t('common.Personal_center') }
}
]
},
{
path: '/999',
meta: { title: '无授权码', noCache: true },
component: (resolve) => require(['@/views/features/licenseTip'], resolve),
hidden: true
}
]

View File

@@ -66,6 +66,12 @@ service.interceptors.response.use(
Cookies.set('point', 401)
location.reload()
})
} else if (code === 402) {
router.push({ path: '/999',
query: {
message: error.response.data.message
}
})
} else if (code === 403) {
router.push({ path: '/401' })
} else {

View File

@@ -0,0 +1,131 @@
<template>
<div class="activation-container">
<div class="activation-card">
<h1 class="title">请输入授权码激活</h1>
<p class="description">{{ tip ? tip + ',' : '' }}请输入您的授权码以激活功能</p>
<input
v-model="activationCode"
type="text"
placeholder="请输入授权码"
class="input-field"
>
<button class="activate-button" @click="handleActivate">激活</button>
</div>
</div>
</template>
<script>
import request from '@/utils/request'
export default {
name: 'LicenseTip',
data() {
return {
activationCode: '',
tip: '',
redirect: '/dashboard'
}
},
mounted() {
this.tip = this.$route.query.message
const savedCdk = localStorage.getItem('cdk')
if (savedCdk) {
this.activationCode = savedCdk
}
},
methods: {
handleActivate() {
if (this.activationCode.trim() === '') {
alert('请输入授权码')
return
}
// 暂时不对接API这里模拟激活成功
console.log('授权码:', this.activationCode)
request({
url: 'api/verify/activity',
method: 'post',
data: {
code: this.activationCode.trim()
}
}).then(res => {
console.log('激活成功:', res)
if (res.result) {
localStorage.setItem('cdk', this.activationCode.trim())
window.location.href = this.redirect
this.$message(res.message || '激活成功')
// this.$router.push({ path: '/' })
} else {
this.$message.error(res.message || '激活失败,请检查授权码')
}
}).catch(error => {
console.error('API错误:', error)
})
}
}
}
</script>
<style scoped>
.activation-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
font-family: 'Arial', sans-serif;
}
.activation-card {
background: white;
padding: 40px;
border-radius: 15px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
text-align: center;
width: 400px;
max-width: 90%;
}
.title {
font-size: 24px;
margin-bottom: 10px;
color: #333;
}
.description {
font-size: 16px;
margin-bottom: 20px;
color: #666;
}
.input-field {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 16px;
box-sizing: border-box;
transition: border-color 0.3s;
}
.input-field:focus {
border-color: #2575fc;
outline: none;
}
.activate-button {
width: 100%;
padding: 12px;
background: #2575fc;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s;
}
.activate-button:hover {
background: #1a5bb8;
}
</style>

View File

@@ -136,7 +136,7 @@
</template>
</el-table-column>
<el-table-column
v-permission="['admin','timing:edit','timing:del']"
v-permission="['admin','timing:edit']"
:label="$t('common.Operate')"
width="170px"
align="center"
@@ -170,25 +170,25 @@
>
{{ scope.row.is_pause ? $t('Scheduling.table.recover') : $t('Scheduling.table.pause') }}
</el-button>
<el-popover
:ref="scope.row.job_id"
v-permission="['admin','timing:del']"
placement="top"
width="200"
>
<p>{{ $t('Scheduling.msg.tip1') }}</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()">
{{ $t('common.Cancel') }}
</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)">
{{ $t('common.Confirm') }}
</el-button>
</div>
<el-button slot="reference" type="text" size="mini">
{{ $t('common.Delete') }}
</el-button>
</el-popover>
<!-- <el-popover-->
<!-- :ref="scope.row.job_id"-->
<!-- v-permission="['admin','timing:del']"-->
<!-- placement="top"-->
<!-- width="200"-->
<!-- >-->
<!-- <p>{{ $t('Scheduling.msg.tip1') }}</p>-->
<!-- <div style="text-align: right; margin: 0">-->
<!-- <el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()">-->
<!-- {{ $t('common.Cancel') }}-->
<!-- </el-button>-->
<!-- <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)">-->
<!-- {{ $t('common.Confirm') }}-->
<!-- </el-button>-->
<!-- </div>-->
<!-- <el-button slot="reference" type="text" size="mini">-->
<!-- {{ $t('common.Delete') }}-->
<!-- </el-button>-->
<!-- </el-popover>-->
</template>
</el-table-column>
</el-table>
@@ -236,8 +236,7 @@ export default {
delLoading: false,
permission: {
add: ['admin', 'timing:add'],
edit: ['admin', 'timing:edit'],
del: ['admin', 'timing:del']
edit: ['admin', 'timing:edit']
},
rules: {
job_name: [
@@ -312,17 +311,17 @@ export default {
console.log(id)
},
delMethod(id) {
this.delLoading = true
crudJob.del([id]).then(() => {
this.delLoading = false
this.$refs[id].doClose()
this.crud.dleChangePage(1)
this.crud.delSuccessNotify()
this.crud.toQuery()
}).catch(() => {
this.delLoading = false
this.$refs[id].doClose()
})
// this.delLoading = true
// crudJob.del([id]).then(() => {
// this.delLoading = false
// this.$refs[id].doClose()
// this.crud.dleChangePage(1)
// this.crud.delSuccessNotify()
// this.crud.toQuery()
// }).catch(() => {
// this.delLoading = false
// this.$refs[id].doClose()
// })
},
// 显示日志
doLog() {

View File

@@ -59,17 +59,17 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属仓库" prop="stor_id">
<el-form-item label="归属仓库" prop="stor_code">
<el-select
v-model="form.stor_id"
v-model="form.stor_code"
placeholder=""
style="width: 200px"
>
<el-option
v-for="item in stors"
:key="item.stor_id"
:key="item.stor_code"
:label="item.stor_name"
:value="item.stor_id"
:value="item.stor_code"
/>
</el-select>
</el-form-item>
@@ -270,7 +270,7 @@ export default {
sect_type_attr: [
{ required: true, message: '库区类型不能为空', trigger: 'blur' }
],
stor_id: [
stor_code: [
{ required: true, message: '仓库标识不能为空', trigger: 'blur' }
],
capacity: [

View File

@@ -76,6 +76,15 @@
/>
</el-select>
</el-form-item>
<el-form-item label="源单编号">
<el-input
v-model="query.source_bill_code"
size="mini"
clearable
placeholder="源单编号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="批次号">
<el-input
v-model="query.pcsn"