Browse Source

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

master_hella_20240701
songguoqiang 8 months ago
parent
commit
31bc865faa
  1. 4
      .env.development
  2. 23
      src/api/qms/inspectionPlan/index.ts
  3. 18
      src/api/wms/supplierinvoiceRequestMain/index.ts
  4. 53
      src/components/Detail/src/Detail.vue
  5. 6
      src/utils/dict.ts
  6. 4
      src/views/login/components/LoginForm.vue
  7. 141
      src/views/qms/basicDataManage/inspectionPlan/addForm.vue
  8. 10
      src/views/qms/basicDataManage/inspectionPlan/index.vue
  9. 18
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
  10. 10
      src/views/qms/inspection/inspectionJob/index.vue
  11. 241
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionJobMain/index.vue
  12. 769
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionJobMain/sparepartsrequisitionJobMain.data.ts
  13. 174
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/index.vue
  14. 592
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/sparepartsrequisitionRecordMain.data.ts
  15. 460
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/index.vue
  16. 669
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/sparepartsrequisitionRequestMain.data.ts
  17. 1
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
  18. 1
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
  19. 164
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
  20. 211
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  21. 597
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

4
.env.development

@ -4,10 +4,10 @@ NODE_ENV=development
VITE_DEV=false VITE_DEV=false
# 请求路径 # 请求路径
VITE_BASE_URL='http://localhost:12080' VITE_BASE_URL='http://192.168.0.108:12080'
# 上传路径 # 上传路径
VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload'
# 接口前缀 # 接口前缀
VITE_API_BASEPATH=/dev-api VITE_API_BASEPATH=/dev-api

23
src/api/qms/inspectionPlan/index.ts

@ -1,30 +1,23 @@
import request from '@/config/axios' import request from '@/config/axios'
// 查询采样过程列表
export const getListByTempleteCode = async (code) => {
return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code})
}
// 新增 // 新增
export const inspectionTemplateCreat = async (data) => { export const inspectionPlanCreat = async (data) => {
return await request.post({ url: `/qms/programme-template/create`,data}) return await request.post({ url: `/qms/type-template/create`,data})
} }
// 编辑 // 编辑
export const inspectionTemplateUpdate = async (data) => { export const inspectionPlanUpdate = async (data) => {
return await request.put({ url: `/qms/programme-template/update`,data}) return await request.put({ url: `/qms/type-template/update`,data})
} }
// 删除 // 删除
export const inspectionTemplateDelete = async (id) => { export const inspectionPlanDelete = async (id) => {
return await request.delete({ url: `/qms/programme-template/delete?id=`+id}) return await request.delete({ url: `/qms/type-template/delete?id=`+id})
} }
// 列表 // 列表
export const inspectionTemplatePage = async (params) => { export const inspectionPlanPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return request.post({ url: '/wms/accountcalendar/senior', data }) return request.post({ url: '/wms/accountcalendar/senior', data })
} else { } else {
return await request.get({ url: `/qms/programme-template/page`, params }) return await request.get({ url: `/qms/type-template/page`, params })
} }
} }

18
src/api/wms/supplierinvoiceRequestMain/index.ts

@ -68,14 +68,24 @@ export const cloSupplierinvoiceRequestMain = async (id: number) => {
export const subSupplierinvoiceRequestMain = async (id: number) => { export const subSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/sub?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/sub?id=` + id })
} }
// 审批通过供应商发货申请主 // 供应商--审批通过供应商发货申请主
export const appSupplierinvoiceRequestMain = async (id: number) => { export const appSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id })
} }
// 驳回供应商发货申请主 // 供应商--驳回供应商发货申请主
export const rejSupplierinvoiceRequestMain = async (id: number) => { export const rejSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id })
} }
// 财务--审批通过供应商发货申请主
export const financeappSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeApp?id=` + id })
}
// 财务--驳回供应商发货申请主
export const financerejSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej?id=` + id })
}
// 生成记录 // 生成记录
export const genRecordsSupplierinvoiceRequestMain = async (id) => { export const genRecordsSupplierinvoiceRequestMain = async (id) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/genRecords?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/genRecords?id=` + id })
@ -89,3 +99,7 @@ export const exportSupplierinvoiceRequestMain = async (params) => {
} }
} }
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplierinvoice-request-main/get-import-template' })
}

53
src/components/Detail/src/Detail.vue

