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
0577e673dd
  1. 5
      src/api/mes/qualityform/index.ts
  2. 5
      src/api/mes/qualityformdetail/index.ts
  3. 5
      src/api/mes/qualityformlog/index.ts
  4. 54
      src/api/wms/supplierdeliverInspectionDetail/index.ts
  5. 10
      src/components/Detail/src/Detail.vue
  6. 14
      src/views/mes/dismantlingMain/dismantlingMain.data.ts
  7. 21
      src/views/mes/dismantlingMain/index.vue
  8. 18
      src/views/mes/qualityform/index.vue
  9. 7
      src/views/mes/qualityformlog/index.vue
  10. 4
      src/views/mes/qualityformlog/qualityformlog.data.ts
  11. 7
      src/views/qms/aql/aql.data.ts
  12. 8
      src/views/qms/inspectionMethod/inspectionMethod.data.ts
  13. 7
      src/views/qms/sampleCode/sampleCode.data.ts
  14. 59
      src/views/qms/samplingProcess/index.vue
  15. 30
      src/views/qms/samplingProcess/samplingProcess.data.ts
  16. 8
      src/views/qms/samplingScheme/samplingScheme.data.ts
  17. 4
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  18. 244
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/index.vue
  19. 89
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data.ts
  20. 30
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

5
src/api/mes/qualityform/index.ts

@ -48,8 +48,3 @@ export const deleteQualityform = async (id: number) => {
export const exportQualityform = async (params) => { export const exportQualityform = async (params) => {
return await request.download({ url: `/mes/qualityform/export-excel`, params }) return await request.download({ url: `/mes/qualityform/export-excel`, params })
} }
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityform/get-import-template' })
}

5
src/api/mes/qualityformdetail/index.ts

@ -54,8 +54,3 @@ export const deleteQualityformdetail = async (id: number) => {
export const exportQualityformdetail = async (params) => { export const exportQualityformdetail = async (params) => {
return await request.download({ url: `/mes/qualityformdetail/export-excel`, params }) return await request.download({ url: `/mes/qualityformdetail/export-excel`, params })
} }
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityformdetail/get-import-template' })
}

5
src/api/mes/qualityformlog/index.ts

@ -51,8 +51,3 @@ export const deleteQualityformlog = async (id: number) => {
export const exportQualityformlog = async (params) => { export const exportQualityformlog = async (params) => {
return await request.download({ url: `/mes/qualityformlog/export-excel`, params }) return await request.download({ url: `/mes/qualityformlog/export-excel`, params })
} }
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityformlog/get-import-template' })
}

