diff --git a/src/hook/useFormHandler.js b/src/hook/useFormHandler.js
index 739203f..5a5d191 100644
--- a/src/hook/useFormHandler.js
+++ b/src/hook/useFormHandler.js
@@ -2,6 +2,7 @@ import { useRoute, useRouter } from 'vue-router'
import { cloneDeep } from 'lodash-es'
import useTabs from '@/utils/useTabs'
import extendFieldApi from '@/api/base/extendfield/extendFieldApi'
+import router from '@/router'
export default function useFormHandler(formItems, api, backRouter) {
const state = reactive({
@@ -21,7 +22,6 @@ export default function useFormHandler(formItems, api, backRouter) {
const formRefs = ref([])
const route = useRoute()
- const router = useRouter()
// 初始化表单数据
const initializeFormData = () => {
@@ -31,13 +31,13 @@ export default function useFormHandler(formItems, api, backRouter) {
}
// 提交表单
- const onSubmit = async (params = {}) => {
+ const onSubmit = async (params = {}, backRouter) => {
submitLoading.value = true
try {
await validateForms()
const formDataParam = params.isDeep ? cloneDeep(params) : formData
- const safeId = validateAndCleanId(route.query.id || params.id)
+ const safeId = validateAndCleanId(params.id)
if (safeId) {
formDataParam.id = safeId
}
@@ -46,7 +46,7 @@ export default function useFormHandler(formItems, api, backRouter) {
if (params.isEnable) return res
- handleBack()
+ handleBack(backRouter)
} catch (error) {
console.error('Validation or submission error:', error)
throw error
@@ -66,8 +66,10 @@ export default function useFormHandler(formItems, api, backRouter) {
}
// 返回并关闭当前标签页
- const handleBack = () => {
- useTabs.close('', backRouter)
+ const handleBack = (backRouter) => {
+ console.log(backRouter, 'backRouter')
+ // useTabs.close('', backRouter)
+ router.replace({ path: backRouter })
}
// 根据页面类型加载表单数据
diff --git a/src/layout/components/setting.vue b/src/layout/components/setting.vue
index ea70ed8..4a3be46 100644
--- a/src/layout/components/setting.vue
+++ b/src/layout/components/setting.vue
@@ -72,9 +72,9 @@
-
+
{
// 侧边菜单是否排他展开
const sideUniqueOpen = ref(getCacheConfig('SNOWY_SIDE_UNIQUE_OPEN'))
// 多标签栏
- const layoutTagsOpen = ref(getCacheConfig('SNOWY_LAYOUT_TAGS_OPEN'))
+ const layoutTagsOpen = ref(getCacheConfig('SNOWY_LAYOUT_TAGS_CLOSE'))
// 是否展示面包屑
const breadcrumbOpen = ref(getCacheConfig('SNOWY_BREADCRUMD_OPEN'))
// 是否开启固定宽度(顶栏菜单)
diff --git a/src/views/productionBusiness/basicData/brand/detail/index.vue b/src/views/productionBusiness/basicData/brand/detail/index.vue
index 735298d..6d3b5eb 100644
--- a/src/views/productionBusiness/basicData/brand/detail/index.vue
+++ b/src/views/productionBusiness/basicData/brand/detail/index.vue
@@ -1,11 +1,13 @@
-
+
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
-
防伪页面
-
+ -->
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
@@ -51,13 +66,20 @@
import officialAccountApi from '@/api/base/wx/officialAccountApi'
import useFormHandler from '@/hook/useFormHandler'
import { useRoute } from 'vue-router'
- import { brandFormItems, formRules } from '@/views/productionBusiness/basicData/brand/formFields/detailFields'
+ import {
+ brandFormItems,
+ brandViewFormItems,
+ formRules
+ } from '@/views/productionBusiness/basicData/brand/formFields/detailFields'
import { useNavigation } from '@/hook/useNavigation'
+ import router from '@/router'
+ import tool from '@/utils/tool'
const { navigateTo } = useNavigation()
const route = useRoute()
const formRef1 = ref(null)
let extendData = ref([])
+ let detailData = ref([])
let { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } = useFormHandler(
brandFormItems,
@@ -69,7 +91,7 @@
onMounted(async () => {
formRefs.value = [formRef1.value]
- await fetchData(route.query.type)
+ detailData.value = await fetchData(route.query.type)
officialAccountApi
.officialAccountList({
@@ -115,8 +137,17 @@
delete domainFormRules['domainName' + (index + 1)]
}*/
- const onSubmitForm = async () => {
- await onSubmit({ ...formData })
+ const onSubmitFormBack = async () => {
+ await onSubmit({ ...formData, id: detailData.value?.id }, '/basicData/brand')
+ }
+
+ const onSubmitFormAdd = () => {
+ onSubmit({ ...formData, id: detailData.value?.id, isEnable: true }).then(() => {
+ // 新增清空所有的表单数据
+ router.replace({ path: route.path, query: { type: route.type } }).then(() => {
+ router.go(0) // 刷新页面
+ })
+ })
}
let activeKey = ref('1')
diff --git a/src/views/productionBusiness/basicData/brand/formFields/detailFields.js b/src/views/productionBusiness/basicData/brand/formFields/detailFields.js
index 730bc41..907c9e8 100644
--- a/src/views/productionBusiness/basicData/brand/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/brand/formFields/detailFields.js
@@ -86,3 +86,44 @@ export const brandFormItems = reactive([
}
}
])
+export const brandViewFormItems = reactive([
+ {
+ label: '名称:',
+ name: 'name',
+ span: 6
+ },
+ {
+ label: '编码:',
+ name: 'number',
+ span: 1
+ },
+ {
+ label: '简称:',
+ name: 'shortName',
+ span: 1,
+ },
+ {
+ label: '所属企业:',
+ name: 'company',
+ span: 1
+ },
+ {
+ label: '公众号:',
+ name: 'officialAccountId',
+ span: 1
+ },
+ {
+ label: '启用状态:',
+ name: 'enabledState',
+ type: 'dict',
+ span: 1,
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 6
+ }
+])
diff --git a/src/views/productionBusiness/basicData/client/detail/index.vue b/src/views/productionBusiness/basicData/client/detail/index.vue
index 1a0741c..1fc0b90 100644
--- a/src/views/productionBusiness/basicData/client/detail/index.vue
+++ b/src/views/productionBusiness/basicData/client/detail/index.vue
@@ -1,12 +1,15 @@
-
+
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
-
+
新增
+
+
+
+
+ {{ index + 1 }}
+
+
+
@@ -138,11 +175,15 @@
import {
clientFormItems,
baseFormItems,
- formRules
+ formRules,
+ clientViewFormItems,
+ baseViewFormItems
} from '@/views/productionBusiness/basicData/client/formFields/detailFields'
+ import router from '@/router'
+ import tool from '@/utils/tool'
const route = useRoute()
- let detailData = reactive({})
+ let detailData = ref({})
// 级联选择
let cityOptionsCity = ref([])
@@ -174,7 +215,29 @@
}
)
- const onSubmitForm = () => {
+ const onSubmitFormBack = () => {
+ const dataSourceList = dataSource.value.map((item) => {
+ return {
+ id: item.id || '',
+ customerId: item.customerId || '',
+ province: item.province || '',
+ city: item.city || '',
+ county: item.county || '',
+ remarks: item.remarks || ''
+ }
+ })
+ onSubmit(
+ {
+ isDeep: true,
+ ...formData,
+ saleAreaList: dataSourceList,
+ id: detailData.value?.id
+ },
+ '/basicData/client'
+ )
+ }
+
+ const onSubmitFormAdd = () => {
const dataSourceList = dataSource.value.map((item) => {
return {
id: item.id || '',
@@ -188,7 +251,14 @@
onSubmit({
isDeep: true,
...formData,
- saleAreaList: dataSourceList
+ saleAreaList: dataSourceList,
+ id: detailData.value?.id,
+ isEnable: true
+ }).then(() => {
+ // 新增清空所有的表单数据
+ router.replace({ path: route.path, query: { type: route.type } }).then(() => {
+ router.go(0) // 刷新页面
+ })
})
}
@@ -196,7 +266,7 @@
formRefs.value = [formRef1.value, formRef2.value]
fetchData(route.query.type).then(async (res) => {
if (res) {
- detailData = res
+ detailData.value = res
const list = await customerApi.customerSaleAreaList({
customerId: res.id
diff --git a/src/views/productionBusiness/basicData/client/formFields/detailFields.js b/src/views/productionBusiness/basicData/client/formFields/detailFields.js
index 87cd527..389685e 100644
--- a/src/views/productionBusiness/basicData/client/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/client/formFields/detailFields.js
@@ -134,6 +134,68 @@ export const clientFormItems = reactive([
}
}
])
+export const clientViewFormItems = reactive([
+ {
+ label: '编码:',
+ name: 'number',
+ span: 1
+ },
+ {
+ label: '名称:',
+ name: 'name',
+ span: 1
+ },
+ {
+ label: '简称:',
+ name: 'shortName',
+ span: 1
+ },
+ {
+ label: '可用状态:',
+ name: 'enabledState',
+ type: 'dict',
+ span: 1,
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ },
+ {
+ label: '品牌:',
+ name: 'brandName',
+ span: 1
+ },
+ {
+ label: '客户分类:',
+ name: 'categoryName',
+ span: 1
+ },
+ {
+ label: '省:',
+ name: 'province',
+ span: 1
+ },
+ {
+ label: '市:',
+ name: 'city',
+ span: 1
+ },
+ {
+ label: '区:',
+ name: 'county',
+ span: 1
+ },
+ {
+ label: '地址:',
+ name: 'address',
+ type: 'a-textarea',
+ span: 3
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 3
+ }
+])
export const baseFormItems = [
{
@@ -213,3 +275,45 @@ export const baseFormItems = [
}
}
]
+export const baseViewFormItems = [
+ {
+ label: '联系人:',
+ name: 'contacts',
+ span: 1
+ },
+ {
+ label: '手机:',
+ name: 'phone',
+ span: 1
+ },
+ {
+ label: '固话:',
+ name: 'tel',
+ span: 1,
+ },
+ {
+ label: '传真:',
+ name: 'fax',
+ span: 1,
+ },
+ {
+ label: '电子邮箱:',
+ name: 'email',
+ span: 1
+ },
+ {
+ label: 'QQ:',
+ name: 'qq',
+ span: 1
+ },
+ {
+ label: '微信:',
+ name: 'wechat',
+ span: 1
+ },
+ {
+ label: '联系地址:',
+ name: 'contactAddress',
+ span: 1
+ }
+]
diff --git a/src/views/productionBusiness/basicData/materiel/detail/index.vue b/src/views/productionBusiness/basicData/materiel/detail/index.vue
index 7f0ac49..3d15afa 100644
--- a/src/views/productionBusiness/basicData/materiel/detail/index.vue
+++ b/src/views/productionBusiness/basicData/materiel/detail/index.vue
@@ -1,51 +1,86 @@
-
+
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
+
+
+ {{ detailData[item.name]?.toFixed(2) }}
+
+
+
+
+ {{ detailData[item.name] }}
+
+
-
+
{{ index + 1 }}
@@ -94,6 +129,19 @@
+
+
+
+ {{ index + 1 }}
+
+
+ {{ tool.dictTypeData('COMMON_STATUS', record[column.dataIndex]) }}
+
+
+ {{ record.unitName }}
+
+
+
@@ -142,7 +190,7 @@
- 包装比例转换
+ 包装比例转换
@@ -154,7 +202,7 @@
import useFormHandler from '@/hook/useFormHandler'
import tool from '@/utils/tool'
- import { useRoute } from 'vue-router'
+ import router from '@/router'
import materialApi from '@/api/base/material/materialApi'
import materialCategoryApi from '@/api/base/material/materialCategoryApi'
import { message } from 'ant-design-vue'
@@ -165,8 +213,13 @@
materialFormItems,
unitFormItems,
priceFormItems,
- formRules
+ formRules,
+ materialViewFormItems,
+ baseFormViewItems,
+ priceViewFormItems,
+ unitViewFormItems
} from '@/views/productionBusiness/basicData/materiel/formFields/detailFields'
+ import { useRoute } from 'vue-router'
const route = useRoute()
const formRef1 = ref(null)
@@ -175,6 +228,7 @@
const formRef4 = ref(null)
let dataSource = ref([])
+ let detailData = ref([])
let unitOptions = reactive([])
let productFormData = ref({
promoteEnabledState: 'ENABLE'
@@ -186,9 +240,8 @@
unitFormItems[0].attrs.onChange = handleChangeUnitGroup
fetchData(route.query.type).then(async (res) => {
- console.log(res, 'res')
- console.log(formData, 'formData')
if (res) {
+ detailData.value = res
productFormData.value.promoteEnabledState = res.promoteEnabledState
productFormData.value.promoteUrl = res.promoteUrl
const packageData = await materialApi.materialPackageData({
@@ -298,20 +351,40 @@
})
// 修改包装关系的默认单位
- dataSource.value[0].unitId = resFilter[0].id
+ dataSource.value[0].unitId = resFilter[0]?.id
dataSource.value[0].productQty = null
dataSource.value[0].unitRate = resFilter[0].rate
})
}
- const onSubmitForm = () => {
- console.log(dataSource.value, 'dataSource.value')
+ const onSubmitFormBack = () => {
+ onSubmit(
+ {
+ isDeep: true,
+ ...formData,
+ ...productFormData.value,
+ id: detailData.value?.id,
+ extJson: JSON.stringify(extendFormData.value) || '',
+ materialPackageList: dataSource.value
+ },
+ '/basicData/materiel'
+ )
+ }
+
+ const onSubmitFormAdd = () => {
onSubmit({
isDeep: true,
...formData,
...productFormData.value,
+ id: detailData.value?.id,
+ isEnable: true,
extJson: JSON.stringify(extendFormData.value) || '',
materialPackageList: dataSource.value
+ }).then(() => {
+ // 新增清空所有的表单数据
+ router.replace({ path: route.path, query: { type: route.type } }).then(() => {
+ router.go(0) // 刷新页面
+ })
})
}
@@ -485,7 +558,7 @@
}
const { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } =
- useFormHandler([...materialFormItems, ...baseFormItems,...priceFormItems, ...unitFormItems], {
+ useFormHandler([...materialFormItems, ...baseFormItems, ...priceFormItems, ...unitFormItems], {
submitForm: materialApi.materialSubmitForm,
getDetail: materialApi.materialDetail
})
diff --git a/src/views/productionBusiness/basicData/materiel/formFields/detailFields.js b/src/views/productionBusiness/basicData/materiel/formFields/detailFields.js
index c16bc72..4fefdf1 100644
--- a/src/views/productionBusiness/basicData/materiel/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/materiel/formFields/detailFields.js
@@ -93,6 +93,52 @@ export const materialFormItems = [
defaultValue: 'ENABLE'
}
]
+export const materialViewFormItems = [
+ {
+ label: '编码:',
+ name: 'number',
+ span: 1
+ },
+ {
+ label: '名称:',
+ name: 'name',
+ span: 1
+ },
+ {
+ label: '简称:',
+ name: 'shortName',
+ span: 1
+ },
+ {
+ label: '别名:',
+ name: 'alias',
+ span: 1
+ },
+ {
+ label: '规格型号:',
+ name: 'specification',
+ span: 1
+ },
+ {
+ label: '包装比例:',
+ name: 'packageProportion',
+ span: 1
+ },
+ {
+ label: '助记码:',
+ name: 'mnemonicCode',
+ span: 1
+ },
+ {
+ label: '可用状态:',
+ name: 'enabledState',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ }
+]
export const baseFormItems = reactive([
{
@@ -216,6 +262,72 @@ export const baseFormItems = reactive([
}
}
])
+export const baseFormViewItems = reactive([
+ {
+ label: '物料类型:',
+ name: 'categoryName',
+ span: 1
+ },
+ {
+ label: '品牌:',
+ name: 'brandName',
+ span: 1
+ },
+ {
+ label: '最高库存:',
+ name: 'maxInventory',
+ span: 1
+ },
+ {
+ label: '最低库存:',
+ name: 'minInventory',
+ span: 1
+ },
+ {
+ label: '保质期:',
+ name: 'shelfLife',
+ span: 1
+ },
+ // {
+ // label: '统一零售价:',
+ // name: 'retailPrice',
+ // type: 'a-input-number',
+ // span: 6,
+ // attrs: {
+ // placeholder: '请输入统一零售价',
+ // allowClear: true
+ // }
+ // },
+ {
+ label: '商品条形码:',
+ name: 'barcode',
+ span: 1
+ },
+ {
+ label: '保质期单位:',
+ name: 'shelfLifeUnit',
+ span: 1
+ },
+ {
+ label: '最大包装数量:',
+ name: 'maxPackageQuantity',
+ span: 1
+ },
+ {
+ label: '批次管理:',
+ name: 'batchManage',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 6
+ }
+])
export const unitFormItems = reactive([
{
@@ -331,6 +443,43 @@ export const unitFormItems = reactive([
}
}
])
+export const unitViewFormItems = reactive([
+ {
+ label: '单位组:',
+ name: 'unitGroupName',
+ span: 1
+ },
+ {
+ label: '基本单位:',
+ name: 'baseUnitName',
+ span: 1
+ },
+ {
+ label: '采购单位:',
+ name: 'purchaseUnitName',
+ span: 1
+ },
+ {
+ label: '分销单位:',
+ name: 'distrUnitName',
+ span: 1
+ },
+ {
+ label: '生产单位:',
+ name: 'produceUnitName',
+ span: 1
+ },
+ {
+ label: '销售单位:',
+ name: 'saleUnitName',
+ span: 1
+ },
+ {
+ label: '库存单位:',
+ name: 'storeUnitName',
+ span: 1
+ }
+])
export const priceFormItems = [
{
@@ -364,3 +513,20 @@ export const priceFormItems = [
}
}
]
+export const priceViewFormItems = [
+ {
+ label: '生产价格:',
+ name: 'producePrice',
+ span: 1
+ },
+ {
+ label: '采购价格:',
+ name: 'purchasePrice',
+ span: 1
+ },
+ {
+ label: '统一零售价:',
+ name: 'retailPrice',
+ span: 1
+ }
+]
diff --git a/src/views/productionBusiness/basicData/publicAccount/detail/index.vue b/src/views/productionBusiness/basicData/publicAccount/detail/index.vue
index a0f2225..082d013 100644
--- a/src/views/productionBusiness/basicData/publicAccount/detail/index.vue
+++ b/src/views/productionBusiness/basicData/publicAccount/detail/index.vue
@@ -1,30 +1,58 @@
-
+
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
{
+ await onSubmit({ ...formData, id: detailData.value?.id }, '/basicData/publicAccount')
+ }
+
+ const onSubmitFormAdd = () => {
+ onSubmit({ ...formData, id: detailData.value?.id, isEnable: true }).then(() => {
+ // 新增清空所有的表单数据
+ router.replace({ path: route.path, query: { type: route.type } }).then(() => {
+ router.go(0) // 刷新页面
+ })
+ })
+ }
+
const { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } =
useFormHandler([...officialAccountFormItems, ...basicInfoFormItems], {
submitForm: officialAccountApi.officialAccountSubmitForm,
diff --git a/src/views/productionBusiness/basicData/publicAccount/formFields/detailFields.js b/src/views/productionBusiness/basicData/publicAccount/formFields/detailFields.js
index e502707..18d6f4c 100644
--- a/src/views/productionBusiness/basicData/publicAccount/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/publicAccount/formFields/detailFields.js
@@ -52,6 +52,36 @@ export const officialAccountFormItems = [
}
}
]
+export const officialAccountViewFormItems = [
+ {
+ label: '类型:',
+ name: 'type',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'OFFICIAL_ACCOUNT_TYPE'
+ }
+ },
+ {
+ label: '名称:',
+ name: 'name',
+ span: 1
+ },
+ {
+ label: '可用状态:',
+ name: 'enabledState',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 1
+ }
+]
export const basicInfoFormItems = [
{
@@ -72,7 +102,7 @@ export const basicInfoFormItems = [
allowClear: true
}
},
- {
+ /*{
label: '字符串编码格式:',
name: 'encodingFormat',
type: 'a-input',
@@ -80,7 +110,7 @@ export const basicInfoFormItems = [
placeholder: '请输入字符串编码格式',
allowClear: true
}
- },
+ },*/
{
label: '校验码:',
name: 'token',
@@ -100,3 +130,30 @@ export const basicInfoFormItems = [
}
}
]
+export const basicInfoViewFormItems = [
+ {
+ label: 'AppID:',
+ name: 'appid',
+ span: 1
+ },
+ {
+ label: 'AppSecret:',
+ name: 'secret',
+ span: 1
+ },
+ // {
+ // label: '字符串编码格式:',
+ // name: 'encodingFormat',
+ // span: 1
+ // },
+ {
+ label: '校验码:',
+ name: 'token',
+ span: 1
+ },
+ {
+ label: '签名方式:',
+ name: 'aesKey',
+ span: 1
+ }
+]
diff --git a/src/views/productionBusiness/basicData/stash/detail/index.vue b/src/views/productionBusiness/basicData/stash/detail/index.vue
index 0747931..6ce8884 100644
--- a/src/views/productionBusiness/basicData/stash/detail/index.vue
+++ b/src/views/productionBusiness/basicData/stash/detail/index.vue
@@ -1,30 +1,58 @@
-
+
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
{
+ const onSubmitFormBack = () => {
+ onSubmit(
+ {
+ isDeep: true,
+ ...formData,
+ id: detailData.value?.id,
+ extJson: JSON.stringify(extendFormData.value) || ''
+ },
+ '/basicData/stash'
+ )
+ }
+
+ const onSubmitFormAdd = () => {
onSubmit({
isDeep: true,
...formData,
+ id: detailData.value?.id,
+ isEnable: true,
extJson: JSON.stringify(extendFormData.value) || ''
+ }).then(() => {
+ // 新增清空所有的表单数据
+ router.replace({ path: route.path, query: { type: route.type } }).then(() => {
+ router.go(0) // 刷新页面
+ })
})
}
@@ -125,10 +177,13 @@
if (res) {
formData.manageUserId = res.manageUserId
}
+
+ baseFormItems[0].attrs.onClick = handleManageUser
+
+ detailData.value = res || {}
})
const sysStoreTreeList = await sysStoreApi.sysStoreTree()
- baseFormItems[0].attrs.onClick = handleManageUser
officialAccountFormItems.forEach((item) => {
if (item.name === 'parentId') {
diff --git a/src/views/productionBusiness/basicData/stash/formFields/detailFields.js b/src/views/productionBusiness/basicData/stash/formFields/detailFields.js
index 57fd96b..f0ebbcc 100644
--- a/src/views/productionBusiness/basicData/stash/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/stash/formFields/detailFields.js
@@ -83,6 +83,51 @@ export const officialAccountFormItems = reactive([
}
}
])
+export const officialAccountViewFormItems = reactive([
+ {
+ label: '编码:',
+ name: 'number',
+ span: 1
+ },
+ {
+ label: '名称:',
+ name: 'name',
+ span: 1
+ },
+ {
+ label: '仓库条码:',
+ name: 'barcode',
+ span: 1
+ },
+ {
+ label: '可用状态:',
+ name: 'enabledState',
+ type: 'dict',
+ span: 1,
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ },
+ {
+ label: '库存管理方式:',
+ name: 'manageMode',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'STORE_MANAGE_MODE'
+ }
+ },
+ {
+ label: '上游仓库:',
+ name: 'parentId',
+ span: 1
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 1
+ }
+])
export const baseFormItems = [
{
@@ -92,7 +137,7 @@ export const baseFormItems = [
span: 6,
attrs: {
placeholder: '请选择管理员',
- readonly: true
+ readonly: true,
}
},
{
@@ -125,6 +170,29 @@ export const baseFormItems = [
}
]
+export const baseFormViewItems = [
+ {
+ label: '管理员:',
+ name: 'manageUserName',
+ span: 1
+ },
+ {
+ label: '手机:',
+ name: 'phone',
+ span: 1
+ },
+ {
+ label: '固话:',
+ name: 'tel',
+ span: 1
+ },
+ {
+ label: '地址:',
+ name: 'address',
+ span: 6
+ }
+]
+
export const formRules = {
name: [required('请输入名称')],
type: [required('请输入类型')],
diff --git a/src/views/productionBusiness/basicData/supplier/detail/index.vue b/src/views/productionBusiness/basicData/supplier/detail/index.vue
index 8df6880..6564758 100644
--- a/src/views/productionBusiness/basicData/supplier/detail/index.vue
+++ b/src/views/productionBusiness/basicData/supplier/detail/index.vue
@@ -1,12 +1,15 @@
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
@@ -78,11 +100,15 @@
import {
formItems,
baseFormItems,
- formRules
+ formRules,
+ viewFormItems,
+ baseFormViewItems
} from '@/views/productionBusiness/basicData/supplier/formFields/detailFields'
+ import tool from '@/utils/tool'
+ import router from '@/router'
const route = useRoute()
- let detailData = reactive({})
+ let detailData = ref({})
// 级联选择
let cityOptionsCity = ref([])
@@ -111,10 +137,28 @@
getDetail: supplierApi.supplierDetail
})
- const onSubmitForm = () => {
+ const onSubmitFormBack = () => {
+ onSubmit(
+ {
+ isDeep: true,
+ ...formData,
+ id: detailData.value?.id
+ },
+ '/basicData/supplier'
+ )
+ }
+
+ const onSubmitFormAdd = () => {
onSubmit({
isDeep: true,
- ...formData
+ ...formData,
+ id: detailData.value?.id,
+ isEnable: true
+ }).then(() => {
+ // 新增清空所有的表单数据
+ router.replace({ path: route.path, query: { type: route.type } }).then(() => {
+ router.go(0) // 刷新页面
+ })
})
}
@@ -124,6 +168,8 @@
if (res) {
getCityOptions()
}
+
+ detailData.value = res || {}
})
// 选择品牌
diff --git a/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js b/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js
index b6e5d5f..cf7c2df 100644
--- a/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js
@@ -132,6 +132,67 @@ export const formItems = reactive([
}
}
])
+export const viewFormItems = reactive([
+ {
+ label: '编码:',
+ name: 'number',
+ span: 1
+ },
+ {
+ label: '名称:',
+ name: 'name',
+ span: 1
+ },
+ {
+ label: '简称:',
+ name: 'shortName',
+ span: 1
+ },
+ {
+ label: '可用状态:',
+ name: 'enabledState',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'COMMON_STATUS'
+ }
+ },
+ {
+ label: '品牌:',
+ name: 'brandName',
+ span: 1
+ },
+ {
+ label: '供应商分类:',
+ name: 'categoryName',
+ span: 1
+ },
+ {
+ label: '省:',
+ name: 'province',
+ span: 1
+ },
+ {
+ label: '市:',
+ name: 'city',
+ span: 1
+ },
+ {
+ label: '区:',
+ name: 'county',
+ span: 1
+ },
+ {
+ label: '详细地址:',
+ name: 'address',
+ span: 1,
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 1,
+ }
+])
export const baseFormItems = [
{
@@ -211,3 +272,45 @@ export const baseFormItems = [
}
}
]
+export const baseFormViewItems = [
+ {
+ label: '联系人:',
+ name: 'contacts',
+ span: 1,
+ },
+ {
+ label: '手机:',
+ name: 'phone',
+ span: 1
+ },
+ {
+ label: '固话:',
+ name: 'tel',
+ span: 1
+ },
+ {
+ label: '传真:',
+ name: 'fax',
+ span: 1
+ },
+ {
+ label: '电子邮箱:',
+ name: 'email',
+ span: 1
+ },
+ {
+ label: 'QQ:',
+ name: 'qq',
+ span: 1
+ },
+ {
+ label: '微信:',
+ name: 'wechat',
+ span: 1
+ },
+ {
+ label: '联系地址:',
+ name: 'contactAddress',
+ span: 1
+ }
+]
diff --git a/src/views/productionBusiness/basicData/supplier/index.vue b/src/views/productionBusiness/basicData/supplier/index.vue
index f99a490..e0bacce 100644
--- a/src/views/productionBusiness/basicData/supplier/index.vue
+++ b/src/views/productionBusiness/basicData/supplier/index.vue
@@ -56,10 +56,7 @@
新增
-
+
@@ -72,43 +69,58 @@
-
-
-
-
-
-
+
+
+ 查看
+
-
-
-
-
-
+
+
+
+ 更多
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 编辑
+
+
+
+
+
+ 删除
+
+
+
+
+
@@ -146,7 +158,7 @@
delete: supplierApi.supplierDelete
},
tableColumns,
- ['customerEdit', 'customerDelete']
+ ['sysBrandEdit', 'sysBrandDelete']
)
const dynamicTreeRef = ref(null)
diff --git a/src/views/productionBusiness/basicData/tissue/detail/TissueForm.vue b/src/views/productionBusiness/basicData/tissue/detail/TissueForm.vue
index 275a52d..c53dd74 100644
--- a/src/views/productionBusiness/basicData/tissue/detail/TissueForm.vue
+++ b/src/views/productionBusiness/basicData/tissue/detail/TissueForm.vue
@@ -99,6 +99,7 @@
+
关闭
保存
diff --git a/src/views/productionBusiness/basicData/unit/detail/index.vue b/src/views/productionBusiness/basicData/unit/detail/index.vue
index f1876a1..c1a3945 100644
--- a/src/views/productionBusiness/basicData/unit/detail/index.vue
+++ b/src/views/productionBusiness/basicData/unit/detail/index.vue
@@ -1,18 +1,33 @@
-
+
- 保存
+ 保存后退出
+ 保存后新增
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
-
+
@@ -44,17 +59,22 @@
import useFormHandler from '@/hook/useFormHandler'
import { useRoute } from 'vue-router'
import unitApi from '@/api/base/unit/unitApi'
- import { formRules, unitFormItems } from '@/views/productionBusiness/basicData/unit/formFields/detailFields'
+ import {
+ formRules,
+ unitFormItems,
+ unitViewFormItems
+ } from '@/views/productionBusiness/basicData/unit/formFields/detailFields'
+ import tool from '../../../../../utils/tool'
const route = useRoute()
const formRef1 = ref()
let activeKey = ref('1')
let extendData = ref([])
+ let detailData = ref({})
onMounted(async () => {
formRefs.value = [formRef1.value]
- await fetchData(route.query.type)
-
+ detailData.value = await fetchData(route.query.type)
// 单位组
const unitGroupsList = await unitGroupsApi.sysUnitGroupList({
enabledState: 'ENABLE'
@@ -70,17 +90,47 @@
extendData.value = await getExtendField('MATERIAL')
})
- const onSubmitForm = () => {
+ const onSubmitFormBack = () => {
+ onSubmit(
+ {
+ isDeep: true,
+ ...formData,
+ id: detailData.value?.id,
+ extJson: JSON.stringify(extendFormData.value) || ''
+ },
+ '/basicData/unit'
+ )
+ }
+
+ const onSubmitFormAdd = () => {
onSubmit({
+ isEnable: true,
isDeep: true,
...formData,
+ id: detailData.value?.id,
extJson: JSON.stringify(extendFormData.value) || ''
+ }).then(() => {
+ // 新增清空所有的表单数据
+ initializeFormData()
+ // 保存后新增
+ if (detailData.value?.id) {
+ detailData.value.id = ''
+ }
})
}
- const { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } =
- useFormHandler([...unitFormItems], {
- submitForm: unitApi.sysUnitSubmitForm,
- getDetail: unitApi.sysUnitDetail
- })
+ const {
+ formData,
+ formRefs,
+ inform,
+ extendFormData,
+ onSubmit,
+ handleBack,
+ fetchData,
+ getExtendField,
+ initializeFormData
+ } = useFormHandler([...unitFormItems], {
+ submitForm: unitApi.sysUnitSubmitForm,
+ getDetail: unitApi.sysUnitDetail
+ })
diff --git a/src/views/productionBusiness/basicData/unit/formFields/detailFields.js b/src/views/productionBusiness/basicData/unit/formFields/detailFields.js
index 3a7b96f..1a4e3af 100644
--- a/src/views/productionBusiness/basicData/unit/formFields/detailFields.js
+++ b/src/views/productionBusiness/basicData/unit/formFields/detailFields.js
@@ -83,6 +83,44 @@ export const unitFormItems = reactive([
}
])
+export const unitViewFormItems = reactive([
+ {
+ label: '名称:',
+ name: 'name',
+ span: 1
+ },
+ {
+ label: '编码:',
+ name: 'number',
+ span: 1
+ },
+ {
+ label: '单位组:',
+ name: 'unitGroupName',
+ span: 1,
+ defaultValue: ''
+ },
+ {
+ label: '换算率:',
+ name: 'rate',
+ span: 1
+ },
+ {
+ label: '是否基本单位:',
+ name: 'isBase',
+ span: 1,
+ type: 'dict',
+ attrs: {
+ options: 'YES_NO'
+ }
+ },
+ {
+ label: '备注:',
+ name: 'remarks',
+ span: 2
+ }
+])
+
export const formRules = {
unitGroupId: [required('请选择单位')],
name: [required('请输入名称')],
diff --git a/src/views/productionBusiness/inventory/inbound/detail/detail.vue b/src/views/productionBusiness/inventory/inbound/detail/detail.vue
index 3554a50..ed48d5e 100644
--- a/src/views/productionBusiness/inventory/inbound/detail/detail.vue
+++ b/src/views/productionBusiness/inventory/inbound/detail/detail.vue
@@ -60,7 +60,6 @@
import { unitFormItems, formRules } from '@/views/productionBusiness/productionCenter/report/formFields/detailFields'
import { detailColumns, modalColumns } from '@/views/productionBusiness/productionCenter/report/columns/detailColumns'
import { cloneDeep } from 'lodash-es'
- import produceReportDetailApi from '@/api/production/produceTask/produceReportDetailApi'
import inventoryInboundApi from '@/api/inventory/inventoryInboundApi'
const route = useRoute()
@@ -119,7 +118,7 @@
inventoryInboundApi
.inventoryInboundBarcodeTree({
docsDetailId: record.id,
- docsId: record.inboundId
+ docsId: record.inboundId,
})
.then((res) => {
scanTableList.value = res
@@ -135,7 +134,7 @@
.produceReportTreeChildrenList({
docsDetailId: recordTable.id,
docsId: record.docsId,
- parentBarcode: record.barcode
+ parentBarcodeList: record.barcode
})
.then((res) => {
record.children = res
diff --git a/src/views/productionBusiness/productionCenter/report/detail/index.vue b/src/views/productionBusiness/productionCenter/report/detail/index.vue
index a15056e..87ad626 100644
--- a/src/views/productionBusiness/productionCenter/report/detail/index.vue
+++ b/src/views/productionBusiness/productionCenter/report/detail/index.vue
@@ -1,18 +1,27 @@
-
+
+ 退出
+
+
+
+ {{ detailData[item.name] }}
+ {{ tool.dictTypeData(item.attrs.options, detailData[item.name]) }}
+
+
@@ -55,19 +64,19 @@