Browse Source

[SBBJ-808][模具区分厂内外,通过路由区分,sourceType赋值]

master
曾庆源 6 days ago
parent
commit
0cc40a7ad5
  1. 14
      src/views/eam/mold/moldAccounts/index.vue
  2. 10
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts

14
src/views/eam/mold/moldAccounts/index.vue

@ -136,7 +136,8 @@ defineOptions({ name: 'MoldAccounts' })
const tableRef = ref(null); const tableRef = ref(null);
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
// sourceType 0 :1 init
const sourceType = ref("")
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const MoldAccountsSchema = ref(cloneDeep(MoldAccounts)) const MoldAccountsSchema = ref(cloneDeep(MoldAccounts))
@ -416,20 +417,22 @@ const changeTabs = (item) => {
const count = ref(0) const count = ref(0)
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
init()
getList() getList()
importTemplateData.templateUrl = await MoldAccountsApi.importTemplate() importTemplateData.templateUrl = await MoldAccountsApi.importTemplate()
init()
}) })
const init = () => { const init = () => {
console.log(90,route.name) console.log(90,route.name)
nextTick(() => { nextTick(() => {
if (route.name == 'withinMoldAccounts') { if (route.name == 'withinMoldAccounts') {
MoldAccountsSchema.value.allSchemas.formSchema = MoldAccounts.allSchemas.formSchema.filter(item => item.field !== 'outsourcedSuppliers') sourceType.value = "0";
console.log( MoldAccountsSchema.value.allSchemas.formSchema) MoldAccountsSchema.value.allSchemas.formSchema = MoldAccounts.allSchemas.formSchema.filter(item => item.field !== 'outsourcedSuppliers')
MoldAccountsSchema.value.allSchemas.tableColumns = MoldAccounts.allSchemas.tableColumns.filter(item => item.field !== 'outsourcedSuppliers')
} else { } else {
sourceType.value = "1";
MoldAccountsSchema.value= cloneDeep(MoldAccounts) MoldAccountsSchema.value= cloneDeep(MoldAccounts)
} }
count.value++ count.value++
}) })
} }
onActivated(async() => { onActivated(async() => {
@ -498,5 +501,4 @@ const qrCodeBatch = async (val,item) => {
</script> </script>

10
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -44,9 +44,8 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'sourceType', field: 'sourceType',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: true, isForm: false,
form: { isTable: false,
},
table: { table: {
width: '150', width: '150',
fixed: 'left', fixed: 'left',
@ -56,10 +55,9 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
label: '外委托供应商', label: '外委托供应商',
field: 'outsourcedSuppliers', field: 'outsourcedSuppliers',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
isForm: true, isForm: true,
form: { isTable: true,
},
table: { table: {
width: '150', width: '150',
fixed: 'left', fixed: 'left',

Loading…
Cancel
Save