Browse Source

Merge branch 'intex' into intex_online_yejiaxing

intex_online_yejiaxing
songguoqiang 2 weeks ago
parent
commit
5904a55b66
  1. 3
      src/views/wms/countManage/count/countConfig/countConfig.data.ts
  2. 78
      src/views/wms/countManage/count/countConfig/index.vue

3
src/views/wms/countManage/count/countConfig/countConfig.data.ts

@ -146,7 +146,8 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
component: 'InputNumber', component: 'InputNumber',
value: 0, value: 0,
componentProps: { componentProps: {
min:0, disabled: true,
min:1,
precision:2 precision:2
} }
}, },

78
src/views/wms/countManage/count/countConfig/index.vue

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CountConfig.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="CountConfig.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -47,6 +51,7 @@
:apiUpdate="CountConfigApi.updateCountConfig" :apiUpdate="CountConfigApi.updateCountConfig"
:apiCreate="CountConfigApi.createCountConfig" :apiCreate="CountConfigApi.createCountConfig"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@clearSearchInput="clearSearchInput"
:isBusiness="false" :isBusiness="false"
/> />
@ -54,7 +59,8 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="CountConfig.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="CountConfig.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" <ImportForm
ref="importFormRef"
url="/wms/count-config/import" url="/wms/count-config/import"
:importTemplateData="importTemplateData" :importTemplateData="importTemplateData"
@success="importSuccess" @success="importSuccess"
@ -95,7 +101,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
setV['uom'] = val[0].uom setV['uom'] = val[0].uom
setV['packUnit'] = val[0].defaultPackUnit setV['packUnit'] = val[0].defaultPackUnit
setV['packQty'] = val[0].defaultPackQty setV['packQty'] = val[0].defaultPackQty
if (val[0].convertRate == null) {
setV['conversionRate'] = 1.0
} else {
setV['conversionRate'] = val[0].convertRate
}
} }
formRef.setValues(setV) formRef.setValues(setV)
}) })
@ -120,7 +130,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-config:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-config:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -133,16 +143,22 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
@ -150,14 +166,16 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn(), // defaultButtons.mainListEditBtn(), //
defaultButtons.mainListDeleteBtn(), // defaultButtons.mainListDeleteBtn() //
] ]
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -166,15 +184,15 @@ const buttonTableClick = async (val, row) => {
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
if (type == 'create') { if (type == 'create') {
CountConfig.allSchemas.formSchema.forEach(item =>{ CountConfig.allSchemas.formSchema.forEach((item) => {
if(item.field == "itemCode"){ if (item.field == 'itemCode') {
item.componentProps.isSearchList = true item.componentProps.isSearchList = true
item.componentProps.disabled = false item.componentProps.disabled = false
} }
}) })
} else if (type == 'update') { } else if (type == 'update') {
CountConfig.allSchemas.formSchema.forEach(item =>{ CountConfig.allSchemas.formSchema.forEach((item) => {
if(item.field == "itemCode"){ if (item.field == 'itemCode') {
item.componentProps.isSearchList = false item.componentProps.isSearchList = false
item.componentProps.disabled = true item.componentProps.disabled = true
} }
@ -186,16 +204,16 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
var isHave = CountConfig.allSchemas.formSchema.some(function (item) { var isHave = CountConfig.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if (isHave) { if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { if (formType === 'create') {
await CountConfigApi.createCountConfig(data) await CountConfigApi.createCountConfig(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -257,6 +275,21 @@ const importSuccess = () => {
getList() getList()
} }
const clearSearchInput = (formField) => {
if (formField == 'itemCode') {
//
basicFormRef.value.formRef.setValues({
itemName: '',
desc1: '',
uom: '',
packUnit: '',
packQty: '',
conversionRate: 1
})
// tableData.value = []
}
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
@ -271,5 +304,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await CountConfigApi.importTemplate() importTemplateData.templateUrl = await CountConfigApi.importTemplate()
}) })
</script> </script>

Loading…
Cancel
Save