Browse Source

qms加loading

hella_online_20240829
zhang_li 3 months ago
parent
commit
c720bdb095
  1. 124
      src/views/qms/aql/index.vue
  2. 68
      src/views/qms/counter/index.vue
  3. 121
      src/views/qms/dynamicRule/index.vue
  4. 2
      src/views/qms/inspectionJob/index.vue
  5. 83
      src/views/qms/inspectionMethod/index.vue
  6. 2
      src/views/qms/inspectionRecordFirst/index.vue
  7. 189
      src/views/qms/inspectionRequest/index.vue
  8. 82
      src/views/qms/inspectionScheme/index.vue
  9. 61
      src/views/qms/inspectionStage/index.vue
  10. 78
      src/views/qms/inspectionTemplate/index.vue
  11. 2
      src/views/qms/qualityNotice/index.vue
  12. 81
      src/views/qms/sampleCode/index.vue
  13. 173
      src/views/qms/samplingProcess/index.vue
  14. 76
      src/views/qms/samplingScheme/index.vue
  15. 58
      src/views/qms/selectedProject/index.vue
  16. 125
      src/views/qms/selectedSet/index.vue

124
src/views/qms/aql/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Aql.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Aql.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -55,7 +63,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Aql.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/aql/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/aql/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -105,7 +118,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:aql:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -118,16 +131,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)
}
}
@ -143,22 +162,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:aql:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:aql:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:aql:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:aql:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:aql:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:aql:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:aql:delete' }) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
}else if (val == 'delete') { //
    handleDelete(row.id)
  }
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
@ -169,17 +196,19 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
try {
var isHave = Aql.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.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
basicFormRef.value.formLoading = true
if (formType === 'create') {
await AqlApi.createAql(data)
message.success(t('common.createSuccess'))
@ -188,7 +217,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
}
}
/** 详情操作 */
@ -268,51 +301,50 @@ const searchFormClick = (searchData) => {
const onChange = async (field, value, formRef) => {
// "a"
if (field.startsWith("a") || field.startsWith("r")) {
if (field.startsWith('a') || field.startsWith('r')) {
// "a"
const suffix = field.slice(1);
const suffix = field.slice(1)
// "r"
const correspondingField = field.startsWith("a") ? "r" + suffix : "a" + suffix ;
const correspondingField = field.startsWith('a') ? 'r' + suffix : 'a' + suffix
// "r"
if (value) {
// "r"
Aql.allSchemas.formSchema.forEach(item => {
Aql.allSchemas.formSchema.forEach((item) => {
if (item.field === correspondingField) {
const setV = {};
if(correspondingField.startsWith("r")){
setV[correspondingField] = parseInt(value) + 1;
const setV = {}
if (correspondingField.startsWith('r')) {
setV[correspondingField] = parseInt(value) + 1
} else {
setV[correspondingField] = parseInt(value) - 1;
setV[correspondingField] = parseInt(value) - 1
}
item.componentProps.disabled = true;
item.componentProps.disabled = true
// 使 Vue nextTick DOM
nextTick(() => {
formRef.value.setValues(setV);
});
formRef.value.setValues(setV)
})
}
});
})
} else {
Aql.allSchemas.formSchema.forEach(item => {
Aql.allSchemas.formSchema.forEach((item) => {
if (item.field === correspondingField || item.field === field) {
item.componentProps.disabled = false;
const setV = {};
item.componentProps.disabled = false
const setV = {}
setV[correspondingField] = ''
nextTick(() => {
formRef.value.setValues(setV);
});
formRef.value.setValues(setV)
})
}
})
}
});
}
}
};
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await AqlApi.importTemplate()
})
</script>

68
src/views/qms/counter/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Counter.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Counter.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -54,7 +59,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Counter.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/counter/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/counter/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -104,7 +114,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:counter:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -115,34 +125,41 @@ 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 butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'qms:counter:update'}), //
defaultButtons.mainListEditBtn({ hasPermi: 'qms:counter:update' }) //
// defaultButtons.mainListDeleteBtn({hasPermi:'qms:counter:delete'}), //
]
// -
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)
}
}
@ -163,17 +180,19 @@ const openForm = async (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
try {
var isHave = Counter.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.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
basicFormRef.value.formLoading = true
if (formType === 'create') {
await CounterApi.createCounter(data)
message.success(t('common.createSuccess'))
@ -182,7 +201,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
}
}
/** 详情操作 */
@ -246,11 +269,10 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await CounterApi.importTemplate()
})
</script>