54
src/api/wms/supplierdeliverInspectionDetail/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface SupplierdeliverInspectionDetailVO {
id: number
itemCode: string
uom: string
batch: string
planQty: number
remark: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询供应商发货申请质检信息子列表
export const getSupplierdeliverInspectionDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/supplierdeliver-inspection-detail/senior', data })
} else {
return await request.get({ url: `/wms/supplierdeliver-inspection-detail/page`, params })
}
}
// 查询供应商发货申请质检信息子详情
export const getSupplierdeliverInspectionDetail = async (id: number) => {
return await request.get({ url: `/wms/supplierdeliver-inspection-detail/get?id=` + id })
}
// 新增供应商发货申请质检信息子
export const createSupplierdeliverInspectionDetail = async (data: SupplierdeliverInspectionDetailVO) => {
return await request.post({ url: `/wms/supplierdeliver-inspection-detail/create`, data })
}
// 修改供应商发货申请质检信息子
export const updateSupplierdeliverInspectionDetail = async (data: SupplierdeliverInspectionDetailVO) => {
return await request.put({ url: `/wms/supplierdeliver-inspection-detail/update`, data })
}
// 删除供应商发货申请质检信息子
export const deleteSupplierdeliverInspectionDetail = async (id: number) => {
return await request.delete({ url: `/wms/supplierdeliver-inspection-detail/delete?id=` + id })
}
// 导出供应商发货申请质检信息子 Excel
export const exportSupplierdeliverInspectionDetail = async (params) => {
return await request.download({ url: `/wms/supplierdeliver-inspection-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplierdeliver-inspection-detail/get-import-template' })
}

10
src/components/Detail/src/Detail.vue

@ -111,15 +111,17 @@
@handleAnnexSuccess="handleAnnexSuccess" @handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess" @deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data" :upData="remarksData.data"
:key="count"
/> />
<!-- 备注组件 --> <!-- 备注组件 -->
<Remarks v-show="tabsList[current].label=='备注'" <Remarks v-show="tabsList[current].label=='备注'"
:remarksData="remarksData" :remarksData="remarksData"
class="mt-20px" class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess" @remarksSubmitScuess="remarksSubmitScuess"
:key="count"
/> />
<!-- 变更记录组件 --> <!-- 变更记录组件 -->
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" /> <ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" :key="count"/>
</ElScrollbar> </ElScrollbar>
</ContentWrap> </ContentWrap>
</div> </div>
@ -362,7 +364,6 @@ const otherList = [...props.annexTable,{
label:'变更记录', label:'变更记录',
prop:'ChangeRecord' prop:'ChangeRecord'
}] }]
tabsList.value = [...tabsList?.value,...otherList] tabsList.value = [...tabsList?.value,...otherList]
if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) { if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) {
@ -498,6 +499,7 @@ const searchTableFormType = ref('') // 表单的类型:create - 新增;updat
const formRef = ref() const formRef = ref()
const titleNameRef = ref() const titleNameRef = ref()
const titleValueRef = ref() const titleValueRef = ref()
const count =ref(0)
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName titleNameRef.value = titleName
titleValueRef.value = titleValue titleValueRef.value = titleValue
@ -505,6 +507,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
tableId: row.id, tableId: row.id,
tableName: tableName tableName: tableName
} }
count.value++
// //
if (!props.isBasic) { if (!props.isBasic) {
// id // id
@ -713,7 +716,6 @@ const opensearchTable = (
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
debugger
if (val == 'edit') { if (val == 'edit') {
// //
if(props.isOpenSearchTable){ if(props.isOpenSearchTable){
@ -759,6 +761,7 @@ const submitForm = async (formType, data) => {
await props.apiUpdate(data) await props.apiUpdate(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
emit('handleMainFefresh')
formRef.value.dialogVisible = false formRef.value.dialogVisible = false
// //
await getList() await getList()
@ -802,6 +805,7 @@ const handleDelete = async (id: number) => {
await props.apiDelete(id) await props.apiDelete(id)
tableObject.loading = false tableObject.loading = false
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
emit('handleMainFefresh')
// //
await getList() await getList()
updateKey.value += 1 updateKey.value += 1

14
src/views/mes/dismantlingMain/dismantlingMain.data.ts

@ -143,13 +143,21 @@ export const DismantlingMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '工单状态', label: '工单状态',
field: 'workbillStatus',
sort: 'custom',
dictType: DICT_TYPE.DISMANTLING_MATERIAL_HANDLE_STATUS,
dictClass: 'string',
isSearch: true,
},
{
label: '是否可用',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS, dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string', dictClass: 'string',
isForm: true, isForm: false,
isSearch: true, isSearch: false,
isTable: true, isTable: false,
form: { form: {
component: 'Switch', component: 'Switch',
value: '2', value: '2',

21
src/views/mes/dismantlingMain/index.vue

@ -63,6 +63,7 @@
:detailButtonIsShowAdd="true" :detailButtonIsShowAdd="true"
:detailButtonIsShowEdit="true" :detailButtonIsShowEdit="true"
:detailButtonIsShowDelete="true" :detailButtonIsShowDelete="true"
@handleMainFefresh="handleMainFefresh"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:key="count" :key="count"
/> />
@ -170,9 +171,29 @@ const buttonTableClick = async (val, row) => {
} }
} }
let count = ref(0)
const handleMainFefresh = async()=>{
count.value++;
await getList()
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
if(type == "create"){
DismantlingMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'workbillStatus'){
item.value = '2';
item.componentProps.disabled = true
}
})
}else{
DismantlingMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'workbillStatus'){
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }

18
src/views/mes/qualityform/index.vue

@ -63,14 +63,11 @@
:detailButtonIsShowAdd="true" :detailButtonIsShowAdd="true"
:detailButtonIsShowEdit="true" :detailButtonIsShowEdit="true"
:detailButtonIsShowDelete="true" :detailButtonIsShowDelete="true"
@handleDeleteDetail="handleDeleteDetail" @handleMainFefresh="handleMainFefresh"
@handleCreateDetail="handleCreateDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:key="count" :key="count"
/> />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/qualityform/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -80,7 +77,6 @@ import * as QualityformApi from '@/api/mes/qualityform'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as QualityformDetailApi from '@/api/mes/qualityformdetail' import * as QualityformDetailApi from '@/api/mes/qualityformdetail'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'QmsQualityform' }) defineOptions({ name: 'QmsQualityform' })
@ -143,7 +139,6 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:qualityform:create'}), // defaultButtons.defaultAddBtn({hasPermi:'mes:qualityform:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:qualityform:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:qualityform:export'}), // defaultButtons.defaultExportBtn({hasPermi:'mes:qualityform:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
@ -188,15 +183,13 @@ const buttonTableClick = async (val, row) => {
handleDelete(row.id) handleDelete(row.id)
} }
} }
const handleDeleteDetail = async()=>{ // const handleDeleteDetail = async()=>{
getList() // getList()
// }
}
let count = ref(0) let count = ref(0)
const handleCreateDetail = async()=>{ const handleMainFefresh = async()=>{
count.value++ count.value++
getList() getList()
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
@ -291,7 +284,6 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await QualityformApi.importTemplate()
}) })
</script> </script>

7
src/views/mes/qualityformlog/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #formNo="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.formNo)">
<span>{{ row.code }}</span> <span>{{ row.formNo }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
@ -238,7 +238,6 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await QualityformlogApi.importTemplate()
}) })
</script> </script>

4
src/views/mes/qualityformlog/qualityformlog.data.ts

@ -177,8 +177,8 @@ export const Qualityformlog = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
type: 'datetime', valueFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x' type: 'daterange',
} }
}, },
}, },

7
src/views/qms/aql/aql.data.ts

@ -64,13 +64,6 @@ export const AqlRules = reactive({
}) })
const samplingSchemeList = await getSamplingScheme() const samplingSchemeList = await getSamplingScheme()
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{ {
label: '采样方案编码', label: '采样方案编码',
field: 'code', field: 'code',

8
src/views/qms/inspectionMethod/inspectionMethod.data.ts

@ -3,18 +3,10 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const InspectionMethodRules = reactive({ export const InspectionMethodRules = reactive({
// available: [required],
description: [required], description: [required],
}) })
export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',

7
src/views/qms/sampleCode/sampleCode.data.ts

@ -13,13 +13,6 @@ export const SampleCodeRules = reactive({
}) })
const samplingSchemeList = await getSamplingScheme() const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{ {
label: '采样方案编码', label: '采样方案编码',
field: 'code', field: 'code',

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

@ -66,7 +66,6 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import {getSamplingScheme} from "@/api/qms/samplingProcess";
defineOptions({ name: 'SamplingProcess' }) defineOptions({ name: 'SamplingProcess' })
@ -150,8 +149,56 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field =="sampleType"){
if(row.sampleType == "1"){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.label='样品量'
item.component = 'Input'
item.componentProps.disabled = true
}
if(item.field == "sampleProgCode"){
item.componentProps.disabled = true
}
})
}else if(row.sampleType == "2"){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.label='样品量(%)'
item.component = 'Input'
item.componentProps.disabled = false
}
if(item.field == "sampleProgCode"){
item.componentProps.disabled = true
}
})
}else if(row.sampleType == "3"){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.label='样品量'
item.component = 'Input'
item.componentProps.disabled = false
}
if(item.field == "sampleProgCode"){
item.componentProps.disabled = true
}
})
}else if(row.sampleType == "4"){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.componentProps.disabled = true
}
if(item.field == "sampleProgCode"){
item.component = 'Select'
item.componentProps.disabled = false
}
})
}
}
})
} }
// form // form
@ -263,13 +310,6 @@ const onChange =async (field,value)=>{
} }
}) })
}else if(field == 'sampleType'&& value == '4'){ }else if(field == 'sampleType'&& value == '4'){
const data = await SamplingProcessApi.getSamplingScheme()
const options = data.map(item=>{
return{
value:item.code,
label:item.description,
}
})
SamplingProcess.allSchemas.formSchema.forEach(item=>{ SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){ if(item.field == "sampleSize"){
item.componentProps.disabled = true item.componentProps.disabled = true
@ -277,7 +317,6 @@ const onChange =async (field,value)=>{
if(item.field == "sampleProgCode"){ if(item.field == "sampleProgCode"){
item.component = 'Select' item.component = 'Select'
item.componentProps.disabled = false item.componentProps.disabled = false
item.componentProps.options = options
} }
}) })
} }

30
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -1,22 +1,15 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from "@/api/qms/samplingProcess";
// 表单校验 // 表单校验
export const SamplingProcessRules = reactive({ export const SamplingProcessRules = reactive({
sampleType: [required], sampleType: [required],
evaluationMode: [required], evaluationMode: [required],
// available: [required],
description: [required], description: [required],
}) })
const samplingSchemeList = await getSamplingScheme()
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
@ -64,19 +57,16 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
field: 'sampleProgCode', field: 'sampleProgCode',
sort: 'custom', sort: 'custom',
form: { form: {
component: 'Select' component: 'Select',
componentProps: {
options: samplingSchemeList,
optionsAlias: {
labelField: 'description',
valueField: 'code'
},
}
}, },
}, },
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'Select'
// },
// },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

8
src/views/qms/samplingScheme/samplingScheme.data.ts

@ -3,18 +3,10 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const SamplingSchemeRules = reactive({ export const SamplingSchemeRules = reactive({
// available: [required],
description: [required], description: [required],
}) })
export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([ export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',

4
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -125,8 +125,6 @@
if(formField == 'supplierCode'){ if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code'] setV['supplierCode'] = val[0]['code']
setV['contacts'] = val[0]['contacts']
setV['phone'] = val[0]['phone']
await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => { await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => {
let beginTime = res.beginTime let beginTime = res.beginTime
var ms = beginTime.substring(0, 2) var ms = beginTime.substring(0, 2)
@ -136,6 +134,8 @@
var ms = endTime.substring(0, 2) var ms = endTime.substring(0, 2)
var me = endTime.substring(3) var me = endTime.substring(3)
setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me)) setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me))
setV['contacts'] = res.contacts
setV['phone'] = res.phone
}) })
tableData.value = [] tableData.value = []
} }

244
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierdeliverInspectionDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverInspectionDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="SupplierdeliverInspectionDetailRules"
:formAllSchemas="SupplierdeliverInspectionDetail.allSchemas"
:apiUpdate="SupplierdeliverInspectionDetailApi.updateSupplierdeliverInspectionDetail"
:apiCreate="SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierdeliverInspectionDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-inspection-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SupplierdeliverInspectionDetail,SupplierdeliverInspectionDetailRules } from './supplierdeliverInspectionDetail.data'
import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'SupplierdeliverInspectionDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverInspectionDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplierdeliverInspectionDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplierdeliverInspectionDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierdeliverInspectionDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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 butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:supplierdeliverInspectionDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierdeliverInspectionDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =SupplierdeliverInspectionDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data)
message.success(t('common.createSuccess'))
} else {
await SupplierdeliverInspectionDetailApi.updateSupplierdeliverInspectionDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierdeliverInspectionDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierdeliverInspectionDetailApi.exportSupplierdeliverInspectionDetail(tableObject.params)
download.excel(data, '供应商发货申请质检信息子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请质检信息子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverInspectionDetailApi.importTemplate()
})
</script>

89
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data.ts

@ -0,0 +1,89 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SupplierdeliverInspectionDetailRules = reactive({
itemCode: [required],
uom: [required],
concurrencyStamp: [required],
})
export const SupplierdeliverInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: true,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
isSearch: true,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
isForm: false,
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -116,8 +116,8 @@
:formAllSchemas="UploadQualityReport.allSchemas" :formAllSchemas="UploadQualityReport.allSchemas"
:tableAllSchemas="UploadQualityReport.allSchemas" :tableAllSchemas="UploadQualityReport.allSchemas"
:tableData="ploadQualityReportTableData" :tableData="ploadQualityReportTableData"
@handleAddTable="handleAddTableUploadQualityReport" @handleAddTable="SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail"
@handleDeleteTable="handleDeleteTableUploadQualityReport" @handleDeleteTable="SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail"
@submitForm="submitFormUploadQualityReport" @submitForm="submitFormUploadQualityReport"
:isShowReduceButton="true" :isShowReduceButton="true"
/> />
@ -142,6 +142,7 @@ import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverReque
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail' import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail'
import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data' import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data'
import { addDay } from '@/utils/formatTime' import { addDay } from '@/utils/formatTime'
@ -577,24 +578,17 @@ const handleUploadQualityReport = async (id: number) => {
}) })
ploadQualityReportTableData.value = [tableFormKeys] ploadQualityReportTableData.value = [tableFormKeys]
} }
const handleAddTableUploadQualityReport = ()=>{
const tableFormKeys = {}
UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
ploadQualityReportTableData.value.push(tableFormKeys)
}
const handleDeleteTableUploadQualityReport = (item, index) => {
ploadQualityReportTableData.value.splice(index, 1)
}
const submitFormUploadQualityReport = (formType, data) => { const submitFormUploadQualityReport = async (formType, data) => {
console.log("formType==",formType) if (formType === 'create') {
console.log("data==",data) await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data)
message.success(t('common.createSuccess'))
} else {
await SupplierdeliverInspectionDetailApi.updateSupplierdeliverInspectionDetail(data)
message.success(t('common.updateSuccess'))
}
ploadQualityReportRef.value.dialogVisible = false ploadQualityReportRef.value.dialogVisible = false
// formLabelRef.value.formLoading = false getList()
// formLabelRef.value.dialogVisible = false
} }
/** 提交审批按钮操作 */ /** 提交审批按钮操作 */

Loading…
Cancel
Save