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

132
src/components/ImportForm/src/ImportForm.vue

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

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

@ -54,6 +54,7 @@
:apiUpdate="CountPlanMainApi.updateCountPlanMain"
:apiCreate="CountPlanMainApi.createCountPlanMain"
:isBusiness="true"
fromeWhere="countPlan"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@ -342,7 +343,6 @@ const searchFormClick = (searchData) => {
const selectChange = (field,val)=>{
console.log(val)
if(field == 'type'){
console.log(CountPlanMain.allSchemas.formSchema)
if(val =='DYNAMIC'){
CountPlanMain.allSchemas.formSchema[3].label = '限值(%)'
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 { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
const { t } = useI18n() // 国际化
@ -448,7 +448,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
@ -458,7 +463,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
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', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.getWorkstationPage // 查询弹窗所需分页方法
searchPage: WorkstationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'productionLineCode',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
@ -485,7 +500,12 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
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,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物品基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '生产线物品信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'productionLineCode',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物品基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '生产线物品信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
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 PurchaseDetailApi from '@/api/wms/purchaseDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
//
defineOptions({ name: 'PurchaseMain' })
@ -68,10 +69,17 @@
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
nextTick(async() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
if(formField == 'itemCode'){
await ItembasicApi.getItembasicPage({
code: row['itemCode']
}).then(res => {
row['uom'] = res.list[0].uom
})
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
@ -81,9 +89,16 @@
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
nextTick(async() => {
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)
})
}

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

@ -176,7 +176,9 @@ export const PurchaseMain = useCrudSchemas(reactive<CrudSchema[]>([
style: {width:'100%'},
min: 0
}
}
},
isTableForm: false,
isForm: false,
},
{
label: '备注',
@ -334,12 +336,12 @@ export const PurchaseMainRules = reactive({
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
// number: [
// { required: true, message: '请输入单据号', trigger: 'blur' }
// ],
// businessType: [
// { required: true, message: '请输入业务类型', trigger: 'blur' }
// ],
})
/**
@ -356,6 +358,74 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
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库位',
field: 'erpLocationCode',
@ -515,23 +585,6 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false,
isForm: false
},
{
label: '超收百分比',
field: 'overReceivingPercent',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0
}
},
{
label: '单价',
field: 'singlePrice',
@ -564,74 +617,6 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: 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: '单据号',
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: '创建者',
field: 'creator',

87
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 PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
//
defineOptions({ name: 'PurchasePlanMain' })
@ -100,13 +101,21 @@ const updataTableColumns = (val) => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
nextTick(async() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemCode'] = val[0]['code']
row['poNumber'] = val[0]['number']
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 {
const setV = {}
setV[formField] = val[0][searchField]
@ -116,13 +125,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
nextTick(async() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['itemCode'] = val[0]['code']
setV['poNumber'] = val[0]['number']
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) => {
return [
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_REJECTED'])}), //
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_CLOSED'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:delete'}), //
]
return [
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['5'])}), //
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchase-plan-main:update'}), //
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) => {
data.subList = tableData.value //
try {
data.subList = []
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') {
await PurchasePlanMainApi.createPurchasePlanMain(data)
message.success(t('common.createSuccess'))
@ -294,12 +323,24 @@ const submitForm = async (formType, data) => {
formRef.value.formLoading = false
}
}
formRef.value.formLoading = false
}
//
const detailValidate = (data) => {
console.log(300, data)
message.warning('错了吧,')
return false
// /
const detailValidate = async (data) => {
let tag = false
await PurchaseDetailApi.getPurchaseDetailPage({
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
}
/** 导入 */
@ -333,4 +374,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await PurchasePlanMainApi.importTemplate()
})
</script>
</script>

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

Loading…
Cancel
Save