@ -28,7 +28,7 @@
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> <Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'"> <!-- 列表头部 --> <ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 -->
<TableHead <TableHead
v-if="!isBasic" v-if="!isBasic"
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@ -97,15 +97,21 @@
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
<!-- 附件/备注/变更记录 --> <!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> <ContentWrap class="w-[100%]" v-show="annexTableData.some(item=>item.label==tabsList[current].label)||tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 --> <!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> <ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label=='附件'" <Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label"
:annexData="annexData" :annexData="annexItem"
@handleAnnexSuccess="handleAnnexSuccess" @handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="deleteAnnexSuccess" @deleteAnnexSuccess="updateAnnexTableHandle"
:upData="remarksData.data" :upData="{...remarksData.data,tableName:annexItem.tableName}"
/> />
<Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 --> <!-- 备注组件 -->
<Remarks v-show="tabsList[current].label=='备注'" <Remarks v-show="tabsList[current].label=='备注'"
:remarksData="remarksData" :remarksData="remarksData"
@ -176,6 +182,12 @@ const props = defineProps({
required: true, required: true,
default: null default: null
}, },
//tab
annexTable: {
type: Array,
required: false,
default: ()=>[]
},
// //
isBasic: { isBasic: {
type: Boolean, type: Boolean,
@ -334,7 +346,7 @@ if (props.isBasic == true) {
} }
} }
const otherList = [{ const otherList = [...props.annexTable,{
label:'附件', label:'附件',
prop:'Annex' prop:'Annex'
},{ },{
@ -373,6 +385,8 @@ const remarkHeight = computed(() => {
const annexData = reactive({ const annexData = reactive({
annexList: [] annexList: []
}) })
//
const annexTableData = ref<Array<any>>([])
// //
const remarksData = reactive({ const remarksData = reactive({
@ -394,6 +408,23 @@ const getFileList = async () => {
detailLoading.value = false detailLoading.value = false
} }
} }
//
const getAnnexFileList = async () => {
props.annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName}
const annexList = await FileApi.getFileList(requstData)
const annexData = annexTableData.value.find(annex=>annex.label === item.label)
if(annexData){
annexData.annexList = annexList
}else{
annexTableData.value.push({
label: item.label,
tableName: item?.tableName || '',
annexList
})
}
})
}
/** 添加附件 */ /** 添加附件 */
const handleAnnexSuccess = () => { const handleAnnexSuccess = () => {
getFileList() getFileList()
@ -404,6 +435,11 @@ const deleteAnnexSuccess = async () => {
getFileList() getFileList()
getChangeRecordList() getChangeRecordList()
} }
/** 追加的附件 */
const updateAnnexTableHandle = () => {
getAnnexFileList()
getChangeRecordList()
}
// Tabs // Tabs
const current = ref(0) const current = ref(0)
@ -481,6 +517,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailData.value = row detailData.value = row
getRemarkList() getRemarkList()
getFileList() getFileList()
getAnnexFileList()
getChangeRecordList() getChangeRecordList()
// //
let detailButtonFilter: any = [] let detailButtonFilter: any = []

6
src/utils/dict.ts

@ -293,7 +293,9 @@ export enum DICT_TYPE {
INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型 INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型
INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式 INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式
INSPECTION_SEVERITY = 'inspection_severity',//检验严重性 INSPECTION_SEVERITY = 'inspection_severity',//检验严重性
SPLIT_RULES = "split_rules", // 拆分规则
INSPECTION_LEVEL = "inspection_level", // 检验水平字典
BASIC_AQL = "basic_aql", // aql
// ========== 业务 - mes -gaojs ========== // ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态 QUALIFY_STATUS = 'qualify_status',//质检状态
@ -304,6 +306,6 @@ export enum DICT_TYPE {
REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记 REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记
REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成 REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成
REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件 REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件
SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态
} }

4
src/views/login/components/LoginForm.vue

@ -100,7 +100,7 @@ const iconLock = useIcon({ icon: 'ep:lock' })
const formLogin = ref() const formLogin = ref()
const { validForm } = useFormValid(formLogin) const { validForm } = useFormValid(formLogin)
const { setLoginState, getLoginState } = useLoginState() const { setLoginState, getLoginState } = useLoginState()
const { currentRoute, push } = useRouter() const { currentRoute, push , replace} = useRouter()
const permissionStore = usePermissionStore() const permissionStore = usePermissionStore()
const redirect = ref<string>('') const redirect = ref<string>('')
const loginLoading = ref(false) const loginLoading = ref(false)
@ -215,7 +215,7 @@ const handleLogin = async (params) => {
window.location.href = window.location.href.replace('/login?redirect=', '') window.location.href = window.location.href.replace('/login?redirect=', '')
} else { } else {
console.log(redirect.value) console.log(redirect.value)
push({ path: redirect.value || permissionStore.addRouters[0].path }) replace({ path: redirect.value || permissionStore.addRouters[0].path })
} }
// //
const { wsCache } = useCache() const { wsCache } = useCache()

141
src/views/qms/basicDataManage/inspectionPlan/addForm.vue

@ -7,9 +7,8 @@
:vLoading="formLoading" :vLoading="formLoading"
> >
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px"> <div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> <el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
<el-row> <el-row gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" /> <el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" />
@ -25,6 +24,103 @@
<el-input v-model="data.version" placeholder="请填写版本" /> <el-input v-model="data.version" placeholder="请填写版本" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="检验类型编码" prop="testTypeCode" >
<div style="display: flex; width: 100%">
<el-input
v-model="data.testTypeCode"
disabled
placeholder="请选择检验类型编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="opensearchTable('testTypeCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApi.getSamplingProcessPage,null,false,null,item)"
><Icon icon="ep:search"/>
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验模板编码" prop="programmeTemplateCode" >
<div style="display: flex; width: 100%">
<el-input
v-model="data.testTypeCode"
disabled
placeholder="请选择检验模板编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="opensearchTable('programmeTemplateCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApigetSamplingProcessPage,null,false,null,item)"
><Icon icon="ep:search"/>
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="拆分规则" prop="splitRule">
<el-select v-model="data.splitRule" placeholder="请选择拆分规则" >
<el-option
v-for="dict in getStrDictOptions( DICT_TYPE.SPLIT_RULES )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="aql" prop="aql">
<el-select v-model="data.aql" placeholder="请选择aql" >
<el-option
v-for="dict in getStrDictOptions( DICT_TYPE.BASIC_AQL )"
: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="inspectionLevel">
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平" >
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_LEVEL )"
: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="effectiveDate">
<el-date-picker
v-model="data.effectiveDate"
type="datetime"
placeholder="请选择生效时间"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="失效时间" prop="expirationDate">
<el-date-picker
v-model="data.expirationDate"
type="datetime"
placeholder="请选择失效时间"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-switch v-model="data.available" />
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-tabs <el-tabs
@ -43,13 +139,6 @@
:name="item.name" :name="item.name"
> >
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<!-- <Form
:ref="`formRefProcess`+index"
:schema="formAllSchemasProcess"
:is-col="true"
labelWidth="150px"
:rules="rules"
/> -->
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> <el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
@ -483,6 +572,7 @@ const data = ref({
code: '', code: '',
description: '', description: '',
version: '', version: '',
available:true,
process: [] process: []
}) })
const isYesList = [ const isYesList = [
@ -576,10 +666,28 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type formType.value = type
if (row) { if (row) {
data.value = row data.value = row
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
//
if(item.quantifyIsCapping){
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if(item.quantifyIsLowlimit){
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if(item.quantifyIsTarget){
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
}) })
data.value.process = list data.value.process = list
} else { } else {
@ -587,6 +695,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
code: '', code: '',
description: '', description: '',
version: '', version: '',
available:true,
process: [] process: []
} }
} }
@ -645,6 +754,7 @@ const buttonBaseClick1 = (val) => {
featureType: '', featureType: '',
quantifyIsCapping: '', quantifyIsCapping: '',
quantifyIsLowlimit: '', quantifyIsLowlimit: '',
quantifyIsTarget: '',
quantifyTarget: '', quantifyTarget: '',
quantifyCapping: '', quantifyCapping: '',
quantifyLowlimit: '', quantifyLowlimit: '',
@ -691,6 +801,7 @@ const validateForm = (formRef) => {
return false return false
}) })
} }
const submitForm = async () => { const submitForm = async () => {
try { try {
const validateForm1 = await validateForm(formProcessRef.value) const validateForm1 = await validateForm(formProcessRef.value)
@ -706,6 +817,13 @@ const submitForm = async () => {
message.error(`模板中有检验工序和检验特性未填写完全`) message.error(`模板中有检验工序和检验特性未填写完全`)
return; return;
} }
const arr = data.value.process.filter(item=>(!item.inspectionCharacteristicsBaseVO.quantifyIsCapping&&!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit&&!item.inspectionCharacteristicsBaseVO.quantifyIsTarget&&item.inspectionCharacteristicsBaseVO.featureType == 0))
console.log(arr)
if(arr&&arr.length>0){
const str = arr.map(item=>item.description).join(',')
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
return;
}
if (formType.value == 'create') { if (formType.value == 'create') {
// //
emit('submitForm', formType.value, data) emit('submitForm', formType.value, data)
@ -730,6 +848,11 @@ if (props.footButttondata) {
// //
const changeFeatureType = (e) => { const changeFeatureType = (e) => {
console.log(e) console.log(e)
// if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// }
} }
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = ( const opensearchTable = (

10
src/views/qms/basicDataManage/inspectionPlan/index.vue

@ -66,7 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import * as InspectionProcessPageApi from '@/api/qms/inspectionPlan' import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
defineOptions({ name: 'AgvLocationrelation' }) defineOptions({ name: 'AgvLocationrelation' })
@ -84,7 +84,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: InspectionProcessPageApi.inspectionTemplatePage // getListApi: InspectionPlanApi.inspectionPlanPage //
}) })
// //
@ -149,10 +149,10 @@ const openForm = (type: string, row?: any) => {
const submitForm = async (formType,data) => { const submitForm = async (formType,data) => {
console.log(data.value) console.log(data.value)
if (formType === 'create') { if (formType === 'create') {
await InspectionProcessPageApi.inspectionTemplateCreat(data.value) await InspectionPlanApi.inspectionPlanCreat(data.value)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await InspectionProcessPageApi.inspectionTemplateUpdate(data.value) await InspectionPlanApi.inspectionPlanUpdate(data.value)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -171,7 +171,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await InspectionProcessPageApi.inspectionTemplateDelete(id) await InspectionPlanApi.inspectionPlanDelete(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

18
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -8,7 +8,7 @@
> >
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px"> <div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> --> <!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> <el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef" gutter="20">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
@ -284,7 +284,9 @@
label="是否设定上限" label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-select
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
placeholder="请选择是否设定上限" placeholder="请选择是否设定上限"
@change="changeIsCapping" @change="changeIsCapping"
@ -295,7 +297,7 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -313,7 +315,8 @@
label="是否设定下限" label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-select <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
placeholder="请选择是否设定下限" placeholder="请选择是否设定下限"
@change="changeLowlimit" @change="changeLowlimit"
@ -324,7 +327,7 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -342,7 +345,8 @@
label="是否设定目标值" label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-select <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
placeholder="请选择是否设定目标值" placeholder="请选择是否设定目标值"
@change="changeIsTarget" @change="changeIsTarget"
@ -353,7 +357,7 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">

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

@ -78,11 +78,11 @@
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number'] // row['itemNumber'] = val[0]['number']
row['itemName'] = val[0]['name'] // row['itemName'] = val[0]['name']
row['uom'] = val[0]['uom'] // row['uom'] = val[0]['uom']
row['isRadeIn'] = val[0]['isRadeIn'] // row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available'] // row['available'] = val[0]['available']
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]

241
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionJobMain/index.vue

@ -0,0 +1,241 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="UnplannedissueJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="UnplannedissueJobMain.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 #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>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="UnplannedissueJobMainRules"
:formAllSchemas="UnplannedissueJobMain.allSchemas"
:searchTableParams="searchTableParams"
:tableAllSchemas="UnplannedissueJobDetail.allSchemas"
:tableFormRules="UnplannedissueJobDetailRules"
:apiUpdate="UnplannedissueJobMainApi.updateUnplannedissueJobMain"
:apiCreate="UnplannedissueJobMainApi.createUnplannedissueJobMain"
:isBusiness="true"
@searchTableSuccess="searchTableSuccess"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="UnplannedissueJobMain.allSchemas"
:detailAllSchemas="UnplannedissueJobDetail.allSchemas"
:detailAllSchemasRules="UnplannedissueJobDetailRules"
:searchTableParams="searchTableParams"
:apiPage="UnplannedissueJobDetailApi.getUnplannedissueJobDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { UnplannedissueJobMain,UnplannedissueJobMainRules,UnplannedissueJobDetail,UnplannedissueJobDetailRules } from './sparepartsrequisitionJobMain.data'
import * as UnplannedissueJobMainApi from '@/api/wms/unplannedissueJobMain'
import * as UnplannedissueJobDetailApi from '@/api/wms/unplannedissueJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
//
defineOptions({ name: 'UnplannedissueJobMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(UnplannedissueJobMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
//row[formField] = val[0][searchField]
//row['poLine'] = val[0]['poLine']
//row['batch'] = val[0]['toBatch']
//row['altBatch'] = val[0]['altBatch']
//row['itemCode'] = val[0]['itemCode']
//row['itemName'] = val[0]['itemName']
//row['itemDesc1'] = val[0]['itemDesc1']
//row['itemDesc2'] = val[0]['itemDesc2']
//row['projectCode'] = val[0]['projectCode']
//row['qty'] = val[0]['qty']
//row['uom'] = val[0]['uom']
} else {
const setV = {}
setV[formField] = val[0][searchField]
//setV['ppNumber'] = val[0]['ppNumber']
//setV['supplierCode'] = val[0]['supplierCode']
formRef.setValues(setV)
}
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: UnplannedissueJobMainApi.getUnplannedissueJobMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:unplannedissue-job-main: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 == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
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 butttondata = (row) => {
return [
// defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), //
// defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { //
console.log('列表-操作按钮事件-执行')
} else if (val == 'mainJobAba') { //
console.log('列表-操作按钮事件-放弃')
} else if (val == 'mainJobClo') { //
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainJobAcc') { //
console.log('列表-操作按钮事件-承接')
}
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'jobUnplannedissueMain')
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await UnplannedissueJobMainApi.exportUnplannedissueJobMain(tableObject.params)
download.excel(data, '计划外出库任务主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

769
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionJobMain/sparepartsrequisitionJobMain.data.ts

@ -0,0 +1,769 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
/**
* @returns {Array}
*/
export const UnplannedissueJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
isSearch: true,
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '要求截止时间',
field: 'requestDueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '过期时间',
field: 'expiredTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '状态',
// field: 'jobStageStatus',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '优先级增量',
field: 'priorityIncrement',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '自动完成',
field: 'autoComplete',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改库位',
field: 'allowModifyLocation',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改数量',
field: 'allowModifyQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许大于推荐数量',
field: 'allowBiggerQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许小于推荐数量',
field: 'allowSmallerQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改库存状态',
field: 'allowModifyInventoryStatus',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许连续扫描',
field: 'allowContinuousScanning',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许部分完成',
field: 'allowPartialComplete',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改批次',
field: 'allowModifyBatch',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改箱码',
field: 'allowModifyPackingNumber',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '承接时间',
field: 'acceptTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '承接人',
field: 'acceptUserId',
sort: 'custom',
table: {
width: 150
},
},
{
label: '完成时间',
field: 'completeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '完成人',
field: 'completeUserId',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 120,
fixed: 'right'
},
}
]))
//表单校验
export const UnplannedissueJobMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
fromAreaCodes: [
{ required: true, message: '请选择从库区代码范围', trigger: 'change' }
],
requestTime: [
{ required: true, message: '请输入申请时间', trigger: 'change' }
],
requestDueTime: [
{ required: true, message: '请输入要求截止时间', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
// jobStageStatus: [
// { required: true, message: '请选择阶段状态', trigger: 'change' }
// ],
priority: [
{ required: true, message: '请输入优先级', trigger: 'blur' }
],
priorityIncrement: [
{ required: true, message: '请输入优先级增量', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
userPositionCode: [
{ required: true, message: '请输入岗位', trigger: 'blur' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const UnplannedissueJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '原因',
field: 'reason',
dictType: DICT_TYPE.UNPLANNED_ISSUE_REASON,
dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return cellValue
},
table: {
width: 150
},
form: {
componentProps: {
filterable: true
}
},
tableForm: {
type: 'Select',
filterable: true
}
},
{
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
]))
//表单校验
export const UnplannedissueJobDetailRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})

174
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/index.vue

@ -0,0 +1,174 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="UnplannedissueRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="UnplannedissueRecordMain.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 #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>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="UnplannedissueRecordMainRules"
:formAllSchemas="UnplannedissueRecordMain.allSchemas"
:tableAllSchemas="UnplannedissueRecordDetail.allSchemas"
:tableFormRules="UnplannedissueRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="UnplannedissueRecordMain.allSchemas"
:detailAllSchemas="UnplannedissueRecordDetail.allSchemas"
:detailAllSchemasRules="UnplannedissueRecordDetailRules"
:apiPage="UnplannedissueRecordDetailApi.getUnplannedissueRecordDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { UnplannedissueRecordMain,UnplannedissueRecordMainRules,UnplannedissueRecordDetail,UnplannedissueRecordDetailRules } from './sparepartsrequisitionRecordMain.data'
import * as UnplannedissueRecordMainApi from '@/api/wms/unplannedissueRecordMain'
import * as UnplannedissueRecordDetailApi from '@/api/wms/unplannedissueRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
//
defineOptions({ name: 'UnplannedissueRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(UnplannedissueRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: UnplannedissueRecordMainApi.getUnplannedissueRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:unplannedissue-record-main: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 == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) => {
return []
}
// -
const buttonTableClick = async (val, row) => {
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'recordUnplannedissueMain')
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await UnplannedissueRecordMainApi.exportUnplannedissueRecordMain(tableObject.params)
download.excel(data, '计划外出库记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

592
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/sparepartsrequisitionRecordMain.data.ts

@ -0,0 +1,592 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
/**
* @returns {Array}
*/
export const UnplannedissueRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: true
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '生效日期',
field: 'activeDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从月台代码',
field: 'fromDockCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
]))
//表单校验
export const UnplannedissueRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
fromAreaCodes: [
{ required: true, message: '请选择从库区代码范围', trigger: 'change' }
],
outTransaction: [
{ required: true, message: '请输入出库事务类型', trigger: 'blur' }
],
inTransaction: [
{ required: true, message: '请输入入库事务类型', trigger: 'blur' }
],
executeTime: [
{ required: true, message: '请输入执行时间', trigger: 'change' }
],
activeDate: [
{ required: true, message: '请输入生效日期', trigger: 'change' }
],
available: [
{ required: true, message: '请输入是否可用', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
interfaceType: [
{ required: true, message: '请选择接口类型', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const UnplannedissueRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '金额',
field: 'amount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '原因',
field: 'reason',
dictType: DICT_TYPE.UNPLANNED_ISSUE_REASON,
dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return cellValue
},
table: {
width: 150
},
form: {
componentProps: {
filterable: true
}
},
tableForm: {
type: 'Select',
filterable: true
}
},
{
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '任务明细ID',
// field: 'jobDetailId',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
]))
//表单校验
export const UnplannedissueRecordDetailRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
fromLocationGroupCode: [
{ required: true, message: '请选择从库位组代码', trigger: 'change' }
],
fromAreaCode: [
{ required: true, message: '请选择从库区代码', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})

460
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/index.vue

@ -0,0 +1,460 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="UnplannedissueRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="UnplannedissueRequestMain.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 #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>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="UnplannedissueRequestMainRules"
:formAllSchemas="UnplannedissueRequestMain.allSchemas"
:tableAllSchemas="UnplannedissueRequestDetail.allSchemas"
:tableFormRules="UnplannedissueRequestDetailRules"
:tableData="tableData"
:apiUpdate="UnplannedissueRequestMainApi.updateUnplannedissueRequestMain"
:apiCreate="UnplannedissueRequestMainApi.createUnplannedissueRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@tableFormSelectOnBlur="tableFormSelectOnBlur"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="UnplannedissueRequestMain.allSchemas"
:detailAllSchemas="UnplannedissueRequestDetail.allSchemas"
:detailAllSchemasRules="UnplannedissueRequestDetailRules"
:apiCreate="UnplannedissueRequestDetailApi.createUnplannedissueRequestDetail"
:apiUpdate="UnplannedissueRequestDetailApi.updateUnplannedissueRequestDetail"
:apiPage="UnplannedissueRequestDetailApi.getUnplannedissueRequestDetailPage"
:apiDelete="UnplannedissueRequestDetailApi.deleteUnplannedissueRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailValidate="detailValidate"
@onBlur="onBlur"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/unplannedissue-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { UnplannedissueRequestMain,UnplannedissueRequestMainRules,UnplannedissueRequestDetail,UnplannedissueRequestDetailRules } from './sparepartsrequisitionRequestMain.data'
import * as UnplannedissueRequestMainApi from '@/api/wms/unplannedissueRequestMain'
import * as UnplannedissueRequestDetailApi from '@/api/wms/unplannedissueRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
//
defineOptions({ name: 'UnplannedissueRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(UnplannedissueRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['packingNumber'] = val[0]['packingNumber']
setV['containerNumber'] = val[0]['containerNumber']
setV['batch'] = val[0]['batch']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['fromLocationCode'] = val[0]['locationCode']
setV['itemCode'] = val[0]['itemCode']
formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: UnplannedissueRequestMainApi.getUnplannedissueRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:unplannedissue-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:unplannedissue-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:unplannedissue-request-main: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') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
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 butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:unplannedissue-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:unplannedissue-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:unplannedissue-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:unplannedissue-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:unplannedissue-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:unplannedissue-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:unplannedissue-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:unplannedissue-request-main:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
handleClose(row.id)
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
handleReAdd(row.id)
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
handleRefused(row.id)
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
handleAgree(row.id)
} else if (val == 'mainHandle') { //
handleHandle(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
await message.confirm(t('common.confirmHandle'))
tableObject.loading = true
await UnplannedissueRequestMainApi.handleUnplannedissueRequestMain(id)
message.success(t('common.handleSuccess'))
tableObject.loading = false
await getList()
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
await message.confirm(t('common.confirmAgree'))
tableObject.loading = true
await UnplannedissueRequestMainApi.agreeUnplannedissueRequestMain(id)
message.success(t('common.agreeSuccess'))
tableObject.loading = false
await getList()
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
await message.confirm(t('common.confirmRefused'))
tableObject.loading = true
await UnplannedissueRequestMainApi.refusedUnplannedissueRequestMain(id)
message.success(t('common.refusedSuccess'))
tableObject.loading = false
await getList()
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
await message.confirm(t('common.confirmSubmit'))
tableObject.loading = true
await UnplannedissueRequestMainApi.submitUnplannedissueRequestMain(id)
message.success(t('common.submitSuccess'))
tableObject.loading = false
await getList()
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
await message.confirm(t('common.confirmColse'))
tableObject.loading = true
await UnplannedissueRequestMainApi.closeUnplannedissueRequestMain(id)
message.success(t('common.closeSuccess'))
tableObject.loading = false
await getList()
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
await message.confirm(t('common.confirmReAdd'))
tableObject.loading = true
await UnplannedissueRequestMainApi.reAddUnplannedissueRequestMain(id)
message.success(t('common.reAddSuccess'))
tableObject.loading = false
await getList()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'requestUnplannedissueMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await UnplannedissueRequestMainApi.deleteUnplannedissueRequestMain(id)
message.success(t('common.delSuccess'))
tableObject.loading = false
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await UnplannedissueRequestMainApi.exportUnplannedissueRequestMain(tableObject.params)
download.excel(data, '计划外出库申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
UnplannedissueRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
console.log("【计划外出库子列表】",data.subList)
if(data.subList.length == 0){
message.warning("请添加子列表数据")
return;
}
let flag = false;
data.subList.forEach((item) => {
if(item.qty == 0){
message.warning("数量不能为0")
flag = true;
return;
}
})
if(flag){
formRef.value.formLoading = false
return
}
await UnplannedissueRequestMainApi.createUnplannedissueRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await UnplannedissueRequestMainApi.updateUnplannedissueRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
const onBlur = (field, e) => {
if (field == 'reason') {
detailRef.value.formRef.formRef.formModel[field] = e.target.value
}
}
const tableFormSelectOnBlur = (field, val, row, index) => {
if (field == 'reason') {
tableData.value[index][field] = val.target.value
}
}
// /
const detailValidate = (data) => {
let tag = false;
if(data.qty <= 0){
message.warning('数量必须大于0')
tag = false;
return tag;
}else {
tag = true;
return tag;
}
}
/** 导入 */
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 UnplannedissueRequestMainApi.importTemplate()
})
</script>

669
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/sparepartsrequisitionRequestMain.data.ts

@ -0,0 +1,669 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'UnplannedDeliverRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
/**
* @returns {Array}
*/
export const UnplannedissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isForm: false,
isSearch: true,
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isSearch: true,
isForm: false,
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
isForm: false,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
form: {
value: 'UnplannedDeliver',
componentProps: {
disabled: true
}
},
isForm: false,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
}
]))
//表单校验
export const UnplannedissueRequestMainRules = reactive({
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],
autoAgree: [
{ required: true, message: '请选择是否自动通过', trigger: 'change' }
],
autoExecute: [
{ required: true, message: '请选择是否自动执行', trigger: 'change' }
],
directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const UnplannedissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage
}
}
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6,
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '原因',
field: 'reason',
dictType: DICT_TYPE.UNPLANNED_ISSUE_REASON,
dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return cellValue
},
table: {
width: 150
},
form: {
componentProps: {
filterable: true
}
},
tableForm: {
type: 'Select',
filterable: true
}
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
isForm: false,
isTableForm: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
]))
//表单校验
export const UnplannedissueRequestDetailRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
containerNumber: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})

