From 1470ddceeb3f40e124b23ecd14300ce879ccab50 Mon Sep 17 00:00:00 2001
From: wangyufei <2267742828@qq.com>
Date: Thu, 4 Jul 2024 17:28:06 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E9=A2=84=E6=B5=8B=E5=91=A8?=
=?UTF-8?q?=E6=9C=9F=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../supplierManage/supplierCycle/index.vue | 28 ++-
.../supplierCycle/supplierCycle.data.ts | 210 +++++++-----------
2 files changed, 102 insertions(+), 136 deletions(-)
diff --git a/src/views/wms/basicDataManage/supplierManage/supplierCycle/index.vue b/src/views/wms/basicDataManage/supplierManage/supplierCycle/index.vue
index a20c3f4b5..7b0767b23 100644
--- a/src/views/wms/basicDataManage/supplierManage/supplierCycle/index.vue
+++ b/src/views/wms/basicDataManage/supplierManage/supplierCycle/index.vue
@@ -49,7 +49,6 @@
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
-
@@ -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';
});
diff --git a/src/views/wms/basicDataManage/supplierManage/supplierCycle/supplierCycle.data.ts b/src/views/wms/basicDataManage/supplierManage/supplierCycle/supplierCycle.data.ts
index c17d4da1d..b872a03c1 100644
--- a/src/views/wms/basicDataManage/supplierManage/supplierCycle/supplierCycle.data.ts
+++ b/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,173 +21,130 @@ export const SupplierCycle = useCrudSchemas(reactive([
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',
- 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',
+ 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',
+ value:[],
+ component:'Checkbox',
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,
+ options: [
+ {label:'星期一',value:'monday'},
+ {label:'星期二',value:'tuesday'},
+ {label:'星期三',value:'wednesday'},
+ {label:'星期四',value:'thursday'},
+ {label:'星期五',value:'friday'},
+ {label:'星期六',value:'saturday'},
+ {label:'星期日',value:'sunday'}
+ ]
+ },
+ }
},
{
label: '操作',