Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
zhaoxuebing 7 months ago
parent
commit
88f47e929a
  1. 6
      src/api/qms/inspectionJob/inspectionJobMain/index.ts
  2. 25
      src/components/Annex/src/Annex.vue
  3. 11
      src/components/Detail/src/Detail.vue
  4. 60
      src/components/PreviewPDF/index.vue
  5. 14
      src/utils/disposition/defaultButtons.ts
  6. 3
      src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts
  7. 25
      src/views/qms/basicDataManage/selectedSet/index.vue
  8. 128
      src/views/qms/inspection/inspectionJob/addForm.vue
  9. 1
      src/views/qms/inspection/inspectionJob/index.vue
  10. 38
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue
  11. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

6
src/api/qms/inspectionJob/inspectionJobMain/index.ts

@ -22,6 +22,11 @@ export const createInspectionJobMain = async (data) => {
return await request.post({ url: `/qms/inspection-job-main/create`, data }) return await request.post({ url: `/qms/inspection-job-main/create`, data })
} }
// 暂存检验任务
export const stagingInspectionJobMain = async (data) => {
return await request.post({ url: `/qms/inspection-job-main/staging`, data })
}
// 修改检验任务 // 修改检验任务
export const updateInspectionJobMain = async (data) => { export const updateInspectionJobMain = async (data) => {
return await request.put({ url: `/qms/inspection-job-main/update`, data }) return await request.put({ url: `/qms/inspection-job-main/update`, data })
@ -46,6 +51,7 @@ export const abandonInspectionJobMain = async (id) => {
export const closeInspectionJobMain = async (id) => { export const closeInspectionJobMain = async (id) => {
return await request.put({ url: `/qms/inspection-job-main/close?id=` + id }) return await request.put({ url: `/qms/inspection-job-main/close?id=` + id })
} }
// 导出检验申请 Excel // 导出检验申请 Excel
export const exportInspectionJobMain = async (params) => { export const exportInspectionJobMain = async (params) => {
return await request.download({ url: `/qms/inspection-job-main/export-excel`, params }) return await request.download({ url: `/qms/inspection-job-main/export-excel`, params })

25
src/components/Annex/src/Annex.vue

@ -16,17 +16,20 @@
<div>{{ item.size }}KB</div> <div>{{ item.size }}KB</div>
<div>来自 {{ item.nickname }}</div> <div>来自 {{ item.nickname }}</div>
</div> </div>
<Icon icon="ep:download" v-if="showDownload" class="cursor-pointer mr-2" size="18" @click="downFile(item)" /> <Icon icon="ep:picture" v-if="showPreview" class="cursor-pointer mr-2" :size="18" @click="preview(item)"/>
<Icon icon="ep:delete" class="cursor-pointer" v-if="!hiddenDelete" size="18" @click="deleteAnnex(item.id)" /> <Icon icon="ep:download" v-if="showDownload" class="cursor-pointer mr-2" :size="18" @click="downFile(item)" />
<Icon icon="ep:delete" class="cursor-pointer" v-if="!hiddenDelete" :size="18" @click="deleteAnnex(item.id)" />
</div> </div>
<div class="time mt-6px ">{{ formatDate(item.createTime) }}</div> <div class="time mt-6px ">{{ formatDate(item.createTime) }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<PreviewPDF ref="previewRef" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import PreviewPDF from '@/components/PreviewPDF/index.vue'
import UploadFile from '@/components/UploadFile/src/UploadFile.vue' import UploadFile from '@/components/UploadFile/src/UploadFile.vue'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as FileApi from '@/api/wms/file' import * as FileApi from '@/api/wms/file'
@ -45,6 +48,10 @@ const props = defineProps({
type: Object, type: Object,
required: true required: true
}, },
showPreview: {
type: Boolean,
required: false
},
showDownload: { showDownload: {
type: Boolean, type: Boolean,
required: false required: false
@ -55,7 +62,7 @@ const props = defineProps({
}, },
}) })
// emit // emit
const emit = defineEmits(['handleAnnexSuccess', 'deleteAnnexSuccess']) const emit = defineEmits(['handleAnnexSuccess', 'deleteAnnexSuccess','previewAnnexHandle'])
// //
const handleAnnexSuccess = () => { const handleAnnexSuccess = () => {
emit('handleAnnexSuccess') emit('handleAnnexSuccess')
@ -75,6 +82,18 @@ const deleteAnnex = async (id) => {
const downFile = (item)=>{ const downFile = (item)=>{
window.open(import.meta.env.VITE_BASE_URL + '/admin-api/infra/file/0/get/' + item.path) window.open(import.meta.env.VITE_BASE_URL + '/admin-api/infra/file/0/get/' + item.path)
} }
const previewRef = ref<InstanceType<typeof PreviewPDF>>()
const preview = (item)=>{
console.log('preview==',item)
if(item.url.endsWith('.pdf')){
previewRef.value?.openPreview(item.url)
}else{
let imageArray = props.annexData.annexList.map(item=>item.url)
imageArray = imageArray.filter(item=>!item.endsWith('.pdf'))
previewRef.value?.openPreview(imageArray)
}
}
</script> </script>

11
src/components/Detail/src/Detail.vue

@ -103,6 +103,7 @@
<ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}"> <ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label==annexItem.label" <Annex v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem" :annexData="annexItem"
:showPreview="annexItem.showPreview"
:showDownload = "annexItem.showDownload" :showDownload = "annexItem.showDownload"
:hiddenDelete = "annexItem.hiddenDelete" :hiddenDelete = "annexItem.hiddenDelete"
@handleAnnexSuccess="updateAnnexTableHandle" @handleAnnexSuccess="updateAnnexTableHandle"
@ -223,6 +224,7 @@ const props = defineProps({
default: ()=>({ default: ()=>({
label: '附件', label: '附件',
showDownload:false, showDownload:false,
showPreview:false,
hiddenDelete:false hiddenDelete:false
}) })
}, },
@ -460,10 +462,14 @@ const getFileList = async () => {
} }
} }
// //
const getAnnexFileList = async (row:id) => { const getAnnexFileList = async (row) => {
console.log('getAnnexFileList')
props.annexTable?.forEach(async (item) => { props.annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName} let requstData = {...remarksData.data,tableName: item?.tableName}
if(item?.queryParams){
item?.queryParams?.forEach(queryItem => {
requstData[queryItem.queryField] = row[queryItem.rowField]
});
}
const annexList = await FileApi.getFileList(requstData) const annexList = await FileApi.getFileList(requstData)
const annexData = annexTableData.value.find(annex=>annex.label === item.label) const annexData = annexTableData.value.find(annex=>annex.label === item.label)
if(annexData){ if(annexData){
@ -476,6 +482,7 @@ const getAnnexFileList = async (row:id) => {
annexList, annexList,
hasSubDetail:item.hasSubDetail||false, hasSubDetail:item.hasSubDetail||false,
subDetailTableData:item.subDetailTableData, subDetailTableData:item.subDetailTableData,
showPreview:item.showPreview||false, //
showDownload:item.showDownload||false, // showDownload:item.showDownload||false, //
hiddenDelete:item.hiddenDelete || false, // hiddenDelete:item.hiddenDelete || false, //
}) })

60
src/components/PreviewPDF/index.vue

@ -0,0 +1,60 @@
<template>
<el-dialog class="preview" v-model="showDialog" style="" @close="closeView">
<iframe v-if="isPDF" ref="pdfRef" width="100%" :height="frameHeight" :src="pdfUrl" frameborder="0"></iframe>
<el-carousel justify="center" v-else indicator-position="outside">
<el-carousel-item class="carousel-item" v-for="url in imageArray" :key="url">
<el-image style="height:100%" fit="contain" :src="url" loading="lazy" />
</el-carousel-item>
</el-carousel>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const showDialog = ref(false) //
const message = useMessage() //
const isPDF = ref(false) // pdf
const pdfUrl = ref<string>('') // pdf
const pdfRef = ref() // pdf
const frameHeight = ref(0)
const imageArray = ref<string[]>([]) //
const closeView = () => {
showDialog.value = false
}
//
const openPreview = async (data:string[]|string)=>{
showDialog.value = true
if(Array.isArray(data)){
//
isPDF.value = false
pdfUrl.value = ''
imageArray.value = data.filter(item=>(item.replace('/get/','/show/')))
}else{
isPDF.value = true
pdfUrl.value = data.replace('/get/','/show/')
nextTick(()=>{
frameHeight.value = window.innerHeight - 2*pdfRef.value.getBoundingClientRect().top
})
}
}
defineExpose({openPreview})
</script>
<style>
/* .preview .el-dialog__headerbtn .el-dialog__close{
color: white !important;
font-size: 20px !important;
}
.preview.el-dialog {
--el-dialog-box-shadow:null;
} */
</style>
<style lang="scss" scoped>
.carousel-item{
display: flex;
justify-content: center;
align-items: center;
}
</style>

14
src/utils/disposition/defaultButtons.ts

@ -187,6 +187,20 @@ export function formCloseBtn(option:any) {
}) })
} }
// form表单-关闭按钮
export function formStagingBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`btn.暂存`).replace('btn.', ''),
name: 'staging',
hide: false,
color: '',
float:'right',
hasPermi: ''
})
}
// drawer抽屉头部-编辑按钮 // drawer抽屉头部-编辑按钮
export function drawerEditBtn(option:any) { export function drawerEditBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

3
src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts

@ -10,6 +10,7 @@ export const SelectedProjectRules = reactive({
// dictionaryTypeAndCode: [required], // dictionaryTypeAndCode: [required],
estimateCode: [required], estimateCode: [required],
defectLevel: [required], defectLevel: [required],
dictionaryValue: [required]
}) })
export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
@ -28,7 +29,7 @@ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '选定集', label: '字典项',
field: 'dictionaryValue', field: 'dictionaryValue',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,

