liuchen864 1 year ago
parent
commit
b06eba10fa
  1. 13
      src/components/BasicForm/src/BasicForm.vue
  2. 128
      src/components/ImportForm/src/ImportForm.vue
  3. 2
      src/views/wms/countManage/count/countPlanMain/index.vue
  4. 58
      src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts
  5. 21
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue
  6. 186
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts
  7. 85
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  8. 54
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

13
src/components/BasicForm/src/BasicForm.vue

@ -8,10 +8,10 @@
:is-col="true" :is-col="true"
@opensearchTable="opensearchTable" @opensearchTable="opensearchTable"
> >
<template #crontab="formSchema"> <template #crontab="formSchema" v-if="fromeWhere == 'countPlan'">
<crontab v-model="formSchema.crontab" /> <crontab v-model="formSchema.crontab" />
</template> </template>
<template #type="formSchema"> <template #type="formSchema" v-if="fromeWhere == 'countPlan'">
<el-select v-model="formSchema.type" placeholder="选择盘点类型" @change="selectChange('type',$event)"> <el-select v-model="formSchema.type" placeholder="选择盘点类型" @change="selectChange('type',$event)">
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_TYPE)" v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_TYPE)"
@ -130,13 +130,19 @@ const props = defineProps({
type: Object, type: Object,
required: true, required: true,
default: null default: null
} },
// // // //
// masterParmas: { // masterParmas: {
// type: Object, // type: Object,
// required: false, // required: false,
// default: null // default: null
// }, // },
// countPlan
fromeWhere: {
type: String,
required: false,
default: ''
}
}) })
const { t } = useI18n() // const { t } = useI18n() //
@ -149,6 +155,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema) const formSchema = ref(props.formAllSchemas?.formSchema)
console.log('props.formAllSchemas',props.formAllSchemas)
/** 弹层操作 */ /** 弹层操作 */
// formField form // formField form

128
src/components/ImportForm/src/ImportForm.vue

