Browse Source

BUG修改

master_hella_20240701
parent
commit
f99b42437b
  1. 10
      src/views/qms/inspection/inspectionRecord/index.vue
  2. 88
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
  3. 211
      src/views/qms/inspection/inspectionRequest/index.vue

10
src/views/qms/inspection/inspectionRecord/index.vue

@ -30,9 +30,9 @@
<BasicForm ref="formRef" @success="getList" :rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas" :tableAllSchemas="InspectionRecordDetail.allSchemas"
:tableFormRules="InspectionRecordDetailRules" :tableData="tableData"
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain" :apiCreate="InspectionRecordMainApi.createInspectionRecordMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain"
:apiCreate="InspectionRecordMainApi.createInspectionRecordMain" :isBusiness="true" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
@ -40,8 +40,8 @@
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true" />
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"

88
src/views/qms/inspection/inspectionRecord/inspectionJobMain.data.ts → src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

@ -9,15 +9,7 @@ const { t } = useI18n() // 国际化
*/
export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isSearch: true,
isForm: false,
},
{
label: '编码',
label: '记录编号',
field: 'number',
sort: 'custom',
isSearch: true,
@ -32,82 +24,82 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '任务编码',
field: 'taskCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '检验方案Json',
field: 'inspectionSchemeJson',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '检验批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'SelectV2'
component: 'Select'
},
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '订单号',
field: 'orderCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '订单行',
field: 'orderRow',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'InputNumber',
value: 0
@ -117,13 +109,13 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '凭证号',
field: 'certificateCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '凭证行',
field: 'certificateRow',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'InputNumber',
value: 0
@ -133,7 +125,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'InputNumber',
value: 0
@ -143,20 +135,20 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '使用决策',
field: 'useDecision',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '计划开始时间',
field: 'planStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -178,7 +170,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'planEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -200,7 +192,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'realStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -222,7 +214,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'realEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -243,26 +235,26 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -319,32 +311,32 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'id',
sort: 'custom',
isTable: false,
isSearch: true,
isSearch: false,
isForm: false,
},
{
label: '记录编码',
field: 'recordCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '工序描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'InputNumber',
value: 0
@ -354,7 +346,7 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否破坏性检验',
field: 'isDestroyInspection',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Radio'
},
@ -364,7 +356,7 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -386,7 +378,7 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -407,26 +399,26 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验人',
field: 'inspectionOperator',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '检验特性编码',
field: 'inspectionFeaturesCode',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {

211
src/views/qms/inspection/inspectionRequest/index.vue

@ -5,28 +5,16 @@
</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
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
<Table :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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
@ -39,69 +27,63 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="InspectionMainRules"
:formAllSchemas="InspectionMain.allSchemas"
:apiUpdate="InspectionMainApi.updateInspectionMain"
:apiCreate="InspectionMainApi.createInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="InspectionMainRules"
:formAllSchemas="InspectionMain.allSchemas" :apiUpdate="InspectionMainApi.updateInspectionMain"
:apiCreate="InspectionMainApi.createInspectionMain" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 -->
<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" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionMain,InspectionMainRules } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'InspectionMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
import download from '@/utils/download'
import { InspectionMain, InspectionMainRules } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'InspectionMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
//
const updataTableColumns = (val) => {
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: InspectionMainApi.getInspectionMainPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:inspectionMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:inspectionMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:inspectionMain:export'}), //
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionMain:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -113,10 +95,10 @@ const HeadButttondata = [
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
@ -129,42 +111,42 @@ const buttonBaseClick = (val, item) => {
} else { //
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:inspectionMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inspectionMain:delete'}), //
]
// -
const butttondata = [
defaultButtons.mainListEditBtn({ hasPermi: 'wms:inspectionMain:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:inspectionMain:delete' }), //
]
// -
const buttonTableClick = async (val, row) => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType,data) => {
var isHave =InspectionMain.allSchemas.formSchema.some(function (item) {
// form
const formsSuccess = async (formType, data) => {
var isHave = InspectionMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
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;
if (formType === 'create') {
await InspectionMainApi.createInspectionMain(data)
message.success(t('common.createSuccess'))
@ -174,16 +156,16 @@ const formsSuccess = async (formType,data) => {
}
basicFormRef.value.dialogVisible = false
getList()
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionMain')
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
@ -192,12 +174,12 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -209,36 +191,35 @@ const handleExport = async () => {
} finally {
exportLoading.value = false
}
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '检验申请导入模版.xlsx'
})
//
const importSuccess = () => {
})
//
const importSuccess = () => {
getList()
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await InspectionMainApi.importTemplate()
})
})
</script>

Loading…
Cancel
Save