25
src/views/qms/basicDataManage/selectedSet/index.vue

@ -108,6 +108,7 @@ const tableData = ref([])
const routeName = ref() const routeName = ref()
const selectDictType = ref() const selectDictType = ref()
const optionsList = ref() const optionsList = ref()
const existValue = ref([])
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(SelectedSet.allSchemas.tableColumns) const tableColumns = ref(SelectedSet.allSchemas.tableColumns)
@ -377,16 +378,37 @@ const validateNotRepetition = (data) => {
}; };
const detailValidate = (data) => { const detailValidate = (formType,data) => {
let tag = true; let tag = true;
existValue.value.forEach(item=>{
if(data.dictionaryValue == item.dictionaryValue){
message.warning("选定集字典项不能重复!")
tag = false;
}
})
return tag return tag
} }
const detailOpenForm = (type, row, masterParmas) => { const detailOpenForm = (type, row, masterParmas) => {
let param = {
masterId : masterParmas.masterId
}
if(type == 'create'){ if(type == 'create'){
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
if(res.length > 0){
existValue.value = res
}
})
}else if('update'){ }else if('update'){
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
if(res.length > 0){
existValue.value = res.filter(item=>{
return item?.id != row.id
})
} }
})
}
} }
@ -396,6 +418,7 @@ const detailBasiFormOnChange = (field,val,detailFormRef) => {
} }
const formSelectChange = (a,b,c,d) => { const formSelectChange = (a,b,c,d) => {
} }
/** 初始化 **/ /** 初始化 **/

