Browse Source

Q1q2q3loading

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

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

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Q1.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Q1.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Q1.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Q1.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</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,12 +61,17 @@
<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">
import download from '@/utils/download'
import { Q1,Q1Rules } from './inspectionQ1.data'
import { Q1, Q1Rules } from './inspectionQ1.data'
import * as Q1Api from '@/api/qms/inspectionQ1'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -81,19 +93,17 @@ const tableColumns = ref(Q1.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if(formField == 'customerCode'){
setV['itemCode'] = '';
nextTick(() => {
const setV = {}
if (formField == 'customerCode') {
setV['itemCode'] = ''
}
if(formField == 'itemCode'){
if (formField == 'itemCode') {
setV['uom'] = val[0]['customerUom']
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
})
}
//
@ -110,12 +120,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:Q1:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q1:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q1:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q1:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q1:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q1:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -128,21 +138,27 @@ 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)
}
}
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -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)
}
}
@ -183,49 +211,54 @@ const handleFinish = async (id: number) => {
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type=='create') {
nextTick(() => {
    basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
claimTime: new Date().getTime(),
priority: '3',
    })
  })
if (type == 'create') {
nextTick(() => {
basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
claimTime: new Date().getTime(),
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';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
var isHave = Q1.allSchemas.formSchema.some(function (item) {
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;
if (data.qty == 0) {
message.error('数量不能为0')
return
}
if (data.claimAmount==0) {
message.error('索赔金额不能为0')
return;
if (data.claimAmount == 0) {
message.error('索赔金额不能为0')
return
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await Q1Api.createQ1(data)
message.success(t('common.createSuccess'))
} else {
await Q1Api.updateQ1(data)
message.success(t('common.updateSuccess'))
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'))
} else {
await Q1Api.updateQ1(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
@ -292,5 +325,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await Q1Api.importTemplate()
})
</script>

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

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Q2.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Q2.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Q2.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Q2.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</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,12 +61,17 @@
<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">
import download from '@/utils/download'
import { Q2,Q2Rules } from './inspectionQ2.data'
import { Q2, Q2Rules } from './inspectionQ2.data'
import * as Q2Api from '@/api/qms/inspectionQ2'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -81,34 +93,34 @@ const tableColumns = ref(Q2.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if(formField == 'supplierCode'){
setV['itemCode'] = '';
nextTick(() => {
const setV = {}
if (formField == 'supplierCode') {
setV['itemCode'] = ''
}
if(formField == 'itemCode'){
if (formField == 'itemCode') {
setV['uom'] = val[0]['supplierUom']
}
// if (formField == 'q1Number') {
// console.log(123)
// setV['q1Number'] = val[0]['number']
// }
if (formField == 'purchaseReceiptNumber') {
}
// if (formField == 'q1Number') {
// console.log(123)
// setV['q1Number'] = val[0]['number']
// }
if (formField == 'purchaseReceiptNumber') {
setV['wmsQty'] = val[0]['qty']
}
if(formField == 'q1Number'){
}
if (formField == 'q1Number') {
//Q1
let list = []
val.forEach(item=>{
val.forEach((item) => {
list.push(item[searchField])
})
setV[formField] = list.join(',')
formRef.setValues(setV)
}else{
} else {
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
})
}
//
@ -125,12 +137,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:Q2:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q2:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q2:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q2:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q2:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q2:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -143,21 +155,27 @@ 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)
}
}
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -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)
}
}
@ -198,52 +228,59 @@ const handleFinish = async (id: number) => {
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type=='create') {
nextTick(() => {
    basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
claimTime: new Date().getTime(),
priority: '3',
    })
  })
if (type == 'create') {
nextTick(() => {
basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
claimTime: new Date().getTime(),
priority: '3'
})
})
}
}
// form
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';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
var isHave = Q2.allSchemas.formSchema.some(function (item) {
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;
if (data.qty > data.wmsQty) {
message.error('数量不能大于记录中的收货数量')
return
}
if (data.qty==0) {
message.error('数量不能为0')
return;
if (data.qty == 0) {
message.error('数量不能为0')
return
}
if (data.claimAmount==0) {
message.error('索赔金额不能为0')
return;
if (data.claimAmount == 0) {
message.error('索赔金额不能为0')
return
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await Q2Api.createQ2(data)
message.success(t('common.createSuccess'))
} else {
await Q2Api.updateQ2(data)
message.success(t('common.updateSuccess'))
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'))
} else {
await Q2Api.updateQ2(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
@ -310,5 +347,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await Q2Api.importTemplate()
})
</script>

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

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Q3.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Q3.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Q3.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Q3.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</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,12 +61,17 @@
<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">
import download from '@/utils/download'
import { Q3,Q3Rules } from './inspectionQ3.data'
import { Q3, Q3Rules } from './inspectionQ3.data'
import * as Q3Api from '@/api/qms/inspectionQ3'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -81,25 +93,25 @@ const tableColumns = ref(Q3.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
nextTick(() => {
const setV = {}
if(formField == 'itemCode'){
console.log(val);
if (formField == 'itemCode') {
console.log(val)
setV['uom'] = val[0]['uom']
}
if(formField == 'q1Number'){
}
if (formField == 'q1Number') {
//Q1
let list = []
val.forEach(item=>{
val.forEach((item) => {
list.push(item[searchField])
})
setV[formField] = list.join(',')
formRef.setValues(setV)
}else{
} else {
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
})
}
//
@ -116,12 +128,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:Q3:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q3:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q3:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q3:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q3:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q3:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -134,21 +146,27 @@ 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)
}
}
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -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)
}
}
@ -189,47 +219,54 @@ const handleFinish = async (id: number) => {
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type=='create') {
nextTick(() => {
    basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
priority: '3',
    })
  })
if (type == 'create') {
nextTick(() => {
basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(),
priority: '3'
})
})
}
}
// form
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';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
var isHave = Q3.allSchemas.formSchema.some(function (item) {
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;
if (data.qty == 0) {
message.error('数量不能为0')
return
}
if (data.amount==0) {
message.error('金额不能为0')
return;
if (data.amount == 0) {
message.error('金额不能为0')
return
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await Q3Api.createQ3(data)
message.success(t('common.createSuccess'))
} else {
await Q3Api.updateQ3(data)
message.success(t('common.updateSuccess'))
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'))
} else {
await Q3Api.updateQ3(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
@ -296,5 +333,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await Q3Api.importTemplate()
})
</script>

Loading…
Cancel
Save