@ -1,16 +1,41 @@
<!-- 导入组件 --> <!-- 导入组件 -->
<template> <template>
<Dialog v-model="dialogVisible" title="导入" width="600"> <Dialog v-model="dialogVisible" title="导入" width="600">
<el-upload ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart + '&outFile=' + outFile" <el-upload
:auto-upload="false" :disabled="formLoading" :headers="uploadHeaders" :limit="1" :on-error="submitFormError" ref="uploadRef"
:on-exceed="handleExceed" :on-success="submitFormSuccess" :accept="accept" drag v-model:file-list="fileList"
style="width:300px;margin:0 auto"> :action="
importUrl +
'?mode=' +
mode +
'&file=' +
file +
'&updatePart=' +
updatePart +
'&outFile=' +
outFile
"
:auto-upload="false"
:disabled="formLoading"
:headers="uploadHeaders"
:limit="1"
:on-error="submitFormError"
:on-exceed="handleExceed"
:on-success="submitFormSuccess"
:accept="accept"
drag
style="width: 300px; margin: 0 auto"
>
<Icon icon="ep:upload-filled" color="#c0c4cc" size="60" /> <Icon icon="ep:upload-filled" color="#c0c4cc" size="60" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip> <template #tip>
<div class="el-upload__tip ml--126px mr--80px"> <div class="el-upload__tip ml--126px mr--80px">
<div class="flex"> <div class="flex">
<div class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" style="line-height:32px">导入模式</div> <div
class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right"
style="line-height: 32px"
>导入模式</div
>
<div class=""> <div class="">
<div class="radio"> <div class="radio">
<el-radio-group v-model="mode"> <el-radio-group v-model="mode">
@ -28,7 +53,11 @@
</div> </div>
</div> </div>
<div class="flex mt-16px"> <div class="flex mt-16px">
<div class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" style="line-height:32px">部分保存</div> <div
class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right"
style="line-height: 32px"
>部分保存</div
>
<div class=""> <div class="">
<div class="switch"> <div class="switch">
<el-switch v-model="updatePart" /> <el-switch v-model="updatePart" />
@ -40,7 +69,11 @@
</div> </div>
</div> </div>
<div class="flex mt-16px" v-if="isShowOut"> <div class="flex mt-16px" v-if="isShowOut">
<div class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" style="line-height:32px">是否外部资源</div> <div
class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right"
style="line-height: 32px"
>是否外部资源</div
>
<div class=""> <div class="">
<div class="switch"> <div class="switch">
<el-switch v-model="outFile" /> <el-switch v-model="outFile" />
@ -54,9 +87,9 @@
<div class="flex items-center"> <div class="flex items-center">
<div class="flex-1 text-left"> <div class="flex-1 text-left">
<el-button type="primary" plain @click="importTemplate"> <el-button type="primary" plain @click="importTemplate">
<Icon icon="ep:download" /> <Icon icon="ep:download" />
下载模板 下载模板
</el-button> </el-button>
</div> </div>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button> <el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
@ -79,9 +112,7 @@ const uploadHeaders = ref() // 上传 Header 头
const fileList = ref([]) // const fileList = ref([]) //
const file = ref('') const file = ref('')
const props = defineProps({
const props = defineProps({
importTemplateData: { importTemplateData: {
type: Object, type: Object,
required: true required: true
@ -90,7 +121,7 @@ const file = ref('')
accept: { accept: {
type: String, type: String,
required: false, required: false,
default:'.xlsx,.xls' default: '.xlsx,.xls'
}, },
// .1 // .1
mode: { mode: {
@ -122,9 +153,9 @@ const file = ref('')
required: false, required: false,
default: false default: false
}, },
url:{ url: {
type: String, type: String,
required: false, required: false
}, },
// //
isShowOut: { isShowOut: {
@ -136,19 +167,18 @@ const file = ref('')
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, }
}) })
const importTemplateData= ref(props.importTemplateData) const importTemplateData = ref(props.importTemplateData)
const accept= ref(props.accept) const accept = ref(props.accept)
const mode = ref(props.mode)//.1 const mode = ref(props.mode) //.1
const updateIsDisable = ref(props.updateIsDisable)//, const updateIsDisable = ref(props.updateIsDisable) //,
const appendIsDisable = ref(props.appendIsDisable)//, const appendIsDisable = ref(props.appendIsDisable) //,
const coverIsDisable = ref(props.coverIsDisable)//, const coverIsDisable = ref(props.coverIsDisable) //,
const updatePart = ref(props.updatePart)// const updatePart = ref(props.updatePart) //
const outFile = ref(props.outFile)// const outFile = ref(props.outFile) //
const importUrl = const importUrl = import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url
/** 打开弹窗 */ /** 打开弹窗 */
const open = () => { const open = () => {
@ -159,7 +189,6 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */ /** 提交表单 */
const submitForm = async () => { const submitForm = async () => {
if (fileList.value.length == 0) { if (fileList.value.length == 0) {
message.error('请上传文件') message.error('请上传文件')
return return
@ -168,7 +197,7 @@ const submitForm = async () => {
// //
uploadHeaders.value = { uploadHeaders.value = {
Authorization: 'Bearer ' + getAccessToken(), Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId(), 'tenant-id': getTenantId()
} }
formLoading.value = true formLoading.value = true
uploadRef.value!.submit() uploadRef.value!.submit()
@ -179,27 +208,32 @@ const emits = defineEmits(['success'])
const submitFormSuccess = (response: any) => { const submitFormSuccess = (response: any) => {
formLoading.value = true formLoading.value = true
console.log(response) console.log(response)
if(response){ if (response) {
if(response.code == 500){ if (response.code == 500) {
uploadRef.value!.clearFiles() uploadRef.value!.clearFiles()
message.error('导入失败') message.error('导入失败')
formLoading.value = false formLoading.value = false
return; return
} else if (response.data.errorCount > 0) { } else if (response.code == 0) {
message.confirm('文件中有部分数据导入失败,是否下载失败数据?').then(() => { if (response.data.errorCount > 0) {
// download.excel(file, 'file_' + new Date().getTime()) message.confirm('文件中有部分数据导入失败,是否下载失败数据?').then(() => {
// url // download.excel(file, 'file_' + new Date().getTime())
// const downloadElement = document.createElement('a') // url
// console.log(172, import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/' + response.data.errorFile) // const downloadElement = document.createElement('a')
// console.log(172, import.meta.env.VITE_BASE_URL + '/admin-api/opt/profile/' + response.data.errorFile) // console.log(172, import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/' + response.data.errorFile)
window.open(import.meta.env.VITE_BASE_URL + '/admin-api/profile/' + response.data.errorFile ,'222') // console.log(172, import.meta.env.VITE_BASE_URL + '/admin-api/opt/profile/' + response.data.errorFile)
// downloadElement.setAttribute('href', import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + response.data.errorFile ) window.open(
// import.meta.env.VITE_BASE_URL + '/admin-api/profile/' + response.data.errorFile,
// downloadElement.click() '222'
}) )
// downloadElement.setAttribute('href', import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + response.data.errorFile )
//
// downloadElement.click()
})
} else {
message.success('导入成功')
}
} }
}else{
message.success('导入成功')
} }
// if (response.code !== 0) { // if (response.code !== 0) {

2
src/views/wms/countManage/count/countPlanMain/index.vue

@ -54,6 +54,7 @@
:apiUpdate="CountPlanMainApi.updateCountPlanMain" :apiUpdate="CountPlanMainApi.updateCountPlanMain"
:apiCreate="CountPlanMainApi.createCountPlanMain" :apiCreate="CountPlanMainApi.createCountPlanMain"
:isBusiness="true" :isBusiness="true"
fromeWhere="countPlan"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@ -342,7 +343,6 @@ const searchFormClick = (searchData) => {
const selectChange = (field,val)=>{ const selectChange = (field,val)=>{
console.log(val) console.log(val)
if(field == 'type'){ if(field == 'type'){
console.log(CountPlanMain.allSchemas.formSchema)
if(val =='DYNAMIC'){ if(val =='DYNAMIC'){
CountPlanMain.allSchemas.formSchema[3].label = '限值(%)' CountPlanMain.allSchemas.formSchema[3].label = '限值(%)'
CountPlanMain.allSchemas.formSchema[3].componentProps.min = 0 CountPlanMain.allSchemas.formSchema[3].componentProps.min = 0

58
src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts

@ -11,8 +11,8 @@ import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/worksta
import * as WorkshopApi from '@/api/wms/workshop' import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
@ -448,7 +448,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题 searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法 searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
isMainValue: true
}]
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
@ -458,7 +463,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题 searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法 searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
isMainValue: true
}]
} }
} }
}, },
@ -475,7 +485,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题 searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.getWorkstationPage // 查询弹窗所需分页方法 searchPage: WorkstationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'productionLineCode',
isMainValue: true
}]
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
@ -485,7 +500,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题 searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.getWorkstationPage // 查询弹窗所需分页方法 searchPage: WorkstationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'productionLineCode',
isMainValue: true
}]
} }
} }
}, },
@ -553,20 +573,30 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isInpuFocusShow: true, isInpuFocusShow: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物品代码', // 输入框占位文本 searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '物品基础信息', // 查询弹窗标题 searchTitle: '生产线物品信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'productionLineCode',
isMainValue: true
}]
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物品代码', // 输入框占位文本 searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '物品基础信息', // 查询弹窗标题 searchTitle: '生产线物品信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'productionLineCode',
isMainValue: true
}]
} }
} }
}, },

