feat: 🚀 防伪码添加生成人

This commit is contained in:
2025-07-24 15:58:44 +08:00
parent de3e1f8177
commit 979caffedd
6 changed files with 48 additions and 6 deletions

View File

@@ -228,7 +228,7 @@ const options = [
const props = defineProps<SearchFormItem>(); const props = defineProps<SearchFormItem>();
const _searchParam = computed(() => props.searchParam); const _searchParam = computed(() => props.searchParam);
if (routeName.value === "boxCode" || routeName.value === "barCode") { if (routeName.value === "boxCode" || routeName.value === "barCode" || routeName.value === "antiCode") {
_searchParam.value.createUser = userStore.userInfo.nickname; _searchParam.value.createUser = userStore.userInfo.nickname;
} }
if (routeName.value === "boxMarkIndex") { if (routeName.value === "boxMarkIndex") {
@@ -345,6 +345,12 @@ const handleInput = (item: any) => {
createUser: _searchParam.value["createUser"] createUser: _searchParam.value["createUser"]
}); });
} }
if (routeName.value === "antiCode" && item.prop === "createUser") {
$Bus.emit("setAntiCodeInputCreateUser", {
createUser: _searchParam.value["createUser"]
});
}
if (routeName.value === "boxMarkIndex" && item.prop === "creator") { if (routeName.value === "boxMarkIndex" && item.prop === "creator") {
$Bus.emit("setBoxMarkIndexInputCreateUser", { $Bus.emit("setBoxMarkIndexInputCreateUser", {
creator: _searchParam.value["creator"] creator: _searchParam.value["creator"]
@@ -374,6 +380,9 @@ const handleEmitClear = (item: any) => {
if (routeName.value === "boxMarkIndex") { if (routeName.value === "boxMarkIndex") {
$Bus.emit("clearBoxMarkIndexCreator"); $Bus.emit("clearBoxMarkIndexCreator");
} }
if (routeName.value === "antiCode") {
$Bus.emit("clearBoxMarkIndexCreator");
}
}; };
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>

View File

@@ -135,7 +135,7 @@ export const useTable = (
Object.keys(state.searchInitParam).forEach(key => { Object.keys(state.searchInitParam).forEach(key => {
state.searchParam[key] = state.searchInitParam[key]; state.searchParam[key] = state.searchInitParam[key];
}); });
console.log(routeName, "=routeName=");
if (routeName === "barCode") { if (routeName === "barCode") {
$Bus.emit("clearBarCodeCreateUser"); $Bus.emit("clearBarCodeCreateUser");
} }
@@ -145,6 +145,10 @@ export const useTable = (
if (routeName === "boxMarkIndex") { if (routeName === "boxMarkIndex") {
$Bus.emit("clearBoxMarkIndexCreator"); $Bus.emit("clearBoxMarkIndexCreator");
} }
if (routeName === "antiCode") {
console.log("走到了这里?");
$Bus.emit("clearBoxAntiCodeCreator");
}
updatedTotalParam(); updatedTotalParam();
getTableList(); getTableList();
}; };

View File

@@ -65,13 +65,20 @@ export const FORM_DATA: FormItem[] = [
isArray: true, isArray: true,
options: [], options: [],
label: "规格型号: " label: "规格型号: "
},
{
prop: "createUser",
placeholder: "请输入生成人",
type: "input",
label: "生成人: "
} }
]; ];
export const RULE_FORM = { export const RULE_FORM = {
pageNo: 1, pageNo: 1,
pageSize: 50, pageSize: 50,
orgCode: 0 orgCode: 0,
createUser: ""
}; };
export const DOWN_FORM_DATA: any[] = [ export const DOWN_FORM_DATA: any[] = [
{ {

View File

@@ -101,7 +101,7 @@
<script setup lang="ts" name="antiCode"> <script setup lang="ts" name="antiCode">
import ListBtns from "@/components/ListBtns/index.vue"; import ListBtns from "@/components/ListBtns/index.vue";
import ProTable from "@/components/ProTable/index.vue"; import ProTable from "@/components/ProTable/index.vue";
import $Bus from "@/utils/mittBus";
import { QuestionFilled } from "@element-plus/icons-vue"; import { QuestionFilled } from "@element-plus/icons-vue";
import { useMsg } from "@/hooks/useMsg"; import { useMsg } from "@/hooks/useMsg";
import type { FormInstance } from "element-plus"; import type { FormInstance } from "element-plus";
@@ -144,6 +144,7 @@ if (SHOW_BTBS["antiCode"] && SHOW_BTBS["antiCode"].length) {
// 获取用户信息(组织id) // 获取用户信息(组织id)
const userStore = useUserStore(); const userStore = useUserStore();
// 数据源 // 数据源
const datas = reactive<any>({ const datas = reactive<any>({
downVisible: false, downVisible: false,
@@ -162,6 +163,11 @@ const datas = reactive<any>({
initDownParam: cloneDeep(DOWN_RULE_FORM), // initDownParam: cloneDeep(DOWN_RULE_FORM), //
downSelectionList: [] //防伪码下载列表选中 downSelectionList: [] //防伪码下载列表选中
}); });
datas.ruleForm.createUser = userStore.userInfo.nickname;
datas.initParam.createUser = userStore.userInfo.nickname;
console.log(datas.ruleForm.createUser, "=datas.ruleForm.createUser=");
// input输入验证 // input输入验证
const valueVerify = () => { const valueVerify = () => {
datas.numberRuleForm.number = integerRexg(datas.numberRuleForm.number); datas.numberRuleForm.number = integerRexg(datas.numberRuleForm.number);
@@ -219,7 +225,7 @@ const getGenerateSecurityNumber = async () => {
useMsg("success", "防伪码生成成功 "); useMsg("success", "防伪码生成成功 ");
datas.dialogFormVisible = false; datas.dialogFormVisible = false;
//这里应该调用重置接口,如果调用列表接口页面还会保留上次的搜索条件 //这里应该调用重置接口,如果调用列表接口页面还会保留上次的搜索条件
proTable.value!.reset(); proTable.value!.getTableList();
//proTable.value!.getTableList(); //proTable.value!.getTableList();
} }
}; };
@@ -312,6 +318,21 @@ watch(
deep: true deep: true
} }
); );
onMounted(() => {
$Bus.on("clearBoxAntiCodeCreator", () => {
datas.ruleForm.createUser = "";
datas.initParam.createUser = "";
console.log("123232");
});
$Bus.on("setAntiCodeInputCreateUser", (params: any) => {
const { createUser } = params;
datas.ruleForm.createUser = createUser;
datas.initParam.createUser = createUser;
console.log("1232323");
});
});
</script> </script>
<style scope lang="scss"> <style scope lang="scss">

View File

@@ -886,6 +886,7 @@ onMounted(() => {
const { createUser } = params; const { createUser } = params;
datas.ruleForm.createUser = createUser; datas.ruleForm.createUser = createUser;
datas.initParam.createUser = createUser; datas.initParam.createUser = createUser;
console.log("执行了吗");
}); });
}); });
</script> </script>

View File

@@ -112,7 +112,7 @@ export const FORM_DATA: FormItem[] = [
export const RULE_FORM = { export const RULE_FORM = {
pageNo: 1, pageNo: 1,
pageSize: 50, pageSize: 50,
createUser: "杨春龙" createUser: ""
}; };
export const NUM_RULE_FORM = { export const NUM_RULE_FORM = {