121
src/views/qms/dynamicRule/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DynamicRule.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="DynamicRule.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -100,7 +108,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import UploadFile from '@/components/UploadFile/src/UploadFile.vue'
import { checkPermi } from '@/utils/permission'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue";
import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
@ -146,7 +154,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:dynamic-rule:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -159,16 +167,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)
}
}
@ -184,17 +198,25 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:dynamic-rule:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:dynamic-rule:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:dynamic-rule:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:dynamic-rule:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:dynamic-rule:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:dynamic-rule:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:dynamic-rule:delete' }) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
editForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
@ -212,24 +234,26 @@ const openForm = async (type: string, row?: any) => {
const editForm = async (type: string, row?: any) => {
tableData.value = []
detailMasterId.value = row.id
InspectionStageApi.getInspectionStageNoPage({masterId:row.id}).then(res=>{
InspectionStageApi.getInspectionStageNoPage({ masterId: row.id }).then((res) => {
tableData.value = res
})
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
try {
var isHave = DynamicRule.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.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
basicFormRef.value.formLoading = true
if (formType === 'create') {
await DynamicRuleApi.createDynamicRule(data)
message.success(t('common.createSuccess'))
@ -238,7 +262,11 @@ const formsSuccess = async (formType,data) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} catch {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
@ -331,11 +359,10 @@ const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
const flag = validateNotRepetition(tableData.value);
const emptyFlag = validateDetailEmpty(tableData.value);
const flag = validateNotRepetition(tableData.value)
const emptyFlag = validateDetailEmpty(tableData.value)
if (!emptyFlag) {
message.alertWarning('明细不能为空')
basicFormRef.value.formLoading = false
@ -348,6 +375,7 @@ const submitForm = async (formType, data) => {
}
data.inspectionStageDOList = tableData.value //
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await DynamicRuleApi.createDynamicRule(data)
message.success(t('common.createSuccess'))
@ -356,6 +384,7 @@ const submitForm = async (formType, data) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
//
getList()
} finally {
@ -364,7 +393,7 @@ const submitForm = async (formType, data) => {
}
const detailValidate = (type, data) => {
let tag = true;
let tag = true
if (!validateIfRepeat(type, data)) {
tag = false
message.alertWarning('动态规则阶段不能重复')
@ -374,49 +403,49 @@ const detailValidate = (type,data) => {
const detailOpenForm = (type, row, masterParmas) => {
detailMasterId.value = masterParmas.masterId
InspectionStageApi.getInspectionStageNoPage({masterId:masterParmas.masterId}).then(res=>{
InspectionStageApi.getInspectionStageNoPage({ masterId: masterParmas.masterId }).then((res) => {
detailList.value = res
})
}
const validateIfRepeat = (type, data) => {
let mergedArray: any[] = [];
let mergedArray: any[] = []
if (type == 'create') {
mergedArray = [data, ...detailList.value];
}if(type == 'update'){
detailList.value = detailList.value.filter(item => item.id !== data.id);
mergedArray = [data, ...detailList.value];
mergedArray = [data, ...detailList.value]
}
if (type == 'update') {
detailList.value = detailList.value.filter((item) => item.id !== data.id)
mergedArray = [data, ...detailList.value]
}
const stageSet = new Set(mergedArray.map(item => item.stage));
return stageSet.size === mergedArray.length;
const stageSet = new Set(mergedArray.map((item) => item.stage))
return stageSet.size === mergedArray.length
}
const validateDetailEmpty = (data) => {
const codes = data.map(item => item.stage);
const codes = data.map((item) => item.stage)
if (codes.length == 0) {
return false;
return false
}
return true;
return true
}
const validateNotRepetition = (data) => {
// dictionaryTypeAndCode
const codes = data.map(item => item.stage);
const codes = data.map((item) => item.stage)
// Set dictionaryTypeAndCode
const uniqueCodes = new Set(codes);
const uniqueCodes = new Set(codes)
// Set
if (codes.length > uniqueCodes.size) {
return false; // false
return false // false
}
return true // true
}
return true; // true
};
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await DynamicRuleApi.importTemplate()
})
</script>

2
src/views/qms/inspectionJob/index.vue

@ -389,6 +389,7 @@ const tableData = ref([])
const submitForm = async (formType, data) => {
// return
try {
formRef.value.formLoading = true
if (formType === 'create') {
await InspectionJobMainApi.createInspectionJobMain(data)
message.success(t('common.createSuccess'))
@ -397,6 +398,7 @@ const submitForm = async (formType, data) => {
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
formRef.value.formLoading = false
//
getList()
} finally {

83
src/views/qms/inspectionMethod/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionMethod.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="InspectionMethod.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -42,12 +50,14 @@
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:sumFormDataByForm ="(formRef,formModel)=>{
:sumFormDataByForm="
(formRef, formModel) => {
const { videoAddress } = formModel
formRef.value.setValues({
installPackageUrl: videoAddress
})
}"
}
"
:rules="InspectionMethodRules"
:formAllSchemas="InspectionMethod.allSchemas"
:apiUpdate="InspectionMethodApi.updateInspectionMethod"
@ -118,7 +128,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-method:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -131,16 +141,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)
}
}
@ -156,17 +172,25 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:inspection-method:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:inspection-method:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:inspection-method:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:inspection-method:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:inspection-method:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:inspection-method:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:inspection-method:delete' }) //
]
}
// -
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 == 'enable') {
handleEnable(row.id)
@ -192,8 +216,10 @@ const openForm = (type: string, row?: any) => {
}
if (type == 'create') {
const currentTime = new Date().getTime()
const fileId = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='fileId')
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress')
const fileId = InspectionMethod.allSchemas.formSchema.find((item) => item.field == 'fileId')
const uploadFile = InspectionMethod.allSchemas.formSchema.find(
(item) => item.field == 'videoAddress'
)
if (fileId) {
fileId['value'] = currentTime
}
@ -202,17 +228,19 @@ const openForm = (type: string, row?: any) => {
uploadFile['componentProps']['modelValue'] = []
}
} else if (type == 'update') {
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress')
const uploadFile = InspectionMethod.allSchemas.formSchema.find(
(item) => item.field == 'videoAddress'
)
uploadFile['componentProps']['modelValue'] = row.filePathListView
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
delete data['uploadFile']
await InspectionMethodApi.createInspectionMethod(data)
message.success(t('common.createSuccess'))
@ -222,7 +250,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
}
}
/** 详情操作 */
@ -302,11 +334,10 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await InspectionMethodApi.importTemplate()
})
</script>

2
src/views/qms/inspectionRecordFirst/index.vue

@ -244,6 +244,7 @@ const handleMainExport = async (row: any) => {
const submitForm = async (formType, data) => {
// data.subList = tableData.value //
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await InspectionRecordMainApi.createInspectionRecordMain(data)
message.success(t('common.createSuccess'))
@ -252,6 +253,7 @@ const handleMainExport = async (row: any) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
//
getList()
} finally {

189
src/views/qms/inspectionRequest/index.vue

@ -2,27 +2,47 @@
<div>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="InspectionMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="InspectionMain.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<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>
@ -48,20 +68,34 @@
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/request/inspection-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<!-- 包装信息 -->
<ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionMain.allSchemas"
:detailAllSchemas="InspectionRequestPackage.allSchemas" :detailAllSchemasRules="InspectionRequestPackageRules"
:list="list" @ListTableSubmit='ListTableSubmit'/>
<ListTable
ref="listTableRef"
titleName="包装信息"
:allSchemas="InspectionMain.allSchemas"
:detailAllSchemas="InspectionRequestPackage.allSchemas"
:detailAllSchemasRules="InspectionRequestPackageRules"
:list="list"
@ListTableSubmit="ListTableSubmit"
/>
</div>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionMain, InspectionMainRules,InspectionRequestPackage,InspectionRequestPackageRules } from './inspectionRequestMain.data'
import {
InspectionMain,
InspectionMainRules,
InspectionRequestPackage,
InspectionRequestPackageRules
} from './inspectionRequestMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as InspectionRequestPackageApi from '@/api/qms/inspectionRequest/InspectionRequestPackage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -117,7 +151,7 @@
// defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -130,18 +164,24 @@
//
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') {
//
tableObject.params.isSearch = false
tableObject.params.filters = ''
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -157,38 +197,68 @@
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), hasPermi: 'qms:inspection-request-main:close' }), //
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']),
hasPermi: 'qms:inspection-request-main:close'
}), //
// defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['5']), hasPermi: 'qms:inspection-request-main:reAdd' }), //
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-request-main:submit' }), //
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:refused' }), //
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:agree' }), //
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']), hasPermi: 'qms:inspection-request-main:handle' }), //
defaultButtons.mainListSubmitBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-request-main:submit'
}), //
defaultButtons.mainListTurnDownBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-request-main:refused'
}), //
defaultButtons.mainListApproveBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-request-main:agree'
}), //
defaultButtons.mainListHandleBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: 'qms:inspection-request-main:handle'
}), //
defaultButtons.mainListPackageBtn(null), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-request-main:edit'}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-request-main:edit'
}) //
]
}
const listTableRef = ref()
const list = ref([])
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
if (val == 'mainClose') {
//
handleClose(row.id)
} else if (val == 'mainReAdd') { //
} else if (val == 'mainReAdd') {
//
handleReAdd(row.id)
} else if (val == 'mainSubmit') { //
} else if (val == 'mainSubmit') {
//
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { //
} else if (val == 'mainTurnDown') {
//
handleRefused(row.id)
} else if (val == 'mainApprove') { //
} else if (val == 'mainApprove') {
//
handleAgree(row.id)
} else if (val == 'mainHandle') { //
} else if (val == 'mainHandle') {
//
handleHandle(row.id)
} else if (val == 'edit') { //
} else if (val == 'edit') {
//
openForm('update', row)
}else if (val == 'mainPackage') { //
} else if (val == 'mainPackage') {
//
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(row.id)
// row.status = '1'
listTableRef.value.openPackage(row,'包装信息',InspectionRequestPackage.allSchemas.tableColumns)
listTableRef.value.openPackage(
row,
'包装信息',
InspectionRequestPackage.allSchemas.tableColumns
)
}
}
@ -200,10 +270,10 @@ const list = ref([])
await InspectionMainApi.closeInspectRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
/** 重新添加按钮操作 */
@ -214,7 +284,8 @@ const list = ref([])
await InspectionMainApi.reAddInspectRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -227,7 +298,8 @@ const list = ref([])
await InspectionMainApi.agreeInspectRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -240,7 +312,8 @@ const list = ref([])
await InspectionMainApi.refusedInspectRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -253,7 +326,8 @@ const list = ref([])
await InspectionMainApi.handleInspectRequestMain(id)
message.success(t('common.dealwithSuccess'))
await getList()
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -266,7 +340,8 @@ const list = ref([])
await InspectionMainApi.submitInspectRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -281,18 +356,23 @@ const list = ref([])
// form
const submitForm = async (formType, data) => {
var isHave = InspectionMain.allSchemas.formSchema.some(function (item) {
return item.field === 'requestStartTime' || item.field === 'requestEndTime';
});
return item.field === 'requestStartTime' || item.field === 'requestEndTime'
})
if (isHave) {
if (data.requestStartTime && data.requestEndTime && data.requestStartTime >= data.requestEndTime) {
if (
data.requestStartTime &&
data.requestEndTime &&
data.requestStartTime >= data.requestEndTime
) {
message.error('要求结束时间要大于要求开始时间')
return;
return
}
}
if (data.requestStartTime == 0) data.requestStartTime = null;
if (data.requestEndTime == 0) data.requestEndTime = null;
if (data.requestStartTime == 0) data.requestStartTime = null
if (data.requestEndTime == 0) data.requestEndTime = null
data.inspectionRequestPackageCreateReqVO = tableData.value //
try {
formRef.value.formLoading = true
if (formType === 'create') {
await InspectionMainApi.createInspectionMain(data)
message.success(t('common.createSuccess'))
@ -301,6 +381,7 @@ const list = ref([])
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
formRef.value.formLoading = false
getList()
} finally {
formRef.value.formLoading = false
@ -369,7 +450,7 @@ const list = ref([])
* tableForm方法
*/
const tableFormKeys = {}
InspectionRequestPackage.allSchemas.tableFormColumns.forEach(item => {
InspectionRequestPackage.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
@ -398,9 +479,9 @@ console.log(formType,data)
}
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await InspectionMainApi.importTemplate()
})

82
src/views/qms/inspectionScheme/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionSchemeMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="InspectionSchemeMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -61,15 +69,20 @@
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionSchemeMain } from './inspectionScheme.data'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../inspectionTemplate/inspectionTemplate.data'
import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from '../inspectionTemplate/inspectionTemplate.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue'
import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue";
import * as SampleCodeApi from "@/api/qms/sampleCode";
import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
import * as SampleCodeApi from '@/api/qms/sampleCode'
defineOptions({ name: 'InspectionScheme' })
@ -100,7 +113,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-scheme:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -113,16 +126,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)
}
}
@ -138,18 +157,26 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:inspection-scheme:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:inspection-scheme:enable'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:inspection-scheme:disable'}),
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:inspection-scheme:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:inspection-scheme:disable'
}),
defaultButtons.mainCopyBtn({ hasPermi: 'qms:programme-template:copy' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:inspection-scheme:delete'}), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:inspection-scheme:delete' }) //
]
}
// -
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 == 'enable') {
handleEnable(row.id)
@ -172,12 +199,12 @@ const openForm = (type: string, row?: any) => {
// form
const submitForm = async (formType, data) => {
var isHave = InspectionSchemeMain.allSchemas.formSchema.some(function (item) {
return item.field === 'effectiveDate' || item.field === 'expirationDate';
});
return item.field === 'effectiveDate' || item.field === 'expirationDate'
})
if (isHave) {
if (data.effectiveDate && data.expirationDate && data.effectiveDate >= data.expirationDate) {
message.error('失效时间要大于生效时间')
return;
return
}
}
const data1 = {
@ -199,6 +226,8 @@ const submitForm = async (formType,data) => {
available: data.available,
content: JSON.stringify(data.process)
}
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await InspectionSchemeApi.InspectionSchemeCreat(data1)
message.success(t('common.createSuccess'))
@ -207,7 +236,11 @@ const submitForm = async (formType,data) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
@ -287,11 +320,10 @@ const importSuccess = () => {
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await InspectionSchemeApi.importTemplate()
})
</script>

61
src/views/qms/inspectionStage/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionStage.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="InspectionStage.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -54,7 +59,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionStage.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/inspection-stage/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/inspection-stage/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -104,7 +114,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionStage:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -117,16 +127,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)
}
}
@ -134,14 +150,16 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({ hasPermi: 'wms:inspectionStage:update' }), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inspectionStage:delete'}), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:inspectionStage:delete' }) //
]
// -
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)
}
}
@ -155,16 +173,18 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = InspectionStage.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.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 InspectionStageApi.createInspectionStage(data)
message.success(t('common.createSuccess'))
@ -173,7 +193,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
}
}
/** 详情操作 */
@ -240,5 +264,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await InspectionStageApi.importTemplate()
})
</script>