128
src/views/qms/inspection/inspectionJob/addForm.vue

@ -522,6 +522,10 @@ const buttonBaseClick =async(val) => {
// await InspectionJobMainApi.abandonInspectionJobMain(data.value.id) // await InspectionJobMainApi.abandonInspectionJobMain(data.value.id)
dialogVisible.value = false dialogVisible.value = false
} }
//
else if (val == 'staging') {
staging()
}
} }
// //
const emit = defineEmits(['submitForm', 'searchTableSuccess']) const emit = defineEmits(['submitForm', 'searchTableSuccess'])
@ -661,12 +665,136 @@ const submitForm = async () => {
console.log(111) console.log(111)
} }
} }
const staging = async () => {
try {
console.log(data.value.subList)
const elForm = unref(formMainRef)?.getElFormRef()
//
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
//
console.log(11,data.value.packageList)
if(data.value.packageList?.length>0){
const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
let isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount))
if(isPass){
message.error(`采样数量不能大于数量`)
return
}
// let number = 0
// data.value.packageList.forEach(cur=>{
// number += parseFloat(cur.sampleAmount)
// })
// number = number.toFixed('2')
// if(number != data.value.sampleTotalAmount){
// message.error(``)
// return
// }
}
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
return
}
//
let arrBol = []
let isOutweigh = []//
let numberList = []//
let parseFloatList = []//
data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
}
)
)
}
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.inspectionValue
}
)
)
}
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.qualitativeCode
}
)
)
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
parseFloatList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return String(cur.qualifiedQuantity).indexOf('.')>-1 || String(cur.unqualifiedQuantity).indexOf('.')>-1
}
)
)
//
numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
console.log(12,cur.qualifiedQuantity)
console.log(13,cur.unqualifiedQuantity)
console.log(14,item.inspectionJobCharacteristicsUpdateReqVO.sampleQty)
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty)
}
)
)
}
})
let isEmpty1 = arrBol.some(item=>item == true)
let isEmptyNumberList = numberList.some(item=>item == true)
let isParseFloat = parseFloatList.some(item=>item == true)
if(isEmpty1){
message.error('检验工序和检验特性有字段未填写完全')
return;
}
if(isOutweigh?.length>0){
message.error('检验特性中有开始时间大于结束时间')
return;
}
if(isParseFloat){
message.error('合格数量和不合格数量之和不可以是小数')
return;
}
if(isEmptyNumberList){
message.error('合格数量和不合格数量之和必须等于样品份数')
return;
}
await InspectionJobMainApi.stagingInspectionJobMain(data.value)
message.success('暂存成功!')
} catch {
console.log(111)
}
}
/** 弹窗按钮 */ /** 弹窗按钮 */
let Butttondata: any = [] let Butttondata: any = []
if (props.footButttondata) { if (props.footButttondata) {
Butttondata = props.footButttondata Butttondata = props.footButttondata
} else { } else {
Butttondata = [ Butttondata = [
defaultButtons.formStagingBtn(null), //
defaultButtons.formSaveBtn(null), // defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]

1
src/views/qms/inspection/inspectionJob/index.vue

@ -203,7 +203,6 @@ const list = ref([])
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain')
} }
// //
const formRef = ref() const formRef = ref()
const execute = async (type : string, row ?: number) => { const execute = async (type : string, row ?: number) => {
formRef.value.open(type, row) formRef.value.open(type, row)

38
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue

@ -53,6 +53,31 @@
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
:annexTable="[{
label: '质检明细',
prop: 'uploadFile',
tableName:'SupplierdeliverInspectionDetail',
hasSubDetail:true, //
showPreview:true, //
align:'left',
queryParams:[{
queryField:'tableId',
rowField:'annexMasterId',
}],
//
subDetailTableData:{
queryParams:[{
queryField:'masterId',
rowField:'annexMasterId',
}], //
getSubList:SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage,//
tableColumns:SupplierdeliverInspectionDetail.allSchemas.tableColumns,
tableList:[],//
total:1,
pageSize:10,
currentPage:1,
}
}]"
:isBasic="false" :isBasic="false"
:allSchemas="SupplierdeliverRecordMain.allSchemas" :allSchemas="SupplierdeliverRecordMain.allSchemas"
:detailAllSchemas="SupplierdeliverRecordDetail.allSchemas" :detailAllSchemas="SupplierdeliverRecordDetail.allSchemas"
@ -79,10 +104,13 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail'
import {   SupplierdeliverInspectionDetail,SupplierdeliverInspectionDetailRules} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data'
import { SupplierdeliverRecordMain,SupplierdeliverRecordMainRules, import { SupplierdeliverRecordMain,SupplierdeliverRecordMainRules,
SupplierdeliverRecordDetail,SupplierdeliverRecordDetailRules,SupplierdeliverRecordDetailPickingNumer } from './supplierdeliverRecordMain.data' SupplierdeliverRecordDetail,SupplierdeliverRecordDetailRules,SupplierdeliverRecordDetailPickingNumer } from './supplierdeliverRecordMain.data'
import * as SupplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain' import * as SupplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain'
import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
@ -197,9 +225,17 @@ const { getList:getDetailList } = detatableMethods
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = async (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
//masterId
const { tableObject: requestTableObject, tableMethods:requestTableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage //
})
const { getList:requestGetList } = requestTableMethods
requestTableObject.params.number = 'REQ0120240506-0002'
await requestGetList()
row.annexMasterId = requestTableObject.tableList[0].masterId
detailRef.value.openDetail(row, titleName, titleValue,'recordSupplierdeliverMain') detailRef.value.openDetail(row, titleName, titleValue,'recordSupplierdeliverMain')
} }

1
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -82,6 +82,7 @@
prop: 'uploadFile', prop: 'uploadFile',
tableName:'SupplierdeliverInspectionDetail', tableName:'SupplierdeliverInspectionDetail',
hasSubDetail:true, // hasSubDetail:true, //
showPreview:true, //
align:'left', align:'left',
// //
subDetailTableData:{ subDetailTableData:{

Loading…
Cancel
Save