1
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

@ -533,6 +533,7 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.type = 'predict'
data.subList = tableData.value // data.subList = tableData.value //
if(data.subList.find(item => (item.qty <= 0))) { if(data.subList.find(item => (item.qty <= 0))) {
message.warning('数量必须大于0') message.warning('数量必须大于0')

1
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue

@ -532,6 +532,7 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.type = 'assemble'
data.subList = tableData.value // data.subList = tableData.value //
if(data.subList.find(item => (item.qty <= 0))) { if(data.subList.find(item => (item.qty <= 0))) {
message.warning('数量必须大于0') message.warning('数量必须大于0')

164
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts

@ -34,8 +34,63 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true isSearch: true
}, },
{ {
label: '调增金额', label: '金额',
field: 'adjustAmount', field: 'amount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '税率',
field: 'taxRate',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '税后金额',
field: 'afterTaxAmount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '折扣金额',
field: 'discountAmount',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -44,6 +99,48 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'InputNumber', component: 'InputNumber',
} }
}, },
{
label: '调整税额',
field: 'adjustingTaxAmount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '快递单号',
field: 'expressTrackingNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '发票时间',
field: 'invoiceTime',
isTable: true,
formatter: dateFormatter,
deatil: {
dateFormatter: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
},
{ {
label: '业务类型', label: '业务类型',
field:'businessType', field:'businessType',
@ -226,16 +323,16 @@ export const SupplierinvoiceRecordMainRules = reactive({
*/ */
export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '收货单号', label: '项目编号',
field: 'recordNumber', field: 'projectCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '批次', label: '单据类型',
field: 'batch', field: 'billType',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -265,6 +362,22 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 180 width: 180
}, },
}, },
{
label: '发货单号',
field: 'asnBillNum',
sort: 'custom',
table: {
width: 180
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 180
},
},
{ {
label: '物料代码', label: '物料代码',
field: 'itemCode', field: 'itemCode',
@ -274,19 +387,16 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
}, },
}, },
{ {
label: '计量单位', label: '物料名称',
field: 'uom', field: 'itemName',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '数量', label: '货币',
field: 'qty', field: 'currency',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -304,8 +414,32 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
} }
}, },
{ {
label: '金额', label: '采购价格',
field: 'amount', field: 'purchasePrice',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '收货日期',
field: 'deliveryDate',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
},
{
label: '开票数量',
field: 'invoicableQuantity',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150

211
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -35,6 +35,8 @@
<BasicForm <BasicForm
ref="formRef" ref="formRef"
@success="getList" @success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="SupplierinvoiceRequestMainRules" :rules="SupplierinvoiceRequestMainRules"
:formAllSchemas="SupplierinvoiceRequestMain.allSchemas" :formAllSchemas="SupplierinvoiceRequestMain.allSchemas"
:searchTableParams="searchTableParams" :searchTableParams="searchTableParams"
@ -51,8 +53,21 @@
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
:annexTable="[{
label: '合同附件',
prop: 'Annex',
tableName:'contract'
},{
label: '电子发票附件',
prop: 'Annex',
tableName:'invoice'
},{
label: '货运单附件',
prop: 'Annex',
tableName:'waybill'
}]"
:isBasic="false" :isBasic="false"
:allSchemas="SupplierinvoiceRequestMain.allSchemas" :allSchemas="SupplierinvoiceRequestMain.allSchemas"
:detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas" :detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas"
@ -65,6 +80,17 @@
:Echo="Echo" :Echo="Echo"
/> />
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/wms/supplierinvoice-request-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -110,59 +136,32 @@
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] val.forEach(item=>{
if (formField == 'poLine') { const newRow = {...row}
row['poLine'] = val[0]['poLine'] newRow[formField] = item[searchField]
row['itemCode'] = val[0]['itemCode'] if (formField == 'poLine') {
row['ownerCode'] = val[0]['ownerCode'] newRow['poNumber'] = item['poNumber']
row['batch'] = val[0]['batch'] newRow['poLine'] = item['poLine']
row['singlePrice'] = val[0]['singlePrice'] newRow['tax'] =item['tax']
row['qty'] = val[0]['qty'] newRow['projectCode'] = item['projectCode']
row['amount'] = val[0]['amount'] newRow['billType'] = item['billType']
} newRow['recvBillNum'] = item['recvBillNum']
newRow['asnBillNum'] = item['asnBillNum']
newRow['supplierCode'] = item['supplierCode']
newRow['purchasePrice'] = item['purchasePrice']
newRow['invoicableQuantity'] = item['invoicableQuantity']
newRow['itemCode'] = item['itemCode']
}
tableData.value.push(newRow)
})
} else { } else {
console.log(searchFormRef.formModel);
const setV = {} const setV = {}
if(formField == 'recvBillNum'){
setV['recvBillNum'] = val[0]['number']
setV['asnBillNum'] = val[0]['asnNumber']
let params = {
'billType':searchFormRef.formModel.billType,
'recordNumber':val[0]['number']
}
let orderNoFlag = false;
SupplierinvoiceRequestDetailApi.getPoNumber(params).then(res =>{
console.log("返回结果:",res)
if(res.length == 0){
orderNoFlag = true
return
}
let options = [];
for(let i=0;i<res.length;i++){
let option = {
label:res[i],
value:res[i]
}
options.push(option)
}
SupplierinvoiceRequestMain.allSchemas.formSchema.forEach(item => {
if (item.field == 'poBillNum') {
item.componentProps.options = options
}
})
})
if(orderNoFlag){
message.error("选择的记录单号没有订单")
return;
}
}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
searchFormRef.setValues(setV) searchFormRef.setValues(setV)
} }
}) })
} }
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = [] const Echo = []
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
@ -175,7 +174,8 @@
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierinvoice-request-main:create' }), // defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierinvoice-request-main:create' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierinvoice-request-main:export' }), // defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -223,28 +223,68 @@
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['1',, '2','4']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierinvoice-request-main:update' , hide: isShowMainButton(row, ['1'])}), //
//
{ {
label: '处理', label: '采购审批通过',
name: 'genRecords', name: 'purchase_mainPlanSub',
hide: isShowMainButton(row, ['3']), hide: isShowMainButton(row, ['2','7']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},{
label: '采购驳回',
name: 'purchase_mainPlanTur',
hide: isShowMainButton(row, ['2','7']),
type: 'danger',
color: '',
link: true, //
hasPermi: ''
},
{
label: '财务审批通过',
name: 'finance_mainPlanSub',
hide: isShowMainButton(row, ['4']),
type: 'primary', type: 'primary',
icon: '', icon: '',
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true, // link: true, //
},{
label: '财务驳回',
name: 'finance_mainPlanTur',
hide: isShowMainButton(row, ['4']),
type: 'danger',
color: '',
link: true, //
hasPermi: ''
}, },
// defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
//defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierinvoice-request-main:update' , hide: isShowMainButton(row, ['1','6'])}), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2','4']) }), //
//
// {
// label: '',
// name: 'genRecords',
// hide: isShowMainButton(row, ['3']),
// type: 'primary',
// icon: '',
// color: '',
// hasPermi: '',
// link: true, //
// },
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-request-main:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-request-main:delete'}), //
] ]
} }
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
@ -254,10 +294,14 @@
handleClo(row.id) handleClo(row.id)
} else if (val == 'mainPlanSub') { // } else if (val == 'mainPlanSub') { //
handleSub(row.id) handleSub(row.id)
} else if (val == 'mainPlanApp') { // } else if (val == 'purchase_mainPlanSub') { //
handleApp(row.id) handleApp(row.id)
} else if (val == 'mainPlanTur') { // } else if (val == 'purchase_mainPlanTur') { //
handleTur(row.id) handleTur(row.id)
} else if(val == 'finance_mainPlanSub'){ //
handleFinanceApp(row.id)
} else if(val == 'finance_mainPlanTur'){ //
handleFinaceTur(row.id)
} else if (val == 'genRecords') { // } else if (val == 'genRecords') { //
genRecords(row.id) genRecords(row.id)
} else if (val == 'edit') { // } else if (val == 'edit') { //
@ -369,6 +413,24 @@
} }
} }
/** 审批通过按钮操作 */
const handleFinanceApp = async (id : number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
tableObject.loading = true
//
await SupplierinvoiceRequestMainApi.financeappSupplierinvoiceRequestMain(id)
message.success(t('审批通过成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 驳回按钮操作 */ /** 驳回按钮操作 */
const handleTur = async (id : number) => { const handleTur = async (id : number) => {
try { try {
@ -386,6 +448,23 @@
} }
} }
/** 驳回按钮操作 */
const handleFinaceTur = async (id : number) => {
try {
//
await message.confirm('是否驳回所选中数据?')
tableObject.loading = true
//
await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain(id)
message.success(t('驳回成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 处理按钮操作 */ /** 处理按钮操作 */
const genRecords = async (id : number) => { const genRecords = async (id : number) => {
try { try {
@ -456,6 +535,17 @@
} }
} }
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
@ -468,5 +558,6 @@
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await SupplierinvoiceRequestMainApi.importTemplate()
}) })
</script> </script>

597
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -5,7 +5,6 @@ import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/su
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as supplierinvoiceRequestMainApi from '@/api/wms/supplierinvoiceRequestMain'
import * as supplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail' import * as supplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -27,47 +26,30 @@ const requestsettingData = data?.list[0] || {}
const userDeptArray:any = [userDept] const userDeptArray:any = [userDept]
/**
export const PurchaseReceiptOrReturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ * @returns {Array} 退
*/
export const PurchaseReceiptOrReturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '单据号', label: '项目编码',
field: 'number' field: 'projectCode'
}, },
{ {
label: '供应商代码', label: '单据类型',
field: 'supplierCode' field: 'billType'
}, },
{ {
label: '发货单号', label: '单号',
field: 'asnNumber' field: 'recvBillNum'
}, },
{ {
label: '备注', label: '发货单号',
field: 'remark', field: 'asnBillNum'
}, },
{ {
label: '创建时间', label: '供应商代码',
field: 'createTime', field: 'supplierCode'
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isTableForm: false,
isForm: false
}, },
{
label: '创建者',
field: 'creator',
isTableForm: false,
isForm: false
}
]))
/**
* @returns {Array} 退
*/
export const PurchaseReceiptOrReturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '订单号', label: '订单号',
field: 'poNumber' field: 'poNumber'
@ -77,41 +59,16 @@ export const PurchaseReceiptOrReturnRecordDetail = useCrudSchemas(reactive<CrudS
field: 'poLine' field: 'poLine'
}, },
{ {
label: '物料代码', label: '采购价格',
field: 'itemCode' field: 'purchasePrice'
},
{
label: '货主代码',
field: 'ownerCode'
},
{
label: '批次',
field: 'batch'
}, },
{ {
label: '数量', label: '可开票数量',
field: 'qty', field: 'invoicableQuantity'
form: {
component: 'InputNumber',
}
}, },
{ {
label: '单价', label: '物料代码',
field: 'singlePrice', field: 'itemCode'
form: {
component: 'InputNumber',
}
},
{
label: '金额',
field: 'amount',
form: {
component: 'InputNumber',
}
},
{
label: '备注',
field: 'remark',
}, },
{ {
label: '创建时间', label: '创建时间',
@ -123,12 +80,6 @@ export const PurchaseReceiptOrReturnRecordDetail = useCrudSchemas(reactive<CrudS
}, },
isTableForm: false, isTableForm: false,
isForm: false isForm: false
},
{
label: '创建者',
field: 'creator',
isTableForm: false,
isForm: false
} }
])) ]))
@ -169,130 +120,173 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
} }
}, },
{ {
label: '单据类型', label: '状态',
field: 'billType', field: 'status',
dictType: DICT_TYPE.BILL_TYPE, dictType: DICT_TYPE.SUPPLIERINVOICE_REQUEST_STATUS,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
isSearch: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isSearch: true,
form: {
value: '1',
componentProps: {
disabled: true
}
}
}, },
{ {
label: '记录单号', label: '金额',
field: 'recvBillNum', field: 'amount',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', component: 'InputNumber',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 min: 0,
searchListPlaceholder: '请选择单号', // 输入框占位文本 precision: 6,
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '单号信息', // 查询弹窗标题
searchAllSchemas: PurchaseReceiptOrReturnRecordMain.allSchemas,
searchPage: supplierinvoiceRequestMainApi.getNumber,
searchCondition: [{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'billType',
value: 'billType',
message: '请填写单据类型!',
isMainValue: true
}]
} }
}, },
tableForm: { tableForm: {
isInpuFocusShow: true, type: 'InputNumber',
searchListPlaceholder: '请选择单号', min: 0,
searchField: 'number', precision: 6,
searchTitle: '单号信息',
searchAllSchemas: PurchaseReceiptOrReturnRecordMain.allSchemas,
searchPage: supplierinvoiceRequestMainApi.getNumber,
searchCondition: [{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'billType',
value: 'billType',
message: '请填写单据类型!',
isMainValue: true
}]
} }
}, },
{ {
label: '发货单号', label: '税率',
field: 'asnBillNum', field: 'taxRate',
table: {
width: 150
},
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
disabled: true min: 0,
precision: 6,
} }
}, },
tableForm: { tableForm: {
disabled: true type: 'InputNumber',
min: 0,
precision: 6,
} }
}, },
{ {
label: '订单号', label: '税额',
field: 'poBillNum', field: 'taxAmount',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: { form: {
component: 'Select', component: 'InputNumber',
componentProps:{ componentProps: {
options:[{label:'',value:''}] min: 0,
precision: 6,
} }
}, },
tableForm: { tableForm: {
type: 'Select', type: 'InputNumber',
options:[{label:'',value:''}] min: 0,
precision: 6,
} }
}, },
{ {
label: '调增金额', label: '税后金额',
field: 'adjustAmount', field: 'afterTaxAmount',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isForm:false,
isTable:false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
}
}, },
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6,
}
}, },
{ {
label: '业务类型', label: '索赔金额',
field: 'businessType', field: 'claimAmount',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTable:false,
isForm:false,
form: { form: {
value: 'SupplierInvoice', component: 'InputNumber',
componentProps: { componentProps: {
disabled: true, min: 0,
precision: 6,
} }
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6,
} }
}, },
{ {
label: '申请时间', label: '折扣金额',
field: 'requestTime', field: 'discountAmount',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6,
}
},
{
label: '调整税额',
field: 'adjustingTaxAmount',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6,
}
},
{
label: '金税票号',
field: 'afterTaxAmount',
table: {
width: 150
},
},
{
label: '快递单号',
field: 'expressTrackingNumber',
table: {
width: 150
},
},
{
label: '发票时间',
field: 'invoiceTime',
formatter: dateFormatter, formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -301,19 +295,20 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
table: { table: {
width: 180 width: 180
}, },
isForm:false,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: {width:'100%'},
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x',
} }
}, },
}, },
{ {
label: '截止时间', label: '申请时间',
field: 'dueTime', field: 'requestTime',
formatter: dateFormatter, formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -323,7 +318,6 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
width: 180 width: 180
}, },
isForm:false, isForm:false,
isTable:false,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -356,33 +350,6 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
} }
} }
}, },
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isSearch: true,
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
@ -437,6 +404,15 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
} }
}, },
}, },
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{ {
label: '自动提交', label: '自动提交',
field: 'autoCommit', field: 'autoCommit',
@ -444,6 +420,8 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
dictClass: 'string', dictClass: 'string',
isTable: false, isTable: false,
isForm:false, isForm:false,
isTableForm:false,
isDetail:false,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -464,7 +442,9 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isTable: false, isTable: false,
isForm: false, isForm:false,
isTableForm:false,
isDetail:false,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -485,7 +465,9 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isTable: false, isTable: false,
isForm: false, isForm:false,
isTableForm:false,
isDetail:false,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -505,8 +487,10 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
field: 'directCreateRecord', field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isForm: false,
isTable: false, isTable: false,
isForm:false,
isTableForm:false,
isDetail:false,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -566,186 +550,231 @@ export const SupplierinvoiceRequestMainRules = reactive({
* @returns {Array} * @returns {Array}
*/ */
export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '订单号',
field: 'poNumber',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{ {
label: '订单行', label: '订单行',
field: 'poLine', field: 'poLine',
table: {
width: 150
},
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, isSearchList: true,
searchListPlaceholder: '请选择订单号', searchListPlaceholder: '请选择订单',
searchField: 'number', searchField: 'poLine',
searchTitle: '订单号信息', searchTitle: '待开票列表',
searchAllSchemas: PurchaseReceiptOrReturnRecordDetail.allSchemas, searchAllSchemas: PurchaseReceiptOrReturnRecordDetail.allSchemas,
searchPage: supplierinvoiceRequestDetailApi.getPoNumberPoLineInfo, searchPage: supplierinvoiceRequestDetailApi.getPoNumberPoLineInfo,
searchCondition: [ searchCondition: [
{ {
key: 'recordNumber', key: 'supplierCode',
value: 'recvBillNum', value: 'supplierCode',
message: '请填写单号!', message: '请填供应商信息!',
isMainValue: true
},
{
key: 'billType',
value: 'billType',
message: '请填写单号类型!',
isMainValue: true
},
{
key: 'poNumber',
value: 'poBillNum',
message: '请选择订单号',
isMainValue: true isMainValue: true
} }
] ]
} }
}, },
tableForm: { tableForm: {
multiple:true,//多选
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择订单', searchListPlaceholder: '请选择订单行',
searchField: 'number', searchField: 'poLine',
searchTitle: '订单号信息', searchTitle: '待开票列表',
searchAllSchemas: PurchaseReceiptOrReturnRecordDetail.allSchemas, searchAllSchemas: PurchaseReceiptOrReturnRecordDetail.allSchemas,
searchPage: supplierinvoiceRequestDetailApi.getPoNumberPoLineInfo, searchPage: supplierinvoiceRequestDetailApi.getPoNumberPoLineInfo,
searchCondition: [ searchCondition: [
{ {
key: 'recordNumber', key: 'supplierCode',
value: 'recvBillNum', value: 'supplierCode',
message: '请填写单号!', message: '请填供应商信息!',
isMainValue: true
},
{
key: 'billType',
value: 'billType',
message: '请填写单号类型!',
isMainValue: true
},
{
key: 'poNumber',
value: 'poBillNum',
message: '请选择订单号',
isMainValue: true isMainValue: true
} }
] ]
} }
}, },
{ {
label: '物料代码', label: '供应商税率',
field: 'itemCode', field: 'tax',
table: {
width: 150
},
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
}, },
tableForm: { tableForm:{
disabled: true disabled: true
} }
}, },
{ {
label: '货主代码', label: '项目编码',
field: 'ownerCode' field: 'projectCode',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
}, },
{ {
label: '批次', label: '单据类型',
field: 'batch', field: 'billType',
disabled:true, table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
}, },
{ {
label: '数量', label: '发货单号',
field: 'qty', field: 'asnBillNum',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
disabled:true, disabled: true
min: 0, }
precision: 6
},
}, },
tableForm: { tableForm:{
type: 'InputNumber', disabled: true
disabled:true, }
min: 0, },
precision: 6 {
label: '供应商代码',
field: 'supplierCode',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
} }
}, },
{ {
label: '单价', label: '单价',
field: 'singlePrice', field: 'singlePrice',
table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
disabled:true,
min: 0, min: 0,
precision: 6 precision: 6,
}, }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
disabled:true,
min: 0, min: 0,
precision: 6 precision: 6,
} }
}, },
{ {
label: '金额', label: '采购价格',
field: 'amount', field: 'purchasePrice',
table: {
width: 150
},
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
disabled:true, disabled: true
min: 0, }
precision: 6
},
}, },
tableForm: { tableForm:{
type: 'InputNumber', disabled: true
disabled:true,
min: 0,
precision: 6
} }
}, },
{ {
label: '税率', label: '可开票数量',
field: 'tax', field: 'invoicableQuantity',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
min: 0, disabled: true
precision: 6 }
},
}, },
tableForm: { tableForm:{
type: 'InputNumber', disabled: true
min: 0,
precision: 6
} }
}, },
{ {
label: '比率', label: '物料代码',
field: 'rate', field: 'itemCode',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
min: 0, disabled: true
precision: 6 }
},
}, },
tableForm: { tableForm:{
type: 'InputNumber', disabled: true
min: 0, }
precision: 6 },
{
label: '物料名称',
field: 'itemName',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
},
{
label: '货币',
field: 'currency',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
} }
}, },
{ {
@ -756,6 +785,9 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
isTable: true, isTable: true,
table: {
width: 150
},
formatter: dateFormatter, formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -767,7 +799,10 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
isTableForm: false, isTableForm: false,
isForm: false isForm: false,
table: {
width: 150
},
}, },
{ {
label: '操作', label: '操作',
@ -784,25 +819,5 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
//表单校验 //表单校验
export const SupplierinvoiceRequestDetailRules = reactive({ export const SupplierinvoiceRequestDetailRules = reactive({
packingNumber: [
{ required: true, message: '请输入包装号', trigger: 'blur' }
],
poNumber: [
{ required: true, message: '请输入订单号', trigger: 'blur' }
],
poLine: [
{ required: true, message: '请输入订单行', trigger: 'blur' }
],
packQty: [
{ required: true, message: '请输入包装数量', trigger: 'blur' }
],
packUnit: [
{ required: true, message: '请输入包装规格', trigger: 'blur' }
],
convertRate: [
{ required: true, message: '请输入转换率', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请输入物料代码', trigger: 'blur' }
]
}) })

Loading…
Cancel
Save