78
src/views/qms/inspectionTemplate/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionTemplateMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="InspectionTemplateMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -49,11 +57,7 @@
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="true"
:allSchemas="InspectionTemplateMain.allSchemas"
/>
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionTemplateMain.allSchemas" />
<!-- 导入 -->
<ImportForm
@ -69,7 +73,12 @@
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from './inspectionTemplate.data'
import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from './inspectionTemplate.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -106,7 +115,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:programme-template:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -119,16 +128,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)
}
}
@ -160,18 +175,26 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:programme-template:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:programme-template:enable'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:programme-template:disable'}),
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:programme-template:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:programme-template:disable'
}),
defaultButtons.mainCopyBtn({ hasPermi: 'qms:programme-template:copy' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:programme-template:delete'}), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:programme-template:delete' }) //
]
}
// -
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 == 'enable') {
handleEnable(row.id)
@ -190,6 +213,8 @@ const openForm = (type: string, row?: any) => {
// form
const submitForm = async (formType, data) => {
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await InspectionProcessPageApi.inspectionTemplateCreat(data.value)
message.success(t('common.createSuccess'))
@ -198,7 +223,11 @@ const submitForm = async (formType,data) => {
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
@ -263,11 +292,10 @@ const importSuccess = () => {
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await InspectionProcessPageApi.importTemplate()
})
</script>

2
src/views/qms/qualityNotice/index.vue

@ -184,6 +184,7 @@
//
const submitForm = async (formType, data) => {
try {
formRef.value.formLoading = true
if (formType === 'create') {
await qualityNoticeApi.qualityNoticeCreat(data)
message.success(t('common.createSuccess'))
@ -192,6 +193,7 @@
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
formRef.value.formLoading = false
//
getList()
} finally {

81
src/views/qms/sampleCode/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SampleCode.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="SampleCode.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -55,7 +63,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SampleCode.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/sample-code/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/sample-code/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -105,7 +118,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:sample-code:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -118,13 +131,17 @@ 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') {
//
tableObject.params.isSearch = false
tableObject.params.filters = ''
// tableObject.params = {
@ -132,8 +149,10 @@ const buttonBaseClick = (val, item) => {
// filters: searchData.filters
// }
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -149,18 +168,25 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:sample-code:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sample-code:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:sample-code:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sample-code:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:sample-code:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:sample-code:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:sample-code:delete' }) //
]
}
// -
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 == 'enable') {
handleEnable(row.id)
@ -183,16 +209,18 @@ const formsSuccess = async (formType,data) => {
return
}
var isHave = SampleCode.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.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 SampleCodeApi.createSampleCode(data)
message.success(t('common.createSuccess'))
@ -201,7 +229,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
}
}
/** 详情操作 */
@ -279,11 +311,11 @@ const searchFormClick = (searchData) => {
getList() //
}
const onChange = async (field, value, formRef) => {
if(field == "batchLowLimiting" || field == "batchUpperLimiting"){
if (field == 'batchLowLimiting' || field == 'batchUpperLimiting') {
var upperLimit = formRef.value.formModel.batchUpperLimiting
var lowLimit = formRef.value.formModel.batchLowLimiting
if (parseInt(upperLimit) <= parseInt(lowLimit)) {
message.warning("批量上限须大于批量下限")
message.warning('批量上限须大于批量下限')
}
}
}
@ -295,5 +327,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await SampleCodeApi.importTemplate()
})
</script>

173
src/views/qms/samplingProcess/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SamplingProcess.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="SamplingProcess.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -114,7 +122,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:sampling-process:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -127,16 +135,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)
}
}
@ -152,17 +166,25 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:sampling-process:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sampling-process:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:sampling-process:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sampling-process:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:sampling-process:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:sampling-process:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:sampling-process:delete' }) //
]
}
// -
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 == 'enable') {
handleEnable(row.id)
@ -177,16 +199,19 @@ const basicFormRef = ref()
// form
const formsSuccess = async (formType, data) => {
var isHave = SamplingProcess.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.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 SamplingProcessApi.createSamplingProcess(data)
message.success(t('common.createSuccess'))
@ -195,7 +220,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
}
}
/** 详情操作 */
@ -265,74 +294,85 @@ const importSuccess = () => {
}
const updateFormFields = (sampleType, formRef) => {
let sampleQtyLabel = '';
let sampleQtyDisabled = false;
let sampleProgCodeDisabled = true;
let sampleQtyRequired = false;
let sampleProgCodeRequired = false;
let sampleQtyLabel = ''
let sampleQtyDisabled = false
let sampleProgCodeDisabled = true
let sampleQtyRequired = false
let sampleProgCodeRequired = false
switch (sampleType) {
case '1':
sampleQtyLabel = '样品份数';
sampleQtyDisabled = true;
sampleQtyRequired = false;
SamplingProcessRules.sampleQty = [{ required: false, message: '该项为必填项', trigger: 'blur'}]
break;
sampleQtyLabel = '样品份数'
sampleQtyDisabled = true
sampleQtyRequired = false
SamplingProcessRules.sampleQty = [
{ required: false, message: '该项为必填项', trigger: 'blur' }
]
break
case '2':
sampleQtyLabel = '样品份数(%)';
sampleQtyDisabled = false;
sampleQtyRequired = true;
SamplingProcessRules.sampleQty = [{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur'},{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}]
sampleQtyLabel = '样品份数(%)'
sampleQtyDisabled = false
sampleQtyRequired = true
SamplingProcessRules.sampleQty = [
{ required: true, message: '该项为必填项', trigger: 'blur' },
{ validator: validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur' },
{ validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' }
]
break;
break
case '3':
sampleQtyLabel = '样品份数';
sampleQtyDisabled = false;
sampleQtyRequired = true;
SamplingProcessRules.sampleQty = [{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateInteger, message: '样品份数必须为正整数', trigger: 'blur'}]
sampleQtyLabel = '样品份数'
sampleQtyDisabled = false
sampleQtyRequired = true
SamplingProcessRules.sampleQty = [
{ required: true, message: '该项为必填项', trigger: 'blur' },
{ validator: validateInteger, message: '样品份数必须为正整数', trigger: 'blur' }
]
break;
break
case '4':
sampleQtyLabel = '样品份数';
sampleQtyDisabled = true;
sampleQtyRequired = false;
sampleProgCodeDisabled = false;
sampleProgCodeRequired = true;
SamplingProcessRules.sampleQty = [{ required: false, message: '该项为必填项', trigger: 'blur'}]
break;
sampleQtyLabel = '样品份数'
sampleQtyDisabled = true
sampleQtyRequired = false
sampleProgCodeDisabled = false
sampleProgCodeRequired = true
SamplingProcessRules.sampleQty = [
{ required: false, message: '该项为必填项', trigger: 'blur' }
]
break
default:
break;
break
}
SamplingProcess.allSchemas.formSchema.forEach(item => {
SamplingProcess.allSchemas.formSchema.forEach((item) => {
if (item.field === 'sampleQty') {
item.label = sampleQtyLabel;
item.componentProps.disabled = sampleQtyDisabled;
item.label = sampleQtyLabel
item.componentProps.disabled = sampleQtyDisabled
}
if (item.field === 'sampleProgCode') {
item.componentProps.disabled = sampleProgCodeDisabled;
item.componentProps.disabled = sampleProgCodeDisabled
}
});
})
SamplingProcessRules.sampleQty[0].required = sampleQtyRequired;
SamplingProcessRules.sampleProgCode[0].required = sampleProgCodeRequired;
SamplingProcessRules.sampleQty[0].required = sampleQtyRequired
SamplingProcessRules.sampleProgCode[0].required = sampleProgCodeRequired
formRef.value.setValues({
sampleQty: '',
sampleProgCode: '',
});
};
sampleProgCode: ''
})
}
const openForm = async (type, row) => {
basicFormRef.value.open(type, row);
updateFormFields(row.sampleType, basicFormRef);
};
basicFormRef.value.open(type, row)
updateFormFields(row.sampleType, basicFormRef)
}
const onChange = async (field, value, formRef) => {
if (field === 'sampleType') {
updateFormFields(value, formRef);
updateFormFields(value, formRef)
}
}
};
//
const searchFormClick = (searchData) => {
@ -345,11 +385,10 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await SamplingProcessApi.importTemplate()
})
</script>

