Browse Source

Q1q2q3loading

hella_online_20240829
zhang_li 4 months ago
parent
commit
348072ad1e
  1. 96
      src/views/qms/inspectionQ1/index.vue
  2. 98
      src/views/qms/inspectionQ2/index.vue
  3. 96
      src/views/qms/inspectionQ3/index.vue

96
src/views/qms/inspectionQ1/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Q1.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Q1.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -33,7 +37,10 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -54,7 +61,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q1.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/Q1/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/basic/Q1/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -84,7 +96,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if (formField == 'customerCode') {
setV['itemCode'] = '';
setV['itemCode'] = ''
}
if (formField == 'itemCode') {
setV['uom'] = val[0]['customerUom']
@ -92,8 +104,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
@ -115,7 +125,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q1:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -128,16 +138,22 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -153,19 +169,31 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:delete'}), //
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:finish'}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q1:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q1:delete'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q1:finish'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}else if (val == 'finish') { //
} else if (val == 'finish') {
//
handleFinish(row.id)
}
}
@ -185,38 +213,39 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type == 'create') {
nextTick(() => {
    basicFormRef.value.formRef.setValues({
basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
claimTime: new Date().getTime(),
priority: '3',
    })
  })
priority: '3'
})
})
}
 
}
// form
const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id
var isHave = Q1.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.qty == 0) {
message.error('数量不能为0')
return;
return
}
if (data.claimAmount == 0) {
message.error('索赔金额不能为0')
return;
return
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await Q1Api.createQ1(data)
message.success(t('common.createSuccess'))
@ -225,7 +254,11 @@ const formsSuccess = async (formType, data) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
@ -292,5 +325,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await Q1Api.importTemplate()
})
</script>

98
src/views/qms/inspectionQ2/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Q2.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Q2.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -33,7 +37,10 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -54,7 +61,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q2.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/Q2/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/basic/Q2/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -84,7 +96,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if (formField == 'supplierCode') {
setV['itemCode'] = '';
setV['itemCode'] = ''
}
if (formField == 'itemCode') {
setV['uom'] = val[0]['supplierUom']
@ -99,7 +111,7 @@ if (formField == 'purchaseReceiptNumber') {
if (formField == 'q1Number') {
//Q1
let list = []
val.forEach(item=>{
val.forEach((item) => {
list.push(item[searchField])
})
setV[formField] = list.join(',')
@ -130,7 +142,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q2:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -143,16 +155,22 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -168,19 +186,31 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:delete'}), //
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:finish'}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q2:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q2:delete'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q2:finish'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}else if (val == 'finish') { //
} else if (val == 'finish') {
//
handleFinish(row.id)
}
}
@ -200,12 +230,12 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type == 'create') {
nextTick(() => {
    basicFormRef.value.formRef.setValues({
basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
claimTime: new Date().getTime(),
priority: '3',
    })
  })
priority: '3'
})
})
}
}
@ -213,28 +243,31 @@ nextTick(() => {
const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id
var isHave = Q2.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.qty > data.wmsQty) {
message.error('数量不能大于记录中的收货数量')
return;
return
}
if (data.qty == 0) {
message.error('数量不能为0')
return;
return
}
if (data.claimAmount == 0) {
message.error('索赔金额不能为0')
return;
return
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await Q2Api.createQ2(data)
message.success(t('common.createSuccess'))
@ -243,7 +276,11 @@ message.error('数量不能大于记录中的收货数量')
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
@ -310,5 +347,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await Q2Api.importTemplate()
})
</script>

96
src/views/qms/inspectionQ3/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Q3.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Q3.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -33,7 +37,10 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -54,7 +61,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q3.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/Q3/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/basic/Q3/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -84,13 +96,13 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if (formField == 'itemCode') {
console.log(val);
console.log(val)
setV['uom'] = val[0]['uom']
}
if (formField == 'q1Number') {
//Q1
let list = []
val.forEach(item=>{
val.forEach((item) => {
list.push(item[searchField])
})
setV[formField] = list.join(',')
@ -121,7 +133,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q3:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -134,16 +146,22 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -159,19 +177,31 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:delete'}), //
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:finish'}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:delete'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:finish'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}else if (val == 'finish') { //
} else if (val == 'finish') {
//
handleFinish(row.id)
}
}
@ -191,11 +221,11 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type == 'create') {
nextTick(() => {
    basicFormRef.value.formRef.setValues({
basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
priority: '3',
    })
  })
priority: '3'
})
})
}
}
@ -203,24 +233,27 @@ nextTick(() => {
const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id
var isHave = Q3.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.qty == 0) {
message.error('数量不能为0')
return;
return
}
if (data.amount == 0) {
message.error('金额不能为0')
return;
return
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await Q3Api.createQ3(data)
message.success(t('common.createSuccess'))
@ -229,7 +262,11 @@ const formsSuccess = async (formType, data) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
@ -296,5 +333,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await Q3Api.importTemplate()
})
</script>

Loading…
Cancel
Save