Browse Source

BUG 修改

master
yejiaxing 10 months ago
parent
commit
05c6817911
  1. 1
      src/utils/dict.ts
  2. 37
      src/views/eam/basic/factoryArea/factoryArea.data.ts
  3. 3
      src/views/eam/basic/factoryArea/index.vue
  4. 5
      src/views/eam/basic/item/item.data.ts
  5. 56
      src/views/eam/basic/location/location.data.ts
  6. 31
      src/views/eam/basic/locationArea/index.vue
  7. 7
      src/views/eam/basic/locationArea/locationArea.data.ts
  8. 5
      src/views/eam/basic/supplier/supplier.data.ts

1
src/utils/dict.ts

@ -272,4 +272,5 @@ export enum DICT_TYPE {
LABEL_STATUS = 'label_status', // 标签状态
BIND_TYPE = 'bind_type', // 器具绑定类型
CONTAINER_STATUS = 'container_status', // 容器状态
LOCATION_AREA_TYPE = 'location_area_type', // 库区类型
}

37
src/views/eam/basic/factoryArea/factoryArea.data.ts

@ -14,6 +14,11 @@ export const FactoryArea = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
@ -21,12 +26,7 @@ export const FactoryArea = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '负责人',
@ -40,6 +40,31 @@ export const FactoryArea = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '描述',
field: 'description',

3
src/views/eam/basic/factoryArea/index.vue

@ -53,8 +53,7 @@
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="FactoryArea.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/factory-area/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">

5
src/views/eam/basic/item/item.data.ts

@ -14,6 +14,11 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',

56
src/views/eam/basic/location/location.data.ts

@ -1,5 +1,8 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import { LocationArea } from '../locationArea/locationArea.data'
// 表单校验
export const LocationRules = reactive({
number: [required],
@ -14,6 +17,11 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
@ -21,20 +29,34 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
},
{
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '库区信息', // 查询弹窗标题
searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类
searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}]
}
}
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.LOCATION_AREA_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
form: {
@ -42,12 +64,30 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '是否账内账外',
label: '是否账内',
field: 'isInAccount',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '是否可用',
field: 'available',

31
src/views/eam/basic/locationArea/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="LocationAreaRules"
:formAllSchemas="LocationArea.allSchemas"
:searchTableParams="searchTableParams"
@ -131,8 +131,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:locationArea:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:locationArea:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
@ -147,10 +147,33 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
console.log('11')
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =LocationArea.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await LocationAreaApi.createLocationArea(data)
message.success(t('common.createSuccess'))
} else {
await LocationAreaApi.updateLocationArea(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

7
src/views/eam/basic/locationArea/locationArea.data.ts

@ -14,6 +14,11 @@ export const LocationArea = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
@ -25,6 +30,8 @@ export const LocationArea = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.LOCATION_AREA_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
form: {

5
src/views/eam/basic/supplier/supplier.data.ts

@ -12,6 +12,11 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',

Loading…
Cancel
Save