21
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -50,6 +50,7 @@
import * as PurchaseMainApi from '@/api/wms/purchaseMain' import * as PurchaseMainApi from '@/api/wms/purchaseMain'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
// //
defineOptions({ name: 'PurchaseMain' }) defineOptions({ name: 'PurchaseMain' })
@ -68,10 +69,17 @@
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(async() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
if(formField == 'itemCode'){
await ItembasicApi.getItembasicPage({
code: row['itemCode']
}).then(res => {
row['uom'] = res.list[0].uom
})
}
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -81,9 +89,16 @@
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(async() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] if(formField == 'itemCode'){
await ItembasicApi.getItembasicPage({
code: setV['itemCode']
}).then(res => {
setV['uom'] = res.list[0].uom
setV[formField] = val[0][searchField]
})
}
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }

186
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts

@ -176,7 +176,9 @@ export const PurchaseMain = useCrudSchemas(reactive<CrudSchema[]>([
style: {width:'100%'}, style: {width:'100%'},
min: 0 min: 0
} }
} },
isTableForm: false,
isForm: false,
}, },
{ {
label: '备注', label: '备注',
@ -334,12 +336,12 @@ export const PurchaseMainRules = reactive({
available: [ available: [
{ required: true, message: '请选择是否可用', trigger: 'change' } { required: true, message: '请选择是否可用', trigger: 'change' }
], ],
number: [ // number: [
{ required: true, message: '请输入单据号', trigger: 'blur' } // { required: true, message: '请输入单据号', trigger: 'blur' }
], // ],
businessType: [ // businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' } // { required: true, message: '请输入业务类型', trigger: 'blur' }
], // ],
}) })
/** /**
@ -356,6 +358,74 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
} }
}, },
{
label: '物品代码',
field: 'itemCode',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择供应商物品',
searchField: 'itemCode',
searchTitle: '供应商物品信息',
searchAllSchemas: Supplieritem.allSchemas,
searchPage: SupplieritemApi.getSupplieritemPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择供应商物品',
searchField: 'itemCode',
searchTitle: '供应商物品信息',
searchAllSchemas: Supplieritem.allSchemas,
searchPage: SupplieritemApi.getSupplieritemPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
isMainValue: true
}]
}
}
},
{
label: '订单数量',
field: 'orderQty',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{ {
label: 'ERP库位', label: 'ERP库位',
field: 'erpLocationCode', field: 'erpLocationCode',
@ -515,23 +585,6 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false, isTableForm: false,
isForm: false isForm: false
}, },
{
label: '超收百分比',
field: 'overReceivingPercent',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0
}
},
{ {
label: '单价', label: '单价',
field: 'singlePrice', field: 'singlePrice',
@ -564,74 +617,6 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false, isTableForm: false,
isForm: false isForm: false
}, },
{
label: '物品代码',
field: 'itemCode',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择供应商物品',
searchField: 'itemCode',
searchTitle: '供应商物品信息',
searchAllSchemas: Supplieritem.allSchemas,
searchPage: SupplieritemApi.getSupplieritemPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择供应商物品',
searchField: 'itemCode',
searchTitle: '供应商物品信息',
searchAllSchemas: Supplieritem.allSchemas,
searchPage: SupplieritemApi.getSupplieritemPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
isMainValue: true
}]
}
}
},
{
label: '订单数量',
field: 'orderQty',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{ {
label: '单据号', label: '单据号',
field: 'nuumber', field: 'nuumber',
@ -699,6 +684,23 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '超收百分比',
field: 'overReceivingPercent',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0
}
},
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',

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

@ -81,6 +81,7 @@ import { PurchasePlanMain,PurchasePlanMainRules,PurchasePlanDetail,PurchasePlanD
import * as PurchasePlanMainApi from '@/api/wms/purchasePlanMain' import * as PurchasePlanMainApi from '@/api/wms/purchasePlanMain'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail' import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
// //
defineOptions({ name: 'PurchasePlanMain' }) defineOptions({ name: 'PurchasePlanMain' })
@ -100,13 +101,21 @@ const updataTableColumns = (val) => {
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(async() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['itemCode'] = val[0]['code'] row['itemCode'] = val[0]['code']
row['poNumber'] = val[0]['number'] row['poNumber'] = val[0]['number']
row['poLine'] = val[0]['lineNumber'] row['poLine'] = val[0]['lineNumber']
await PurchaseDetailApi.getPurchaseDetailPage({
number: row['poNumber'],
lineNumber: row['poLine'],
}).then(res => {
if(res.list.length == 1) {
row['itemCode'] = res.list[0].itemCode
}
})
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -116,13 +125,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(async() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
setV['itemCode'] = val[0]['code']
setV['poNumber'] = val[0]['number'] setV['poNumber'] = val[0]['number']
setV['poLine'] = val[0]['lineNumber'] setV['poLine'] = val[0]['lineNumber']
formRef.setValues(setV) await PurchaseDetailApi.getPurchaseDetailPage({
number: setV['poNumber'],
lineNumber: setV['poLine'],
}).then(res => {
if(res.list.length == 1) {
setV['itemCode'] = res.list[0].itemCode
formRef.setValues(setV)
}
})
}) })
} }
@ -178,17 +194,17 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_REJECTED'])}), // defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['5'])}), //
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), // defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), // defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), // defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), // defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), // defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_CLOSED'])}), // defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:update'}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchase-plan-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:delete'}), // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchase-plan-main:delete'}), //
] ]
} }
@ -278,8 +294,21 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = []
try { for(let item of tableData.value) {
await PurchaseDetailApi.getPurchaseDetailPage({
number: item.poNumber,
lineNumber: item.poLine
}).then(res => {
if(item.planQty > res.list[0].orderQty-res.list[0].plannedQty){
message.error('要货计划数量不得大于订单数量-已计划数量')
} else {
data.subList.push(item) //
}
})
}
if(data.subList.length == tableData.value.length){
try {
if (formType === 'create') { if (formType === 'create') {
await PurchasePlanMainApi.createPurchasePlanMain(data) await PurchasePlanMainApi.createPurchasePlanMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -294,12 +323,24 @@ const submitForm = async (formType, data) => {
formRef.value.formLoading = false formRef.value.formLoading = false
} }
} }
formRef.value.formLoading = false
}
// // /
const detailValidate = (data) => { const detailValidate = async (data) => {
console.log(300, data) let tag = false
message.warning('错了吧,') await PurchaseDetailApi.getPurchaseDetailPage({
return false number: data.poNumber,
lineNumber: data.poLine
}).then(res => {
if(data.planQty > res.list[0].orderQty-res.list[0].plannedQty){
message.error('要货计划数量不得大于订单数量-已计划数量')
tag = false
} else {
tag = true
}
})
return tag
} }
/** 导入 */ /** 导入 */