76
src/views/qms/samplingScheme/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SamplingScheme.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="SamplingScheme.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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 +62,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SamplingScheme.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/sampling-scheme/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/sampling-scheme/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -104,7 +117,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:sampling-scheme:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -117,16 +130,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)
}
}
@ -142,21 +161,29 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:sampling-scheme:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sampling-scheme:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:sampling-scheme:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sampling-scheme:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:sampling-scheme:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:sampling-scheme:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:sampling-scheme:delete' }) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
@ -170,16 +197,18 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = SamplingScheme.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.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 SamplingSchemeApi.createSamplingScheme(data)
message.success(t('common.createSuccess'))
@ -188,7 +217,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
}
}
/** 详情操作 */
@ -275,5 +308,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await SamplingSchemeApi.importTemplate()
})
</script>

58
src/views/qms/selectedProject/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SelectedProject.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="SelectedProject.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -54,7 +58,12 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SelectedProject.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/selected-project/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/selected-project/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -104,7 +113,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:selectedProject:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -117,16 +126,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)
}
}
@ -134,14 +149,16 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:selectedProject:update' }), //
defaultButtons.mainListDeleteBtn({hasPermi:'qms:selectedProject:delete'}), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:selectedProject:delete' }) //
]
// -
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)
}
}
@ -155,16 +172,18 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = SelectedProject.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.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 SelectedProjectApi.createSelectedProject(data)
message.success(t('common.createSuccess'))
@ -173,7 +192,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
}
}
/** 详情操作 */
@ -240,5 +263,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await SelectedProjectApi.importTemplate()
})
</script>

