Browse Source

Merge remote-tracking branch 'origin/hella_online_20240803' into hella_online_20240803

hella_online_20240815
gaojs 3 months ago
parent
commit
fa59661c6a
  1. 75
      src/views/qms/inspectionJob/index.vue
  2. 1552
      src/views/qms/inspectionJobProduction/addForm.vue
  3. 194
      src/views/qms/inspectionJobProduction/detail.vue
  4. 442
      src/views/qms/inspectionJobProduction/index.vue
  5. 885
      src/views/qms/inspectionJobProduction/inspectionJobMain.data.ts
  6. 1552
      src/views/qms/inspectionJobPurchase/addForm.vue
  7. 194
      src/views/qms/inspectionJobPurchase/detail.vue
  8. 442
      src/views/qms/inspectionJobPurchase/index.vue
  9. 885
      src/views/qms/inspectionJobPurchase/inspectionJobMain.data.ts
  10. 27
      src/views/qms/inspectionRecord/index.vue
  11. 4
      src/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data.ts
  12. 4
      src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts
  13. 4
      src/views/wms/basicDataManage/factoryModeling/location/location.data.ts
  14. 4
      src/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data.ts
  15. 4
      src/views/wms/basicDataManage/factoryModeling/process/process.data.ts
  16. 4
      src/views/wms/basicDataManage/factoryModeling/productionline/productionline.data.ts
  17. 4
      src/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data.ts
  18. 4
      src/views/wms/basicDataManage/factoryModeling/workshop/workshop.data.ts
  19. 4
      src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts
  20. 4
      src/views/wms/basicDataManage/systemSetting/accountcalendar/accountcalendar.data.ts
  21. 4
      src/views/wms/basicDataManage/systemSetting/currencyexchange/currencyexchange.data.ts
  22. 4
      src/views/wms/basicDataManage/systemSetting/systemcalendar/systemcalendar.data.ts
  23. 3
      src/views/wms/purchasereceiptManage/inspect/inspectJobMain/index.vue
  24. 3
      src/views/wms/purchasereceiptManage/inspect/inspectRecordMain/index.vue
  25. 5
      src/views/wms/purchasereceiptManage/inspect/inspectRequestMain/index.vue
  26. 5
      src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRecordSpareMain/index.vue
  27. 3
      src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRequestSpareMain/index.vue
  28. 3
      src/views/wms/purchasereceiptManage/putaway/putawayJobMain/index.vue
  29. 3
      src/views/wms/purchasereceiptManage/putaway/putawayRecordMain/index.vue
  30. 5
      src/views/wms/purchasereceiptManage/putaway/putawayRequestMain/index.vue
  31. 3
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRecordMain/index.vue
  32. 5
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

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

