+
-
-
-
{{t('ts.批量删除')}}
+
-
-
-
{{t('批量添加')}}
+
+
+ {{
+ t('批量添加')
+ }}
@@ -349,46 +428,46 @@ const props = defineProps({
// 是否显示添加按钮
isShowButton: {
type: Boolean,
- default: true,
+ default: true
},
// 是否显示选择框 :custom="headerItem.sortable?headerItem.sortable:false"
selectionTable: {
type: Boolean,
- default: false,
+ default: false
},
// 是否显示序号
isShowIndex: {
type: Boolean,
- default: false,
+ default: false
},
// 是否显示删除按钮--多选
- isShowReduceButtonSelection:{
+ isShowReduceButtonSelection: {
type: Boolean,
- default: false,
+ default: false
},
// 是否显示删除按钮
- isShowReduceButton:{
+ isShowReduceButton: {
type: Boolean,
- default: true,
+ default: true
},
// 加载状态
tableLoading: {
type: Boolean,
- default: false,
+ default: false
},
// 列表数据
tableData: {
type: Array,
default: () => {
return []
- },
+ }
},
// 列表头定义
tableFields: {
type: Array,
default: () => {
return []
- },
+ }
},
// table高度
height: {
@@ -396,7 +475,7 @@ const props = defineProps({
default: () => {
return '200'
}
- },
+ },
maxHeight: {
type: [Number, String],
default: () => {
@@ -406,7 +485,7 @@ const props = defineProps({
// 是否有边框(可拖拽)
border: {
type: Boolean,
- default: false,
+ default: false
},
// table输入表单的rules
tableFormRules: {
@@ -418,7 +497,7 @@ const props = defineProps({
type: String,
required: false,
default: ''
- },
+ }
})
// 传递给父类
const emit = defineEmits([
@@ -444,16 +523,16 @@ const initSelectOptions = (item) => {
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions
}
//普通下拉改变事件
-const formSelectChange = (field, val,row) => {
- emit('formSelectChange', field, val,row)
+const formSelectChange = (field, val, row) => {
+ emit('formSelectChange', field, val, row)
}
// 日期改变事件
-const formFormDateChange = (field, val,row, index) => {
- emit('formFormDateChange', field, val,row, index)
+const formFormDateChange = (field, val, row, index) => {
+ emit('formFormDateChange', field, val, row, index)
}
// 普通下拉失焦事件
-const tableFormSelectOnBlur = (field, val,row,index) => {
- emit('tableFormSelectOnBlur', field, val,row,index)
+const tableFormSelectOnBlur = (field, val, row, index) => {
+ emit('tableFormSelectOnBlur', field, val, row, index)
}
// 数字输入-改变事件
const inputNumberChange = (field, index, row, e) => {
@@ -465,18 +544,18 @@ const deleteTableData = ref([])
// 点击selection框
const tableSelectionChange = (val) => {
- if(props.isShowReduceButtonSelection){
- //勾选删除
+ if (props.isShowReduceButtonSelection) {
+ //勾选删除
deleteTableData.value = val
- }else{
+ } else {
emit('tableSelectionChange', val)
}
}
-const handleSelectionDelete = ()=>{
+const handleSelectionDelete = () => {
emit('tableSelectionDelete', deleteTableData.value)
- nextTick(()=>{
- deleteTableData.value.forEach(row=>{
- TableBaseComponents_Ref.value!.toggleRowSelection(row,false)
+ nextTick(() => {
+ deleteTableData.value.forEach((row) => {
+ TableBaseComponents_Ref.value!.toggleRowSelection(row, false)
})
})
}
@@ -491,12 +570,25 @@ const tableSortChange = (column, prop, order) => {
// 行点击
const handleTableSelect = (row, column, event) => {
+ const selected = TableBaseComponents_Ref.value
+ ?.getSelectionRows()
+ .some((item) => item.id === row.id)
+ if (!selected) {
+ TableBaseComponents_Ref.value?.toggleRowSelection(row, true)
+ } else {
+ // 取消
+ TableBaseComponents_Ref.value?.toggleRowSelection(row, false)
+ }
emit('handleTableSelect', row, column, event)
}
// 某个item是否禁用
const itemIsDisabled = (colum, row) => {
- return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field])
+ return (
+ Boolean(colum.tableForm?.disabled) ||
+ Boolean(row.disabled) ||
+ Boolean(row['disabled_' + colum.field])
+ )
}
// const { t } = useI18n() // 国际化
@@ -506,25 +598,27 @@ const TableBaseComponents_Ref = ref()
const TableBaseForm_Ref = ref()
/**
- * 验证表单是否符合rules
- * @param {*} success 如果验证【成功】走的方法
- * @param {*} error 如果验证【不成功】走的方法
- */
+ * 验证表单是否符合rules
+ * @param {*} success 如果验证【成功】走的方法
+ * @param {*} error 如果验证【不成功】走的方法
+ */
const validateForm = () => {
console.log(TableBaseForm_Ref.value)
- let _lists = TableBaseForm_Ref.value?.map(v => v.validate())
- return Promise.all(_lists).then(() => {
- return true
- }).catch(() => {
- return false
- })
+ let _lists = TableBaseForm_Ref.value?.map((v) => v.validate())
+ return Promise.all(_lists)
+ .then(() => {
+ return true
+ })
+ .catch(() => {
+ return false
+ })
}
// 删除数据
const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index)
- nextTick(()=>{
- TableBaseComponents_Ref.value!.toggleRowSelection(row,false)
+ nextTick(() => {
+ TableBaseComponents_Ref.value!.toggleRowSelection(row, false)
})
}
// 添加数据
@@ -532,59 +626,67 @@ const handleAddTable = () => {
emit('handleAddTable')
}
// 输入框聚焦
-const inpuFocus = (headerItem, row, index)=>{
- if(headerItem?.tableForm?.isInpuFocusShow){
- emit('inpuFocus', headerItem, row, index)
+const inpuFocus = (headerItem, row, index) => {
+ if (headerItem?.tableForm?.isInpuFocusShow) {
+ emit('inpuFocus', headerItem, row, index)
}
}
// input输入失去焦点事件
-const inputStringBlur = (headerItem, val,row,index) => {
- emit('inputStringBlur', headerItem, val,row,index)
+const inputStringBlur = (headerItem, val, row, index) => {
+ emit('inputStringBlur', headerItem, val, row, index)
}
-const clearInput= (field, row, index) => {
- emit('clearInput',field, row, index)
+const clearInput = (field, row, index) => {
+ emit('clearInput', field, row, index)
}
//点击table操作列按钮
-const buttonOperationClick = (row, label, index)=> {
- emit("buttonOperationClick", row, label, index);
+const buttonOperationClick = (row, label, index) => {
+ emit('buttonOperationClick', row, label, index)
}
-const currentPage =ref(1)
+const currentPage = ref(1)
const pageSize = ref(10)
-const showTableData = ()=>{
- if(props.tableData.length>10){
- return props.tableData.slice((currentPage.value-1)*pageSize.value,currentPage.value*pageSize.value)
- }else{
+const showTableData = () => {
+ if (props.tableData.length > 10) {
+ return props.tableData.slice(
+ (currentPage.value - 1) * pageSize.value,
+ currentPage.value * pageSize.value
+ )
+ } else {
return props.tableData
}
}
const keyWord = ref('')
-console.log(9999,props.tableFields)
-const batchAdd = ()=>{
+console.log(9999, props.tableFields)
+const batchAdd = () => {
console.log(keyWord.value)
let field = ''
- const itemCodeFields = props.tableFields.find(item=>item.field == 'itemCode')
- const supplierFields = props.tableFields.find(item=>item.field == 'supplierCode')
- if(itemCodeFields){
+ const itemCodeFields = props.tableFields.find((item) => item.field == 'itemCode')
+ const supplierFields = props.tableFields.find((item) => item.field == 'supplierCode')
+ if (itemCodeFields) {
field = itemCodeFields.field
- }else {
- if(itemCodeFields){
+ } else {
+ if (itemCodeFields) {
field = supplierFields.field
}
}
-console.log(field)
- emit('batchAdd',keyWord.value)
+ console.log(field)
+ emit('batchAdd', keyWord.value)
}
-const disabledInput=(headerItem,row)=>{
- if(headerItem.tableForm?.isInpuFocusShow){
- if(headerItem.tableForm?.enterSearch){
+const disabledInput = (headerItem, row) => {
+ if (headerItem.tableForm?.isInpuFocusShow) {
+ if (headerItem.tableForm?.enterSearch) {
return false
- }else{
+ } else {
return true
}
- }else{
- return headerItem?.tableForm?.disabled || Boolean(row.disabled) || Boolean(row['disabled_' + headerItem.field]) ||false
+ } else {
+ return (
+ headerItem?.tableForm?.disabled ||
+ Boolean(row.disabled) ||
+ Boolean(row['disabled_' + headerItem.field]) ||
+ false
+ )
}
}
@@ -594,13 +696,12 @@ defineExpose({
validateForm,
keyWord
})
-
diff --git a/src/components/XButton/src/ButtonBase.vue b/src/components/XButton/src/ButtonBase.vue
index 5741536c4..4aa3d3700 100644
--- a/src/components/XButton/src/ButtonBase.vue
+++ b/src/components/XButton/src/ButtonBase.vue
@@ -8,7 +8,7 @@
:disabled="item.disabled"
v-hasPermi="[item.hasPermi] || []"
v-if="item.name != 'set'"
- @click="buttonBaseClick(item.name, item, $event)"
+ @click.stop="buttonBaseClick(item.name, item, $event)"
>
{{ item.label }}
From 050e600b64b4bdb03abb7c75acef11354ff770de Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Tue, 2 Jul 2024 14:21:04 +0800
Subject: [PATCH 7/9] =?UTF-8?q?WMS=E3=80=81SCP=E4=B8=AD=E6=89=80=E6=9C=89?=
=?UTF-8?q?=E5=BC=B9=E5=87=BA=E9=A1=B5=E6=9C=80=E5=A4=A7=E5=8C=96=E5=90=8E?=
=?UTF-8?q?=EF=BC=8C=E5=AE=BD=E5=BA=A6=E5=92=8C=E9=AB=98=E5=BA=A6=E9=83=BD?=
=?UTF-8?q?=E8=A6=81=E5=B1=95=E7=A4=BA=E5=88=B0=E6=98=BE=E7=A4=BA=E5=99=A8?=
=?UTF-8?q?=E7=9A=84=E6=9C=80=E5=A4=A7=E5=AE=BD=E5=BA=A6=E5=92=8C=E9=AB=98?=
=?UTF-8?q?=E5=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../strategy/arrivalInspectionStrategy/AddForm.vue | 4 ++--
.../strategySetting/strategy/batchStrategy/AddForm.vue | 4 ++--
.../strategySetting/strategy/downShelfStrategy/AddForm.vue | 4 ++--
.../strategySetting/strategy/inspectStrategy/AddForm.vue | 4 ++--
.../strategy/manageAccuracyStrategy/AddForm.vue | 4 ++--
.../strategy/purchaseReceiptStrategy/AddForm.vue | 4 ++--
.../strategy/repairMaterialStrategy/AddForm.vue | 4 ++--
.../strategy/storageCapacityStrategy/AddForm.vue | 4 ++--
.../strategy/supplieDeliveryStrategy/AddForm.vue | 4 ++--
.../strategySetting/strategy/upShelfStrategy/AddForm.vue | 4 ++--
.../strategy/utensilCapacityStrategy/AddForm.vue | 4 ++--
.../strategy/warehouseStorageStrategy/AddForm.vue | 4 ++--
.../purchasereceipt/purchasereceiptRequestMain/index.vue | 4 ++--
.../supplierdeliver/supplierdeliverRequestMain/index.vue | 4 ++--
.../supplierdeliverRequestMain.data.ts | 5 -----
15 files changed, 28 insertions(+), 33 deletions(-)
diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
index 1998ec241..e234111d0 100644
--- a/src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
+++ b/src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
@@ -1,7 +1,7 @@
-