125
src/views/qms/selectedSet/index.vue

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SelectedSet.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="SelectedSet.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -16,7 +20,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -33,7 +38,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>
@ -103,7 +111,7 @@ import * as DictDataApi from '@/api/system/dict/dict.data'
import component from 'virtual:svg-icons-register'
import * as DictTypeApi from '@/api/system/dict/dict.type'
import { checkPermi } from '@/utils/permission'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue";
import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
@ -150,7 +158,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'qms:selected-set:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -163,16 +171,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)
}
}
@ -188,17 +202,25 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'qms:selected-set:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:selected-set:enable'}),
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:selected-set:disable' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:selected-set:delete'}), //
defaultButtons.mainListEnableBtn({
hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:selected-set:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:selected-set:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:selected-set:delete' }) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
editForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
@ -215,7 +237,7 @@ const openForm = (type: string, row?: any) => {
}
const editForm = async (type: string, row?: any) => {
tableData.value = []
SelectedProjectApi.getSelectedProjectNoPage({masterId:row.id}).then(res=>{
SelectedProjectApi.getSelectedProjectNoPage({ masterId: row.id }).then((res) => {
tableData.value = res
})
basicFormRef.value.open(type, row)
@ -224,16 +246,18 @@ const editForm = async (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = SelectedSet.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.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 SelectedSetApi.createSelectedSet(data)
message.success(t('common.createSuccess'))
@ -242,7 +266,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
}
}
/** 详情操作 */
@ -320,7 +348,6 @@ const searchFormClick = (searchData) => {
getList() //
}
const tableFormKeys = {}
SelectedProject.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
@ -335,10 +362,9 @@ const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
const emptyFlag = validateDetailEmpty(tableData.value);
const emptyFlag = validateDetailEmpty(tableData.value)
if (!emptyFlag) {
message.alertWarning('明细不能为空')
basicFormRef.value.formLoading = false
@ -366,35 +392,34 @@ const submitForm = async (formType, data) => {
}
}
const validateDetailEmpty = (data) => {
const codes = data.map(item => item.stage);
const codes = data.map((item) => item.stage)
if (codes.length == 0) {
return false;
return false
}
return true;
return true
}
const validateNotRepetition = (data) => {
// dictionaryTypeAndCode
const codes = data.map(item => item.dictionaryValue);
const codes = data.map((item) => item.dictionaryValue)
// Set dictionaryTypeAndCode
const uniqueCodes = new Set(codes);
const uniqueCodes = new Set(codes)
// Set
if (codes.length > uniqueCodes.size) {
return false; // false
return false // false
}
return true; // true
};
return true // true
}
const detailValidate = (formType, data) => {
let tag = true;
existValue.value.forEach(item=>{
let tag = true
existValue.value.forEach((item) => {
if (data.dictionaryValue == item.dictionaryValue) {
message.warning("选定集字典项不能重复!")
tag = false;
message.warning('选定集字典项不能重复!')
tag = false
}
})
return tag
@ -405,40 +430,32 @@ const detailOpenForm = (type, row, masterParmas) => {
masterId: masterParmas.masterId
}
if (type == 'create') {
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
SelectedProjectApi.getSelectedProjectNoPage(param).then((res) => {
if (res.length > 0) {
existValue.value = res
}
})
} else if ('update') {
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
SelectedProjectApi.getSelectedProjectNoPage(param).then((res) => {
if (res.length > 0) {
existValue.value = res.filter(item=>{
existValue.value = res.filter((item) => {
return item?.id != row.id
})
}
})
}
}
const detailBasiFormOnChange = (field, val, detailFormRef) => {}
const detailBasiFormOnChange = (field,val,detailFormRef) => {
}
const formSelectChange = (a,b,c,d) => {
}
const formSelectChange = (a, b, c, d) => {}
/** 初始化 **/
onMounted(async () => {
  tableObject.params = {
    available: true
  }
tableObject.params = {
available: true
}
getList()
importTemplateData.templateUrl = await SelectedSetApi.importTemplate()
})
</script>

Loading…
Cancel
Save