54
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -2,8 +2,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier' import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import * as PurchaseMainApi from '@/api/wms/purchaseMain' import * as PurchaseMainApi from '@/api/wms/purchaseMain'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { PurchaseDetail, PurchaseMain } from '../purchaseMain/purchaseMain.data' import { PurchaseDetail, PurchaseMain } from '../purchaseMain/purchaseMain.data'
@ -98,7 +96,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
form: { form: {
value: 'PLAN_PURCHASE_READY', value: '1',
componentProps: { componentProps: {
disabled: true disabled: true
} }
@ -332,7 +330,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: PurchaseDetail.allSchemas, searchAllSchemas: PurchaseDetail.allSchemas,
searchPage: PurchaseDetailApi.getPurchaseDetailPage, searchPage: PurchaseDetailApi.getPurchaseDetailPage,
searchCondition: [{ searchCondition: [{
key:'lineNumber', key:'number',
value:'poNumber', value:'poNumber',
isMainValue: true isMainValue: true
}] }]
@ -361,33 +359,12 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
form: { form: {
// labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, disabled: true
searchListPlaceholder: '请选择供应商物品',
searchField: 'code',
searchTitle: '供应商物品信息',
searchAllSchemas: Supplieritem.allSchemas,
searchPage: SupplieritemApi.getSupplieritemPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
isMainValue: true
}]
} }
}, },
tableForm: { tableForm: {
isInpuFocusShow: true, disabled: true
searchListPlaceholder: '请选择供应商物品',
searchField: 'code',
searchTitle: '供应商物品信息',
searchAllSchemas: Supplieritem.allSchemas,
searchPage: SupplieritemApi.getSupplieritemPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
isMainValue: true
}]
} }
}, },
{ {
@ -445,6 +422,13 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
min: 1, min: 1,
precision: 6 precision: 6
}, },
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
}
}, },
{ {
label: '计量单位', label: '计量单位',
@ -513,6 +497,12 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
tableForm:{
type:'Select',
default: 'TRUE',
inactiveValue: 'FALSE',
activeValue: 'TRUE'
},
form: { form: {
component: 'Switch', component: 'Switch',
value: 'TRUE', value: 'TRUE',
@ -520,9 +510,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
inactiveValue: 'FALSE', inactiveValue: 'FALSE',
activeValue: 'TRUE' activeValue: 'TRUE'
} }
}, }
isTableForm: false,
isForm: false
}, },
{ {
label: '操作', label: '操作',
@ -539,9 +527,9 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验 //表单校验
export const PurchasePlanDetailRules = reactive({ export const PurchasePlanDetailRules = reactive({
available: [ // available: [
{ required: true, message: '请选择是否可用', trigger: 'change' } // { required: true, message: '请选择是否可用', trigger: 'change' }
], // ],
poNumber: [ poNumber: [
{ required: true, message: '请选择采购订单号', trigger: 'change' } { required: true, message: '请选择采购订单号', trigger: 'change' }
], ],

Loading…
Cancel
Save