Browse Source

要货预测周期管理

master_hella_20240701
wangyufei 5 months ago
parent
commit
1470ddceeb
  1. 28
      src/views/wms/basicDataManage/supplierManage/supplierCycle/index.vue
  2. 210
      src/views/wms/basicDataManage/supplierManage/supplierCycle/supplierCycle.data.ts

28
src/views/wms/basicDataManage/supplierManage/supplierCycle/index.vue

@ -49,7 +49,6 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierCycle.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierCycle.allSchemas" />
@ -65,7 +64,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'SupplierCycle' }) defineOptions({ name: 'SupplierCycle' })
const message = useMessage() // const message = useMessage() //
@ -99,12 +98,13 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplierCycle:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:supplierCycle:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplierCycle:import'}), // defaultButtons.defaultAddBtn({}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierCycle:export'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:supplierCycle:import'}), //
defaultButtons.defaultFreshBtn(null), // // defaultButtons.defaultExportBtn({hasPermi:'wms:supplierCycle:export'}), //
defaultButtons.defaultFilterBtn(null), // // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), // // defaultButtons.defaultFilterBtn(null), //
// defaultButtons.defaultSetBtn(null), //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -133,7 +133,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:supplierCycle:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierCycle:update'}), //
defaultButtons.mainListEditBtn({}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierCycle:delete'}), // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierCycle:delete'}), //
] ]
@ -153,7 +154,14 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,submitData) => {
let data = {...submitData}
let cycle = data.cycle
cycle.forEach(item=>{
data[item] = 1
})
delete data.cycle
console.log('formsSuccess',formType,data)
var isHave =SupplierCycle.allSchemas.formSchema.some(function (item) { var isHave =SupplierCycle.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });

210
src/views/wms/basicDataManage/supplierManage/supplierCycle/supplierCycle.data.ts

@ -1,6 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
// 表单校验 // 表单校验
export const SupplierCycleRules = reactive({ export const SupplierCycleRules = reactive({
available: [required], available: [required],
@ -20,173 +21,130 @@ export const SupplierCycle = useCrudSchemas(reactive<CrudSchema[]>([
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
search: {
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
isSearch: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}, },
{ {
label: '星期一', label: '星期一',
field: 'monday', field: 'monday',
sort: 'custom', sort: 'custom',
isForm:false,
}, },
{ {
label: '星期二', label: '星期二',
field: 'tuesday', field: 'tuesday',
sort: 'custom', sort: 'custom',
isForm:false,
}, },
{ {
label: '星期三', label: '星期三',
field: 'wednesday', field: 'wednesday',
sort: 'custom', sort: 'custom',
isForm:false,
}, },
{ {
label: '星期四', label: '星期四',
field: 'thursday', field: 'thursday',
sort: 'custom', sort: 'custom',
isForm:false,
}, },
{ {
label: '星期五', label: '星期五',
field: 'friday', field: 'friday',
sort: 'custom', sort: 'custom',
isForm:false,
}, },
{ {
label: '星期六', label: '星期六',
field: 'saturday', field: 'saturday',
sort: 'custom', sort: 'custom',
isForm:false,
}, },
{ {
label: '星期日', label: '星期日',
field: 'sunday', field: 'sunday',
sort: 'custom', sort: 'custom',
},
{
label: '版本号',
field: 'version',
sort: 'custom',
isTable:false,
isForm:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isTable:false,
isForm:false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
isTable:false,
isForm:false,
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isTable:false,
isForm:false, isForm:false,
}, },
{ {
label: '地点ID', label: '同步周期',
field: 'siteId', field: 'cycle',
sort: 'custom', isForm:true,
isTable:false, isDetail: false,
isForm:false,
},
{
label: '开始时间',
field: 'beginTime',
sort: 'custom',
isTable:false,
isForm:false,
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '结束时间',
field: 'endTime',
sort: 'custom', sort: 'custom',
isTable:false, isTable:false,
isForm:false,
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: { form: {
component: 'DatePicker', value:[],
component:'Checkbox',
componentProps: { componentProps: {
type: 'datetime', options: [
valueFormat: 'x' {label:'星期一',value:'monday'},
} {label:'星期二',value:'tuesday'},
}, {label:'星期三',value:'wednesday'},
}, {label:'星期四',value:'thursday'},
{ {label:'星期五',value:'friday'},
label: '是否可用', {label:'星期六',value:'saturday'},
field: 'available', {label:'星期日',value:'sunday'}
sort: 'custom', ]
isTable:false, },
isForm:false, }
},
{
label: '状态',
field: 'status',
sort: 'custom',
isTable:false,
isForm:false,
form: {
component: 'Radio'
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isTable:false,
isForm:false,
},
{
label: '权限所属人员id',
field: 'ruleUserId',
sort: 'custom',
isTable:false,
isForm:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isTable:false,
isForm:false,
}, },
{ {
label: '操作', label: '操作',

Loading…
Cancel
Save