@ -4,12 +4,7 @@
<Search
:schema="InspectionJobMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="
setSearchParams({
available: true,
excludeInspectionType: '1,4'
})
"
@reset="setSearchParams"
/>
</ContentWrap>
@ -316,9 +311,8 @@ const showQualityReport = ref(false)
const qualityReport = ref('')
const checkQualityReport = async (row) => {
showQualityReport.value = true
qualityReport.value =getReportUrl() + '/purchasereceiptReport?asnNumber=' + row.asnNumber
qualityReport.value = getReportUrl() + '/purchasereceiptReport?asnNumber=' + row.asnNumber
}
/** 添加/修改操作 */
// const formRef = ref()
@ -457,11 +451,25 @@ const handleImport = () => {
const searchFormClick = (searchData) => {
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType')
if (!isHave) {
searchData.filters.push({
action: 'notIn',
column: 'inspectionType',
value: '1,4'
})
if (route.name == 'inspectionJobProductionMain') {
searchData.filters.push({
action: '==',
column: 'inspectionType',
value: '4'
})
} else if (route.name == 'inspectionJobPurchaseMain') {
searchData.filters.push({
action: '==',
column: 'inspectionType',
value: '1'
})
} else {
searchData.filters.push({
action: 'notIn',
column: 'excludeInspectionType',
value: '1,4'
})
}
}
tableObject.params = {
isSearch: true,
@ -469,14 +477,47 @@ const searchFormClick = (searchData) => {
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
available: true,
excludeInspectionType: '1,4'
console.log(11,route.name)
if (route.name == 'inspectionJobProductionMain') {
tableObject.params = {
available: true,
inspectionType: '4'
}
} else if (route.name == 'inspectionJobPurchaseMain') {
tableObject.params = {
available: true,
inspectionType: '1'
}
} else {
tableObject.params = {
available: true,
excludeInspectionType: '1,4'
}
}
getList()
// importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate()
})
onActivated(() => {
if (route.name == 'inspectionJobProductionMain') {
tableObject.params = {
available: true,
inspectionType: '4'
}
} else if (route.name == 'inspectionJobPurchaseMain') {
tableObject.params = {
available: true,
inspectionType: '1'
}
} else {
tableObject.params = {
available: true,
excludeInspectionType: '1,4'
}
}
getList()
})
</script>

1552
src/views/qms/inspectionJobProduction/addForm.vue

File diff suppressed because it is too large

194
src/views/qms/inspectionJobProduction/detail.vue

@ -1,194 +0,0 @@
<template>
<div>
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading">
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Descriptions :data="data" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="allSchemas.detailSchema" :columns="2" width="200px" />
</ContentWrap>
<ContentWrap>
<el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false">
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name">
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="small-title">检验特性</div>
<el-form :model="item" label-width="auto" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.number" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName" disabled placeholder="请选择检验方法" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsRespVO.samplingProcessCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入每份样品量" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate">
<el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsRespVO.resultEntryMethod">
<el-select v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event,item)" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType">
<el-select v-model="item.inspectionJobCharacteristicsRespVO.featureType" placeholder="请选择特征类型" @change="changeFeatureType" disabled>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'Detail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
data.value = row
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

442
src/views/qms/inspectionJobProduction/index.vue

@ -1,442 +0,0 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="InspectionJobMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams({
available: true,
inspectionType: '4'
})"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionJobMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<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"
>
<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)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<AddForm
ref="formRef"
basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
:tableAllSchemas="InspectionJobPackage.allSchemas"
:tableFormRules="InspectionJobPackageRules"
:rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas"
:detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 包装信息 -->
<ListTable
ref="listTableRef"
titleName="包装信息"
:allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobPackage.allSchemas"
:detailAllSchemasRules="InspectionJobPackageRules"
:list="list"
/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
InspectionJobMain,
InspectionJobMainRules,
InspectionJobDetail,
InspectionJobDetailRules,
InspectionJobPackage,
InspectionJobPackageRules
} from './inspectionJobMain.data'
import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from '../inspectionTemplate/inspectionTemplate.data'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage'
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import { getReportUrl } from '@/utils/systemParam'
//
defineOptions({ name: 'inspectionJobMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
// row['itemNumber'] = val[0]['number']
// row['itemName'] = val[0]['name']
// row['uom'] = val[0]['uom']
// row['isRadeIn'] = val[0]['isRadeIn']
// row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: InspectionJobMainApi.getInspectionJobMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const isShowMainButton2 = (row, val) => {
if (val.indexOf(row.isStaging) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListJobAccBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-job-main:accept'
}), //
defaultButtons.mainListJobCloBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-job-main:close'
}), //
defaultButtons.mainListJobAbaBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-job-main:abandon'
}), //
defaultButtons.mainListJobExeBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-job-main:execute'
}), //
defaultButtons.mainListOrderPubBtn({
hide: isShowMainButton2(row, ['TRUE']),
hasPermi: 'qms:inspection-job-main:execute'
}), //
defaultButtons.mainListPackageBtn(null), //
defaultButtons.mainListPlanCheckQualityReportBtn({}) //
]
}
const listTableRef = ref()
const list = ref([])
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') {
//
execute('execute', row)
} else if (val == 'mainPackage') {
//
list.value = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
// row.status = '1'
listTableRef.value.openPackage(row, '包装信息', InspectionJobPackage.allSchemas.tableColumns)
} else if (val == 'mainJobAba') {
//
handleAbandon(row.id)
} else if (val == 'mainJobClo') {
//
handleClose(row.id)
} else if (val == 'mainOrderPub') {
//
handleRelease(row.id)
} else if (val == 'mainPlanCheckQualityReport') {
//
checkQualityReport(row)
} else if (val == 'mainJobAcc') {
//
handleAccept(row.id)
}
}
//
//
const reportHeight = ref(window.innerHeight - 120)
const showQualityReport = ref(false)
const qualityReport = ref('')
const checkQualityReport = async (row) => {
showQualityReport.value = true
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}`
}
/** 添加/修改操作 */
// const formRef = ref()
// const openForm = async (type : string, row ?: number) => {
// tableData.value = [] //
// formRef.value.open(type, row)
// }
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain')
}
//
const formRef = ref()
const execute = async (type: string, row?: number) => {
formRef.value.open(type, row)
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
//
await message.confirm(t('common.confirmColse'))
//
await InspectionJobMainApi.closeInspectionJobMain(id)
message.success(t('common.closeSuccess'))
//
await getList()
} catch {}
}
/** 发布按钮操作 */
const handleRelease = async (id: number) => {
try {
//
await message.confirm('确认发布吗?')
//
await InspectionJobMainApi.releaseInspectionJobMain(id)
message.success('发布成功!')
//
await getList()
} catch {}
}
//
const handleAccept = async (id: number) => {
try {
//
await message.confirm(t('common.confirmAccept'))
//
await InspectionJobMainApi.acceptInspectionJobMain(id)
message.success(t('common.acceptSuccess'))
//
await getList()
} catch {}
}
//
const handleAbandon = async (id: number) => {
try {
//
await message.confirm(t('common.confirmGiveup'))
//
await InspectionJobMainApi.abandonInspectionJobMain(id)
message.success(t('common.giveupSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await InspectionJobMainApi.exportInspectionJobMain(tableObject.params)
download.excel(data, '检验任务.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
InspectionJobDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
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'))
} else if (formType === 'execute') {
await InspectionJobMainApi.executeInspectionJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
formRef.value.formLoading = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const searchFormClick = (searchData) => {
searchData.filters.push({
action: "==",
column: "inspectionType",
value: "4"
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
available: true,
inspectionType: '4'
}
getList()
// importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate()
})
</script>

885
src/views/qms/inspectionJobProduction/inspectionJobMain.data.ts

@ -1,885 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum, validateSixNum } from '@/utils/validator'
const { t } = useI18n() // 国际化
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)
const featureTypeList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE)
const isCanUpdateList = [
{
label: '是',
value: true
},
{
label: '否',
value: false
}
]
/**
* @returns {Array}
*/
export const InspectionJobMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 200,
fixed: 'left'
}
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 200
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 180
}
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 175
}
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
table: {
width: 175
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料编码',
field: 'itemCode',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
table: {
width: 175
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料批次',
field: 'batch',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考订单号',
field: 'referenceOrderCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考订单行',
field: 'referenceOrderRow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考凭证号',
field: 'referenceCertificateCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考凭证行',
field: 'referenceCertificateRow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 200
}
},
{
label: '批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: false,
isDetail: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '供应商批次',
field: 'supplierBatch',
sort: 'custom',
isSearch: false,
isDetail: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
// {
// label: '采样总数量',
// field: 'sampleTotalAmount',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '完成人',
field: 'completeUser',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: false,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: false
},
// {
// label: '检验批来源',
// field: 'inspectionBatchSource',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
// dictClass: 'string',
// form:{
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
{
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '计划开始时间',
field: 'planStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
disabled: true
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 175
}
},
{
label: '计划结束时间',
field: 'planEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
disabled: true
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 175
}
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_LEVEL,
dictClass: 'string',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.BASIC_AQL,
dictClass: 'string',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
// {
// label: '使用决策',
// field: 'usageDecision',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.USAGE_DECISION,
// form:{
// componentProps:{
// }
// }
// },
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE',
// disabled:true
// }
// }
// },
{
label: '承接人',
field: 'acceptUserName',
table: {
width: 130
},
isForm: false,
isTable: false,
isDetail: true
},
{
label: '承接时间',
field: 'acceptTime',
isForm: false,
table: {
width: 180
},
isTable: false,
isDetail: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '收货时间',
field: 'deliveryTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 175
}
},
{
label: '完成人',
field: 'completeUserName',
table: {
width: 130
},
isForm: false,
isTable: true,
isDetail: true
},
{
label: '完成时间',
field: 'completeTime',
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string',
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
search: {
value: 'TRUE'
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 110
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
isTable: false,
isForm: false,
tableForm: {
disabled: false
}
},
{
label: '创建时间',
field: 'createTime',
isForm: false,
isTable: true,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}
},
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 300,
fixed: 'right'
}
}
])
)
//表单校验
export const InspectionJobMainRules = reactive({
// usageDecision: [required],
})
/**
* @returns {Array}
*/
export const InspectionJobDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '检验方案模板编码',
field: 'inspectionCode',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '检验特性编号',
field: 'inspectionCharCode',
sort: 'custom',
isSearch: true
},
{
label: '检验特性编码',
field: 'inspectionJobCharacteristicsRespVO.number',
sort: 'custom'
},
{
label: '检验特性描述',
field: 'inspectionJobCharacteristicsRespVO.description',
sort: 'custom'
},
{
label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode',
sort: 'custom'
},
{
label: '采样过程编码',
field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode',
sort: 'custom'
},
{
label: '动态修改规则编码',
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode',
sort: 'custom'
},
{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return isCanUpdateList.find((account) => account.value == cellValue)?.label
}
},
{
label: '结果录入方式',
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod',
sort: 'custom',
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
// dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return resultEntryMethodList.find((account) => account.value == cellValue)?.label
}
},
{
label: '特征类型',
field: 'inspectionJobCharacteristicsRespVO.featureType',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return featureTypeList.find((account) => account.value == cellValue)?.label
}
}
])
)
//表单校验
export const InspectionJobDetailRules = reactive({
taskCode: [required],
processCode: [required],
sequenceCode: [required],
available: [required]
})
/**
* @returns {Array}
*/
export const InspectionJobPackage = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 200
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 200
}
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 180
}
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
disabled: true
},
table: {
width: 150
}
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 150
}
},
{
label: '采样数量',
field: 'sampleAmount',
sort: 'custom',
isSearch: true,
isTable: false,
table: {
width: 150
}
}
])
)
//表单校验
export const InspectionJobPackageRules = reactive({
sampleAmount: [required, { validator: validateSixNum, trigger: 'blur' }]
})

1552
src/views/qms/inspectionJobPurchase/addForm.vue

File diff suppressed because it is too large

194
src/views/qms/inspectionJobPurchase/detail.vue

@ -1,194 +0,0 @@
<template>
<div>
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading">
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Descriptions :data="data" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="allSchemas.detailSchema" :columns="2" width="200px" />
</ContentWrap>
<ContentWrap>
<el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false">
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name">
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="small-title">检验特性</div>
<el-form :model="item" label-width="auto" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.number" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName" disabled placeholder="请选择检验方法" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsRespVO.samplingProcessCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入每份样品量" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate">
<el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsRespVO.resultEntryMethod">
<el-select v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event,item)" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType">
<el-select v-model="item.inspectionJobCharacteristicsRespVO.featureType" placeholder="请选择特征类型" @change="changeFeatureType" disabled>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'Detail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
data.value = row
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

442
src/views/qms/inspectionJobPurchase/index.vue

@ -1,442 +0,0 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="InspectionJobMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams({
available: true,
inspectionType: '1'
})"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionJobMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<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"
>
<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)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<AddForm
ref="formRef"
basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
:tableAllSchemas="InspectionJobPackage.allSchemas"
:tableFormRules="InspectionJobPackageRules"
:rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas"
:detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 包装信息 -->
<ListTable
ref="listTableRef"
titleName="包装信息"
:allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobPackage.allSchemas"
:detailAllSchemasRules="InspectionJobPackageRules"
:list="list"
/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
InspectionJobMain,
InspectionJobMainRules,
InspectionJobDetail,
InspectionJobDetailRules,
InspectionJobPackage,
InspectionJobPackageRules
} from './inspectionJobMain.data'
import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from '../inspectionTemplate/inspectionTemplate.data'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage'
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import { getReportUrl } from '@/utils/systemParam'
//
defineOptions({ name: 'inspectionJobMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
// row['itemNumber'] = val[0]['number']
// row['itemName'] = val[0]['name']
// row['uom'] = val[0]['uom']
// row['isRadeIn'] = val[0]['isRadeIn']
// row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: InspectionJobMainApi.getInspectionJobMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const isShowMainButton2 = (row, val) => {
if (val.indexOf(row.isStaging) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListJobAccBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-job-main:accept'
}), //
defaultButtons.mainListJobCloBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-job-main:close'
}), //
defaultButtons.mainListJobAbaBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-job-main:abandon'
}), //
defaultButtons.mainListJobExeBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-job-main:execute'
}), //
defaultButtons.mainListOrderPubBtn({
hide: isShowMainButton2(row, ['TRUE']),
hasPermi: 'qms:inspection-job-main:execute'
}), //
defaultButtons.mainListPackageBtn(null), //
defaultButtons.mainListPlanCheckQualityReportBtn({}) //
]
}
const listTableRef = ref()
const list = ref([])
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') {
//
execute('execute', row)
} else if (val == 'mainPackage') {
//
list.value = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
// row.status = '1'
listTableRef.value.openPackage(row, '包装信息', InspectionJobPackage.allSchemas.tableColumns)
} else if (val == 'mainJobAba') {
//
handleAbandon(row.id)
} else if (val == 'mainJobClo') {
//
handleClose(row.id)
} else if (val == 'mainOrderPub') {
//
handleRelease(row.id)
} else if (val == 'mainPlanCheckQualityReport') {
//
checkQualityReport(row)
} else if (val == 'mainJobAcc') {
//
handleAccept(row.id)
}
}
//
//
const reportHeight = ref(window.innerHeight - 120)
const showQualityReport = ref(false)
const qualityReport = ref('')
const checkQualityReport = async (row) => {
showQualityReport.value = true
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}`
}
/** 添加/修改操作 */
// const formRef = ref()
// const openForm = async (type : string, row ?: number) => {
// tableData.value = [] //
// formRef.value.open(type, row)
// }
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain')
}
//
const formRef = ref()
const execute = async (type: string, row?: number) => {
formRef.value.open(type, row)
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
//
await message.confirm(t('common.confirmColse'))
//
await InspectionJobMainApi.closeInspectionJobMain(id)
message.success(t('common.closeSuccess'))
//
await getList()
} catch {}
}
/** 发布按钮操作 */
const handleRelease = async (id: number) => {
try {
//
await message.confirm('确认发布吗?')
//
await InspectionJobMainApi.releaseInspectionJobMain(id)
message.success('发布成功!')
//
await getList()
} catch {}
}
//
const handleAccept = async (id: number) => {
try {
//
await message.confirm(t('common.confirmAccept'))
//
await InspectionJobMainApi.acceptInspectionJobMain(id)
message.success(t('common.acceptSuccess'))
//
await getList()
} catch {}
}
//
const handleAbandon = async (id: number) => {
try {
//
await message.confirm(t('common.confirmGiveup'))
//
await InspectionJobMainApi.abandonInspectionJobMain(id)
message.success(t('common.giveupSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await InspectionJobMainApi.exportInspectionJobMain(tableObject.params)
download.excel(data, '检验任务.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
InspectionJobDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
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'))
} else if (formType === 'execute') {
await InspectionJobMainApi.executeInspectionJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
formRef.value.formLoading = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const searchFormClick = (searchData) => {
searchData.filters.push({
action: "==",
column: "inspectionType",
value: "1"
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
available: true,
inspectionType: '1'
}
getList()
// importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate()
})
</script>

885
src/views/qms/inspectionJobPurchase/inspectionJobMain.data.ts

@ -1,885 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum, validateSixNum } from '@/utils/validator'
const { t } = useI18n() // 国际化
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)
const featureTypeList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE)
const isCanUpdateList = [
{
label: '是',
value: true
},
{
label: '否',
value: false
}
]
/**
* @returns {Array}
*/
export const InspectionJobMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 200,
fixed: 'left'
}
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 200
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 180
}
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 175
}
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
table: {
width: 175
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料编码',
field: 'itemCode',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
table: {
width: 175
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料批次',
field: 'batch',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考订单号',
field: 'referenceOrderCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考订单行',
field: 'referenceOrderRow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考凭证号',
field: 'referenceCertificateCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '参考凭证行',
field: 'referenceCertificateRow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 200
}
},
{
label: '批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: false,
isDetail: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '供应商批次',
field: 'supplierBatch',
sort: 'custom',
isSearch: false,
isDetail: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
// {
// label: '采样总数量',
// field: 'sampleTotalAmount',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '完成人',
field: 'completeUser',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: false,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: false
},
// {
// label: '检验批来源',
// field: 'inspectionBatchSource',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
// dictClass: 'string',
// form:{
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
{
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: '计划开始时间',
field: 'planStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
disabled: true
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 175
}
},
{
label: '计划结束时间',
field: 'planEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
disabled: true
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 175
}
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_LEVEL,
dictClass: 'string',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.BASIC_AQL,
dictClass: 'string',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
}
},
// {
// label: '使用决策',
// field: 'usageDecision',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.USAGE_DECISION,
// form:{
// componentProps:{
// }
// }
// },
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE',
// disabled:true
// }
// }
// },
{
label: '承接人',
field: 'acceptUserName',
table: {
width: 130
},
isForm: false,
isTable: false,
isDetail: true
},
{
label: '承接时间',
field: 'acceptTime',
isForm: false,
table: {
width: 180
},
isTable: false,
isDetail: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '收货时间',
field: 'deliveryTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 175
}
},
{
label: '完成人',
field: 'completeUserName',
table: {
width: 130
},
isForm: false,
isTable: true,
isDetail: true
},
{
label: '完成时间',
field: 'completeTime',
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string',
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
search: {
value: 'TRUE'
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 110
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
isTable: false,
isForm: false,
tableForm: {
disabled: false
}
},
{
label: '创建时间',
field: 'createTime',
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isTable: true,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}
},
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 300,
fixed: 'right'
}
}
])
)
//表单校验
export const InspectionJobMainRules = reactive({
// usageDecision: [required],
})
/**
* @returns {Array}
*/
export const InspectionJobDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '检验方案模板编码',
field: 'inspectionCode',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '检验特性编号',
field: 'inspectionCharCode',
sort: 'custom',
isSearch: true
},
{
label: '检验特性编码',
field: 'inspectionJobCharacteristicsRespVO.number',
sort: 'custom'
},
{
label: '检验特性描述',
field: 'inspectionJobCharacteristicsRespVO.description',
sort: 'custom'
},
{
label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode',
sort: 'custom'
},
{
label: '采样过程编码',
field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode',
sort: 'custom'
},
{
label: '动态修改规则编码',
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode',
sort: 'custom'
},
{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return isCanUpdateList.find((account) => account.value == cellValue)?.label
}
},
{
label: '结果录入方式',
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod',
sort: 'custom',
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
// dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return resultEntryMethodList.find((account) => account.value == cellValue)?.label
}
},
{
label: '特征类型',
field: 'inspectionJobCharacteristicsRespVO.featureType',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return featureTypeList.find((account) => account.value == cellValue)?.label
}
}
])
)
//表单校验
export const InspectionJobDetailRules = reactive({
taskCode: [required],
processCode: [required],
sequenceCode: [required],
available: [required]
})
/**
* @returns {Array}
*/
export const InspectionJobPackage = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 200
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 200
}
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 180
}
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
disabled: true
},
table: {
width: 150
}
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
table: {
width: 150
}
},
{
label: '采样数量',
field: 'sampleAmount',
sort: 'custom',
isSearch: true,
isTable: false,
table: {
width: 150
}
}
])
)
//表单校验
export const InspectionJobPackageRules = reactive({
sampleAmount: [required, { validator: validateSixNum, trigger: 'blur' }]
})

