Browse Source

要货预测周期管理

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

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

@ -49,7 +49,6 @@
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<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 ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'SupplierCycle' })
const message = useMessage() //
@ -99,12 +98,13 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplierCycle:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplierCycle:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierCycle:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierCycle:create'}), //
defaultButtons.defaultAddBtn({}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:supplierCycle:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:supplierCycle:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
// defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
@ -133,7 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:supplierCycle:update'}), //
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierCycle:update'}), //
defaultButtons.mainListEditBtn({}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierCycle:delete'}), //
]
@ -153,7 +154,14 @@ const openForm = (type: string, row?: any) => {
}
// 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) {
return item.field === 'activeTime' || item.field === 'expireTime';
});

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

@ -1,6 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
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({
available: [required],
@ -20,174 +21,131 @@ export const SupplierCycle = useCrudSchemas(reactive<CrudSchema[]>([
field: 'supplierCode',
sort: 'custom',
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: '星期一',
field: 'monday',
sort: 'custom',
isForm:false,
},
{
label: '星期二',
field: 'tuesday',
sort: 'custom',
isForm:false,
},
{
label: '星期三',
field: 'wednesday',
sort: 'custom',
isForm:false,
},
{
label: '星期四',
field: 'thursday',
sort: 'custom',
isForm:false,
},
{
label: '星期五',
field: 'friday',
sort: 'custom',
isForm:false,
},
{
label: '星期六',
field: 'saturday',
sort: 'custom',
isForm:false,
},
{
label: '星期日',
field: 'sunday',
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,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isTable:false,
isForm:false,
},
{
label: '开始时间',
field: 'beginTime',
label: '同步周期',
field: 'cycle',
isForm:true,
isDetail: false,
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',
isTable:false,
isForm:false,
formatter: dateFormatter,
search: {
component: 'DatePicker',
value:[],
component:'Checkbox',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
options: [
{label:'星期一',value:'monday'},
{label:'星期二',value:'tuesday'},
{label:'星期三',value:'wednesday'},
{label:'星期四',value:'thursday'},
{label:'星期五',value:'friday'},
{label:'星期六',value:'saturday'},
{label:'星期日',value:'sunday'}
]
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '是否可用',
field: 'available',
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: '操作',
field: 'action',

Loading…
Cancel
Save