27
src/views/qms/inspectionRecord/index.vue

@ -4,7 +4,7 @@
<Search
:schema="InspectionRecordMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="resetSearch"
@reset="setSearchParams"
/>
</ContentWrap>
@ -464,26 +464,29 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const resetSearch = () => {
if (route.name == 'inspectionRecordPurchaseMain') {
setSearchParams({
/** 初始化 **/
onMounted(async () => {
if (route.name == 'inspectionRecordPurchaseMain') {
tableObject.params = {
available: true,
inspectionType: '1'
})
}
} else if (route.name == 'inspectionRecordProductionMain') {
setSearchParams({
tableObject.params = {
available: true,
inspectionType: '4'
})
}
} else {
setSearchParams({
tableObject.params = {
available: true,
excludeInspectionType: '1,4,11'
})
}
}
}
/** 初始化 **/
onMounted(async () => {
getList()
})
onActivated(() => {
if (route.name == 'inspectionRecordPurchaseMain') {
tableObject.params = {
available: true,

4
src/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data.ts

@ -214,7 +214,7 @@ export const Area = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -237,7 +237,7 @@ export const Area = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts

@ -252,7 +252,7 @@ export const Dock = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -275,7 +275,7 @@ export const Dock = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/location/location.data.ts

@ -392,7 +392,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -415,7 +415,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data.ts

@ -214,7 +214,7 @@ export const Locationgroup = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -237,7 +237,7 @@ export const Locationgroup = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/process/process.data.ts

@ -217,7 +217,7 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -240,7 +240,7 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/productionline/productionline.data.ts

@ -227,7 +227,7 @@ export const Productionline = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -250,7 +250,7 @@ export const Productionline = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data.ts

@ -156,7 +156,7 @@ export const Warehouse = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -179,7 +179,7 @@ export const Warehouse = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/workshop/workshop.data.ts

@ -124,7 +124,7 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -147,7 +147,7 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts

@ -302,7 +302,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -325,7 +325,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/systemSetting/accountcalendar/accountcalendar.data.ts

@ -246,7 +246,7 @@ export const Accountcalendar = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -269,7 +269,7 @@ export const Accountcalendar = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/systemSetting/currencyexchange/currencyexchange.data.ts

@ -155,7 +155,7 @@ export const Currencyexchange = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -178,7 +178,7 @@ export const Currencyexchange = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

4
src/views/wms/basicDataManage/systemSetting/systemcalendar/systemcalendar.data.ts

@ -179,7 +179,7 @@ export const Systemcalendar = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -202,7 +202,7 @@ export const Systemcalendar = useCrudSchemas(reactive<CrudSchema[]>([
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
isTable: true,
table: {
width: 150
}

3
src/views/wms/purchasereceiptManage/inspect/inspectJobMain/index.vue

@ -73,6 +73,7 @@ import * as InspectJobMainApi from '@/api/wms/inspectJobMain'
import * as InspectJobDetailApi from '@/api/wms/inspectJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'InspectJobMain' })
@ -233,7 +234,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await InspectJobMainApi.exportInspectJobMain(tableObject.params)
download.excel(data, '检验任务主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

3
src/views/wms/purchasereceiptManage/inspect/inspectRecordMain/index.vue

@ -72,6 +72,7 @@ import * as InspectRecordDetailApi from '@/api/wms/inspectRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import Preview from '@/components/UploadFile/src/Preview.vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'InspectRecordMain' })
@ -179,7 +180,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await InspectRecordMainApi.exportInspectRecordMain(tableObject.params)
download.excel(data, '检验记录主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

5
src/views/wms/purchasereceiptManage/inspect/inspectRequestMain/index.vue

@ -53,6 +53,7 @@
import * as InspectRequestMainApi from '@/api/wms/inspectRequestMain'
import * as InspectRequestDetailApi from '@/api/wms/inspectRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'InspectRequestMain' })
@ -322,7 +323,7 @@
//
exportLoading.value = true
const data = await InspectRequestMainApi.exportInspectRequestMain(tableObject.params)
download.excel(data, '检验申请主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
@ -385,7 +386,7 @@
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '检验申请主导入模版.xlsx'
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//

5
src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRecordSpareMain/index.vue

@ -70,6 +70,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getAccessToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
// 退
defineOptions({ name: 'PurchasereturnRecordSpareMain' })
@ -170,10 +171,10 @@ const handleExport = async () => {
exportLoading.value = true
if(routeName.value.includes('SCP')){
const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMainSCP(tableObject.params)
download.excel(data, `${t('ts.采购退货记录主')}.xlsx`)
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}.xlsx`)
}else{
const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMainSpare(tableObject.params)
download.excel(data, `维修备件退货记录主.xlsx`)
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}.xlsx`)
}
} catch {

3
src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRequestSpareMain/index.vue

@ -141,6 +141,7 @@ import { getAccessToken } from '@/utils/auth'
import * as BalanceApi from '@/api/wms/balance'
import { async } from '@antv/x6/lib/registry/marker/async'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
// 退
defineOptions({ name: 'PurchasereturnRequestSpareMain' })
@ -708,7 +709,7 @@ const handleExport = async () => {
const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMainSpare(
tableObject.params
)
download.excel(data, '维修备件退货申请主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

3
src/views/wms/purchasereceiptManage/putaway/putawayJobMain/index.vue

@ -101,6 +101,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {getAccessToken} from "@/utils/auth";
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'PutawayJobMain' })
@ -348,7 +349,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await PutawayJobMainApi.exportPutawayJobMain(tableObject.params)
download.excel(data, '上架任务主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

3
src/views/wms/purchasereceiptManage/putaway/putawayRecordMain/index.vue

@ -91,6 +91,7 @@ import * as PutawayRecordMainApi from '@/api/wms/putawayRecordMain'
import * as PutawayRecordDetailApi from '@/api/wms/putawayRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'PutawayRecordMain' })
@ -211,7 +212,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await PutawayRecordMainApi.exportPutawayRecordMain(tableObject.params)
download.excel(data, '上架记录主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

5
src/views/wms/purchasereceiptManage/putaway/putawayRequestMain/index.vue

@ -110,6 +110,7 @@ import { PutawayRequestMain,
import * as PutawayRequestMainApi from '@/api/wms/putawayRequestMain'
import * as PutawayRequestDetailApi from '@/api/wms/putawayRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'PutawayRequestMain' })
@ -406,7 +407,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await PutawayRequestMainApi.exportPutawayRequestMain(tableObject.params)
download.excel(data, '上架申请主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
@ -475,7 +476,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '上架申请主导入模版.xlsx'
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//

3
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRecordMain/index.vue

@ -68,6 +68,7 @@ import * as PurchaseclaimRecordMainApi from '@/api/wms/purchaseclaimRecordMain'
import * as PurchaseclaimRecordDetailApi from '@/api/wms/purchaseclaimRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'PurchaseclaimRecordMain' })
@ -156,7 +157,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await PurchaseclaimRecordMainApi.exportPurchaseclaimRecordMain(tableObject.params)
download.excel(data, '采购索赔记录主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

5
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

@ -77,6 +77,7 @@
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'PurchaseclaimRequestMain' })
@ -414,7 +415,7 @@ import { getJmreportBaseUrl } from '@/utils/systemParam'
//
exportLoading.value = true
const data = await PurchaseclaimRequestMainApi.exportPurchaseclaimRequestMain(tableObject.params)
download.excel(data, '采购索赔申请主.xlsx')
download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
@ -484,7 +485,7 @@ import { getJmreportBaseUrl } from '@/utils/systemParam'
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购索赔申请信息导入模版.xlsx'
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {

Loading…
Cancel
Save