ljlong_2630 6 days ago
parent
commit
c2977bf085
  1. 60
      src/api/wms/finishedShipmentDetail/index.ts
  2. 56
      src/api/wms/finishedShipmentMain/index.ts
  3. 5
      src/api/wms/supplierinvoiceRequestDetail/index.ts
  4. 18
      src/api/wms/suppliperMoldCostDetail/index.ts
  5. 49
      src/api/wms/suppliperMoldCostMain/index.ts
  6. 7
      src/components/ImportForm/src/ImportFormOnlyAdd.vue
  7. 467
      src/components/ImportForm/src/ImportSupplierMoldCostForm.vue
  8. 4
      src/components/Table/src/Table.vue
  9. 3
      src/locales/en-US.ts
  10. 3
      src/locales/zh-CN.ts
  11. 4
      src/utils/dict.ts
  12. 2
      src/views/wms/basicDataManage/labelManage/callmaterials/callmaterials.data.ts
  13. 133
      src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
  14. 205
      src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue
  15. 145
      src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue
  16. 61
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  17. 161
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue
  18. 308
      src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue
  19. 303
      src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue
  20. 198
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  21. 11
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue
  22. 280
      src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue
  23. 6
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts
  24. 4
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue
  25. 89
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue
  26. 16
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts
  27. 23
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue
  28. 7
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts
  29. 3
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts
  30. 38
      src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts
  31. 57
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  32. 12
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue
  33. 16
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts
  34. 19
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue
  35. 348
      src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue
  36. 189
      src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts
  37. 219
      src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/finishedShipmentMain.data.ts
  38. 69
      src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/index.vue
  39. 4
      src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/index.vue
  40. 110
      src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/unfinishedShipmentMain.data.ts
  41. 2
      src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  42. 68
      src/views/wms/deliversettlementManage/unfinishedShipmentMain/unfinishedShipmentMain.data.ts
  43. 21
      src/views/wms/inventoryManage/balance/index.vue
  44. 156
      src/views/wms/inventoryjobManage/packageManage/packagesplitMain/packagesplitMain.data.ts
  45. 19
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  46. 6
      src/views/wms/moveManage/inventorymove/inventorymoveJobMain/inventorymoveJobMain.data.ts
  47. 18
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMain/inventorymoveRecordMain.data.ts
  48. 3
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue
  49. 17
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts
  50. 2
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  51. 24
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts
  52. 94
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue
  53. 34
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
  54. 14
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  55. 20
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

60
src/api/wms/finishedShipmentDetail/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface FinishedShipmentDetailVO {
id: number
masterId: number
materialCode: string
materialName: string
backNumber: string
materialDescription: string
shipmentQuantity: number
unitPrice: number
lockedQuantity: number
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询已发未结发货记录子列表
export const getFinishedShipmentDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/finished-shipment-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/finished-shipment-record-detail/page`, params })
}
}
// 查询已发未结发货记录子详情
export const getFinishedShipmentDetail = async (id: number) => {
return await request.get({ url: `/wms/finished-shipment-record-detail/get?id=` + id })
}
// 新增已发未结发货记录子
export const createFinishedShipmentDetail = async (data: FinishedShipmentDetailVO) => {
return await request.post({ url: `/wms/finished-shipment-record-detail/create`, data })
}
// 修改已发未结发货记录子
export const updateFinishedShipmentDetail = async (data: FinishedShipmentDetailVO) => {
return await request.put({ url: `/wms/finished-shipment-record-detail/update`, data })
}
// 删除已发未结发货记录子
export const deleteFinishedShipmentDetail = async (id: number) => {
return await request.delete({ url: `/wms/finished-shipment-record-detail/delete?id=` + id })
}
// 导出已发未结发货记录子 Excel
export const exportFinishedShipmentDetail = async (params) => {
return await request.download({ url: `/wms/finished-shipment-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/finished-shipment-record-detail/get-import-template' })
}

56
src/api/wms/finishedShipmentMain/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface FinishedShipmentMainVO {
id: number
orderNumber: string
shipmentRecordNumber: string
shipmentType: string
customerOrderNumber: string
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询已发未结发货记录主列表
export const getFinishedShipmentMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/finished-shipment-record-main/senior', data })
} else {
return await request.get({ url: `/wms/finished-shipment-record-main/page`, params })
}
}
// 查询已发未结发货记录主详情
export const getFinishedShipmentMain = async (id: number) => {
return await request.get({ url: `/wms/finished-shipment-record-main/get?id=` + id })
}
// 新增已发未结发货记录主
export const createFinishedShipmentMain = async (data: FinishedShipmentMainVO) => {
return await request.post({ url: `/wms/finished-shipment-record-main/create`, data })
}
// 修改已发未结发货记录主
export const updateFinishedShipmentMain = async (data: FinishedShipmentMainVO) => {
return await request.put({ url: `/wms/finished-shipment-record-main/update`, data })
}
// 删除已发未结发货记录主
export const deleteFinishedShipmentMain = async (id: number) => {
return await request.delete({ url: `/wms/finished-shipment-record-main/delete?id=` + id })
}
// 导出已发未结发货记录主 Excel
export const exportFinishedShipmentMain = async (params) => {
return await request.download({ url: `/wms/finished-shipment-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/finished-shipment-record-main/get-import-template' })
}

5
src/api/wms/supplierinvoiceRequestDetail/index.ts

@ -80,3 +80,8 @@ export const exportSupplierinvoiceRequestDetail = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/supplierinvoice-request-detail/get-import-template' })
}
// 模具分摊单价
export const handleAllocationPrice = async (data) => {
return await request.post({ url: `/wms/supplierinvoice-request-detail/handleAllocationPrice`, data })
}

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

@ -0,0 +1,18 @@
import request from '@/config/axios'
export const getSupplierMoldCostDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/supplier-tool-apport-statement-detail/senior', data })
} else {
return await request.get({ url: `/wms/supplier-tool-apport-statement-detail/page`, params })
}
}
export const exportSupplierMoldCostDetail = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/supplier-tool-apport-statement-detail/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/supplier-tool-apport-statement-detail/export-excel`, params })
}
}

49
src/api/wms/suppliperMoldCostMain/index.ts

@ -0,0 +1,49 @@
import request from '@/config/axios'
// 从客户对账单中获取客户代码 -- 销售申请
export const getCustomerList = async () => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/getCustomerList`})
}
export const getSupplierMoldCostMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/supplier-tool-apport-statement-main/senior', data })
} else {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/page`, params })
}
}
export const exportSupplierMoldCostMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/supplier-tool-apport-statement-main/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/supplier-tool-apport-statement-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplier-tool-apport-statement-main/get-import-template' })
}
// 导入客户对账单前校验是否有相同客户代码和年月的数据存在
export const verifyDataExist = async (yearsMonthStr: String,supplierCode:String) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/verifyDataExist?yearsMonthStr=` + yearsMonthStr+'&supplierCode='+supplierCode })
}
// 发布
export const publish = async (id: number) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/publish?id=` + id })
}
// 废除
export const nodeAbrogate = async (id: number) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/nodeAbrogate?id=` + id })
}
// 退回
export const sendBack = async (id: number) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/sendBack?id=` + id })
}

7
src/components/ImportForm/src/ImportFormOnlyAdd.vue

@ -259,6 +259,11 @@ const props = defineProps({
type:Boolean,
default:false
},
rules:{
type:Object,
required: false,
default: () => ({})
},
})
const importTemplateData = ref(props.importTemplateData)
const accept = ref(props.accept)
@ -319,6 +324,8 @@ const submitForm = async () => {
const elForm = unref(formRef)?.getElFormRef()
if (!elForm) return
const valid = await elForm.validate()
console.log(valid)
console.log(props.r)
if (!valid) return
if (fileList.value.length == 0) {

467
src/components/ImportForm/src/ImportSupplierMoldCostForm.vue

@ -0,0 +1,467 @@
<!-- 导入客户对账单组件 -->
<template>
<Dialog v-model="dialogVisible" :title="t('ts.导入')" width="600" :close-on-click-modal="false">
<el-form
:inline="true"
:model="queryParams"
class="demo-form-inline"
style="margin-bottom: 10px"
label-width="70px"
>
<el-row>
<el-col :span="12">
<el-form-item label="客户代码">
<el-select
v-model="queryParams.supplierCode"
placeholder="请选择客户代码"
clearable
>
<el-option v-for="(item) in customerList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年月">
<el-date-picker
v-model="queryParams.yearsMonthStr"
type="month"
placeholder="选择年月"
format="YYYY-MM"
value-format="YYYY-MM"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-upload
ref="uploadRef"
v-model:file-list="fileList"
:action="
importUrl +
'?yearsMonthStr=' +
queryParams.yearsMonthStr +
'&supplierCode=' +
queryParams.supplierCode +
'&file=' +
file +
'&updatePart=' +
updatePart +
'&outFile=' +
outFile +
'&extend=' + extend +
'&fromInventoryStatus=' + fromInventoryStatus +
'&toInventoryStatus=' + toInventoryStatus +
dataType
"
: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"
v-loading="formLoading"
>
<Icon icon="ep:upload-filled" color="#c0c4cc" :size="60" />
<div class="el-upload__text">{{t('ts.将文件拖到此处,或')}}<em>{{t('ts.点击上传')}}</em></div>
<!-- <template #tip>
<div class="el-upload__tip ml--126px mr--80px">
<div class="flex" v-if="announcements&&announcements.length>0">
<div
class="label h-32px ml-22px mr-26px color-#acaeb3 font-size-14px w-100px text-right mt-2px"
style="line-height: 32px;"
>{{t('ts.注意事项')}}</div
>
<div class="">
<div class="notice color-#acaeb3 font-size-14px text-red">
<div class="mt-2" v-for="item in announcements">{{ item }}</div>
</div>
</div>
</div>
<div class="flex">
<div
class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right"
style="line-height: 32px"
>{{t('ts.导入模式')}}</div
>
<div class="">
<div class="radio">
<el-radio-group v-model="mode">
<el-radio :label="1" v-show="updateIsShow" :disabled="updateIsDisable">{{ t('ts.更新')}}</el-radio>
<el-radio :label="2" v-show="appendIsShow" :disabled="appendIsDisable">{{ t('ts.追加') }}</el-radio>
<el-radio :label="3" v-show="coverIsShow" :disabled="coverIsDisable">{{ t('ts.覆盖') }}</el-radio>
</el-radio-group>
</div>
<div class="tips color-#acaeb3 font-size-14px">
<div class="mt-2">{{t('ts.更新:新增并修改')}}</div>
<div class="mt-2">{{ t('ts.追加:只新增,不修改') }}</div>
<div class="mt-2">{{ t('ts.覆盖:只修改不新增') }}</div>
</div>
</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"
>{{ t('ts.部分保存') }}</div
>
<div class="">
<div class="switch">
<el-switch v-model="updatePart" />
</div>
<div class="tips color-#acaeb3 font-size-14px">
<div class="mt-2">{{ t('ts.部分保存:如存在错误数据,正确数据正常导入') }}</div>
<div class="mt-2">{{ t('ts.全部保存:全部数据正确,才能导入') }}</div>
</div>
</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="">
<div class="switch">
<el-switch v-model="outFile" />
</div>
</div>
</div>
</div>
</template> -->
</el-upload>
<template #footer>
<div class="flex items-center">
<div class="flex-1 text-left">
<el-button type="primary" plain @click="importTemplate">
<Icon icon="ep:download" />
{{ t('ts.下载模板') }}
</el-button>
</div>
<el-button :disabled="formLoading" type="primary" @click="verifyData">{{ t('ts.确 ') }}</el-button>
<el-button @click="dialogVisible = false">{{ t('ts.取 消') }}</el-button>
</div>
</template>
</Dialog>
</template>
<script lang="ts" setup>
import { getAccessToken, getTenantId } from '@/utils/auth'
import download from '@/utils/download'
import { getBaseUrl } from '@/utils/systemParam'
import * as CustomerApi from '@/api/wms/customer'
import * as SuppliperMoldCostMainApi from '@/api/wms/suppliperMoldCostMain'
defineOptions({ name: 'ImportSupplierMoldCostForm' })
const { t } = useI18n()
const message = useMessage() //
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const uploadRef = ref()
const uploadHeaders = ref() // Header
const fileList = ref([]) //
const file = ref('')
const props = defineProps({
importTemplateData: {
type: Object,
required: true
},
//
accept: {
type: String,
required: false,
default: '.xlsx,.xls'
},
// .1
mode: {
type: Number,
required: false,
default: 1
},
// ,
updateIsDisable: {
type: Boolean,
required: false,
default: false
},
//
updateIsShow: {
type: Boolean,
required: false,
default: true
},
// ,
appendIsDisable: {
type: Boolean,
required: false,
default: false
},
//
appendIsShow: {
type: Boolean,
required: false,
default: true
},
// ,
coverIsDisable: {
type: Boolean,
required: false,
default: false
},
//
coverIsShow: {
type: Boolean,
required: false,
default: true
},
// ,
updatePart: {
type: Boolean,
required: false,
default: false
},
url: {
type: String,
required: false
},
//
isShowOut: {
type: Boolean,
required: false,
default: false
},
outFile: {
type: Boolean,
required: false,
default: false
},
//
extend: {
type: String,
required: false,
default: ''
},
// TODO: cxm
fromInventoryStatus: {
type: String,
required: false,
default: ''
},
// TODO: cxm
toInventoryStatus: {
type: String,
required: false,
default: ''
},
announcements:{
type: Array,
required: false,
default: []
}
})
const importTemplateData = ref(props.importTemplateData)
const dataType = ref('')
dataType.value = props.importTemplateData.dataType ?'&dataType=' + props.importTemplateData.dataType :''
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 = getBaseUrl() + import.meta.env.VITE_API_URL + props.url
/** 打开弹窗 */
const open = () => {
dialogVisible.value = true
resetForm()
getCustomerList();//
}
defineExpose({ open }) // open
/** 校验数据 */
const verifyData = async () => {
if (queryParams.yearsMonthStr==''||queryParams.yearsMonthStr==null) {
message.error('请选择年月')
return
}
if (queryParams.supplierCode==''||queryParams.supplierCode==null) {
message.error('请选择供应商代码')
return
}
if (fileList.value.length == 0) {
message.error('请上传文件')
return
}
const data = await SuppliperMoldCostMainApi.verifyDataExist(queryParams.yearsMonthStr,queryParams.supplierCode);
console.log('data',data)
if(data.status==0){
submitForm();
}else if(data.status==2){
try {
//
await message.confirm('已存在相同供应商编号及年月的模具费用,是否确认覆盖?')
//
submitForm();
// await PurchasepriceApi.deletePurchaseprice(id)
// tableObject.loading = false
// message.success(t('common.delSuccess'))
// //
// buttonBaseClick('refresh',null)
} catch {
//
}
}else if(data.status==3){
await message.alertWarning('已存在相同供应商编号及年月的对账单,且已提交,无法导入。')
}
}
/** 提交表单 */
const submitForm = async () => {
if (fileList.value.length == 0) {
message.error('请上传文件')
return
}
file.value = fileList.value[0].name
//
uploadHeaders.value = {
Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId()
}
formLoading.value = true
uploadRef.value!.submit()
}
/** 文件上传成功 */
const emits = defineEmits(['success'])
const submitFormSuccess = (response: any) => {
formLoading.value = true
console.log(response)
if (response) {
if (response.code == 500) {
uploadRef.value!.clearFiles()
message.error('导入失败')
formLoading.value = false
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, getBaseUrl() + import.meta.env.VITE_API_URL + '/' + response.data.errorFile)
// console.log(172, getBaseUrl() + '/admin-api/opt/profile/' + response.data.errorFile)
window.open(
getBaseUrl() + '/admin-api' + response.data.errorFile,
'222'
)
// downloadElement.setAttribute('href', getBaseUrl() + import.meta.env.VITE_API_URL + response.data.errorFile )
//
// downloadElement.click()
})
} else {
message.success('导入成功')
}
}else if(response.data == null){
message.error(response.msg)
}
}
// if (response.code !== 0) {
// message.error(response.msg)
// formLoading.value = false
// return
// }
// //
// const data = response.data
// const create = response.data.importResult[0]
// const update = response.data.importResult[1]
// const failure = response.data.importResult[2]
// let text = '' + data[create].length + ';'
// for (let name of data[create]) {
// text += '< ' + name + ' >'
// }
// text += '' + data[update].length + ';'
// for (const name of data[update]) {
// text += '< ' + name + ' >'
// }
// text += '' + Object.keys(data[failure]).length + ';'
// for (const name in data[failure]) {
// text += '< ' + name + ': ' + data[failure][name] + ' >'
// }
// message.alert(text)
//
formLoading.value = false
emits('success')
dialogVisible.value = false
}
/** 上传错误提示 */
const submitFormError = (): void => {
message.error('上传失败,请您重新上传!')
formLoading.value = false
}
/** 重置表单 */
const resetForm = () => {
//
formLoading.value = false
uploadRef.value?.clearFiles()
fileList.value = []
}
/** 文件数超出提示 */
const handleExceed = (): void => {
message.error('最多只能上传一个文件!')
}
/** 下载模板操作 */
const importTemplate = () => {
const res = importTemplateData.value.templateUrl
download.excel(res, importTemplateData.value.templateTitle)
}
const customerList = ref();
const queryParams = reactive({
supplierCode: '',
yearsMonthStr: '',
})
const getCustomerList = async () => {//
const list = await SuppliperMoldCostMainApi.getCustomerList();
customerList.value = list;
}
</script>
<style scoped lang="scss">
.text-red{
color: var(--el-color-danger);
}
.tips {
div {
position: relative;
padding-left: 22px;
&::before {
width: 4px;
height: 4px;
border-radius: 50%;
content: '';
background: #c2c2c2;
position: absolute;
top: 50%;
margin-top: -2px;
left: 4px;
}
}
}
</style>

4
src/components/Table/src/Table.vue

@ -106,7 +106,7 @@ export default defineComponent({
if (!wsCache.get('ShowPackingNumber')) {
if (columns) {
columns = columns.filter(item => item.field != 'packingNumber')
columns = columns.filter(item => item.field != 'packingNumber' && item.field != 'fromPackingNumber'&& item.field != 'toPackingNumber')
}
}
for (const v of columnsChildren || columns) {
@ -347,7 +347,7 @@ export default defineComponent({
} = unref(getProps)
if (!wsCache.get('ShowPackingNumber')) {
if (columns) {
columns = columns.filter(item => item.field != 'packingNumber')
columns = columns.filter(item => item.field != 'packingNumber' && item.field != 'fromPackingNumber'&& item.field != 'toPackingNumber')
}
}
//

3
src/locales/en-US.ts

@ -1315,7 +1315,8 @@ export default {
退: 'Returned successfully',
: 'Do you want to confirm the allocation amount?',
: 'Create an invoice request?',
:'Detail'
:'Detail',
退:'Return'
},

3
src/locales/zh-CN.ts

@ -1316,7 +1316,8 @@ export default {
退: '退回成功',
: '是否确认分摊金额?',
: '创建开票申请',
:'详情'
:'详情',
退:'退回',
},
}

4
src/utils/dict.ts

@ -415,4 +415,8 @@ export enum DICT_TYPE {
DELIVER_METHOD = 'deliver_method',
CUSTOMER_SALE_INVOICE_TYPE = 'customer_saleInvoice_type', // 销售开票
LEADERSHIP_MATERIAL_TYPE = 'leadership_material_type',
SUPPLIER_TOOL_APPORT_STATEMENT_MAIN = 'supplier_tool_apport_statement_main', // 供应商模具费用主
SUPPLIER_TOOL_APPORT_STATEMENT_DETAIL = 'supplier_tool_apport_statement_detail', // 供应商模具费用子
}

2
src/views/wms/basicDataManage/labelManage/callmaterials/callmaterials.data.ts

@ -38,7 +38,7 @@ export const CallmaterialsRules = reactive({
workStationCode: [required],
uom: [required],
callmaterialQty: [required],
project: [{ max: 64, message: '最多50字符', trigger: 'blur'}]
project: [{ max: 64, message: '最多64字符', trigger: 'blur'}]
})
export const Callmaterials = useCrudSchemas(reactive<CrudSchema[]>([

133
src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue

@ -104,22 +104,14 @@
:key="'供应商OperatorOption'+cur.value"
/>
</el-select>
<el-select key="供应商Value"
v-model="item.Value"
placeholder="请选择供应商"
style="flex: 1"
clearable
multiple
collapse-tags
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
v-for="cur in options.supplierList"
:key="'供应商ValueOption'+cur.code"
:label="cur.name"
:value="cur.code"
/>
</el-select>
<el-input key="供应商Value" style="flex:1" placeholder="请选择供应商" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'SupplierCode'})"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchList('SupplierCode')">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -149,6 +141,10 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -158,6 +154,9 @@ import { getSupplierList } from '@/api/wms/supplier'
import * as RuleApi from '@/api/wms/rule'
import { isString } from '@/utils/is'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
const { t } = useI18n() //
const message = useMessage() //
@ -414,8 +413,110 @@ const resetForm = () => {
}
}
}
const warehouseType = ref()
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
}
if(!warehouseValue){
return
}
let verifyRes = []
if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){
//
verifyRes = await SupplierApi.getSupplierListByCodes({
codes:warehouseValue
})
console.log('供应商verifyRes',verifyRes)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
//
const searchTableRef = ref()
const searchList = (type) => {
if (type == 'SupplierCode') {
searchTableRef.value.open(
'请选择供应商',
Supplier.allSchemas,
SupplierApi.getSupplierPage,
'SupplierCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
if(formField=='SupplierCode'){
let transactionType = formData.value.condition.find(item=>item['ParamCode']== formField)
if(transactionType){
transactionType.Value = val.map(item=>(item['code'])).join(',')
}
return
}
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
</script>
<style scoped lang="scss">
.item {

205
src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue

@ -80,22 +80,20 @@
:key="'供应商OperatorOption'+index+cur.value"
/>
</el-select>
<el-select :key="'供应商Value'+index"
v-model="item.Value"
:placeholder="`请选择${item.ParamCode == 'SupplierCode' ? '供应商' : '客户'}`"
style="flex: 1"
clearable
multiple
collapse-tags
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
v-for="cur in options.supplierList"
:key="'供应商ValueOption'+index+cur.code"
:label="cur.name"
:value="cur.code"
/>
</el-select>
<el-input key="客户Value" style="flex:1" placeholder="请选择客户" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'CustomerCode'})" v-if="item.ParamCode == 'CustomerCode'" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({ module: 'condition', type: 'CustomerCode' })">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<el-input key="供应商Value" style="flex:1" placeholder="请选择供应商" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'SupplierCode'})" v-if="item.ParamCode == 'SupplierCode'" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({ module: 'condition', type: 'SupplierCode' })">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 选择物料类型 -->
<el-form-item :key="'物料类型formItem'+index" label="" label-width="0" class="err-240" v-if="index == 1">
@ -176,14 +174,14 @@
v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input :key="'物料Value'+index"
v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料Value" style="flex:1" placeholder="请选择物料" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'ItemCode'})" v-else-if="item.ParamCode == 'ItemCode'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({ module: 'condition', type: 'ItemCode' })"
>
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -264,6 +262,10 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -273,6 +275,13 @@ import { getCustomerList } from '@/api/wms/customer'
import * as RuleApi from '@/api/wms/rule'
import { isString } from '@/utils/is'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import { Customer, CustomerRules } from '@/views/wms/basicDataManage/customerManage/customer/customer.data'
import * as CustomerApi from '@/api/wms/customer'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { json } from 'stream/consumers'
@ -593,6 +602,154 @@ const inputBlur = () => {
formData.value.configurationRules = '1'
}
}
const searchTableRef = ref()
const searchTableModule = ref('') // 条件 / 配置
const searchWarehouse = ({module='config',type})=>{
searchTableModule.value = module
// module: config condition
if(module=='condition'&&type=='CustomerCode' || module=='config'&&warehouseType.value == 'CustomerCode'){
//
searchTableRef.value.open(
'请选择客户',
Customer.allSchemas,
CustomerApi.getCustomerPage,
'CustomerCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){
//
searchTableRef.value.open(
'请选择供应商',
Supplier.allSchemas,
SupplierApi.getSupplierPage,
'SupplierCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
searchTableRef.value.open(
'请选择物料',
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
'ItemCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const warehouseType = ref('')
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
// { value: 'WarehouseCode', label: '' },
// { value: 'AreaCode', label: '' },
// { value: 'LocationGroupCode', label: '' },
// { value: 'LocationCode', label: '' }
}
if(!warehouseValue){
return
}
let verifyRes = []
if(module=='condition'&&type=='CustomerCode' || module=='config'&&warehouseType.value == 'CustomerCode'){
//
verifyRes = await CustomerApi.getCustomerByCodes({
codes:warehouseValue
})
console.log('客户verifyRes',verifyRes)
}else if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){
//
verifyRes = await SupplierApi.getSupplierListByCodes({
codes:warehouseValue
})
console.log('供应商verifyRes',verifyRes)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
if(searchTableModule.value == 'condition'){
// module: config condition
//
let conditionObj = formData.value.condition.find(item=>['ItemCode','WarehouseCode','AreaCode','LocationGroupCode','LocationCode'].includes(item['ParamCode']))
conditionObj['Value'] = val.map(item=>(item['code'])).join(',')
}else{
//
//
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
</script>
<style scoped lang="scss">
.item {

145
src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue

@ -167,9 +167,9 @@
v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value">
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" @blur="blurWarehouse({module:'condition',type:'ItemCode'})" v-else-if="item.ParamCode == 'ItemCode'" v-model="item.Value" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchItemCode">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -204,9 +204,9 @@
:key="'供应商和客户Operator'+cur.value"
/>
</el-select>
<el-input key="供应商和客户Value" style="flex:1" placeholder="请选择客户" disabled v-model="item.Value" @blur="blurCustomerList">
<el-input key="供应商和客户Value" style="flex:1" placeholder="请选择客户" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'CustomerCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchCustomerList">
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchCustomerList">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -220,6 +220,7 @@
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
:label="cur.label"
@ -228,9 +229,9 @@
:key="'生产线Operator'+cur.value"
/>
</el-select>
<el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" disabled v-model="item.Value" @blur="blurTransactionType">
<el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'Productionline'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchTransactionType">
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchTransactionType">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -261,18 +262,18 @@
<!-- 仓库 -->
<el-input style="flex:1" v-show="warehouseType == 'WarehouseCode'" placeholder="请选择从仓库" v-model="formData.configuration.WarehouseCode" @blur="blurWarehouse">
<el-input style="flex:1" v-show="warehouseType == 'WarehouseCode'" placeholder="请选择从仓库" v-model="formData.configuration.WarehouseCode" @blur="blurWarehouse({module:'config',type:'WarehouseCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库区 -->
<el-input style="flex:1" v-show="warehouseType == 'AreaCode'" placeholder="请选择从库区" v-model="formData.configuration.AreaCode" @blur="blurWarehouse">
<el-input style="flex:1" v-show="warehouseType == 'AreaCode'" placeholder="请选择从库区" v-model="formData.configuration.AreaCode" @blur="({module:'config',type:'AreaCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -280,18 +281,18 @@
<!-- 库位组 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="formData.configuration.LocationGroupCode" @blur="blurWarehouse">
<el-input style="flex:1" v-show="warehouseType == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="formData.configuration.LocationGroupCode" @blur="({module:'config',type:'LocationGroupCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationCode'" placeholder="请选择从库位" v-model="formData.configuration.LocationCode" @blur="blurWarehouse">
<el-input style="flex:1" v-show="warehouseType == 'LocationCode'" placeholder="请选择从库位" v-model="formData.configuration.LocationCode" @blur="({module:'config',type:'LocationCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -754,74 +755,105 @@ const filterMethodWarehouseList = (query: string) => {
const searchTableRef = ref()
const blurWarehouse = async ()=>{
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
}
if(!warehouseValue){
return
}
if(warehouseType.value == 'WarehouseCode'){
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}else if(module=='condition'&&type=='CustomerCode' || module=='config'&&warehouseType.value == 'CustomerCode'){
//
verifyRes = await CustomerApi.getCustomerByCodes({
codes:warehouseValue
})
console.log('客户verifyRes',verifyRes)
}else if(module=='condition'&&type=='Productionline' || module=='config'&&warehouseType.value == 'Productionline'){
// 线
verifyRes = await ProductionlineApi.getProductionlineByCodes({
codes:warehouseValue
})
console.log('生产线verifyRes',verifyRes)
}else if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
let verifyRes = await WarehouseApi.verifyWarehouse({
verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue
})
console.log('仓库verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'AreaCode'){
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
//
let verifyRes = await AreaApi.verifyAreaList({
verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue
})
console.log('库区verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'LocationGroupCode'){
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
let verifyRes = await LocationgroupApi.verifyLocationgroup({
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'LocationCode'){
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
let verifyRes = await LocationApi.verifyLocation({
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
console.log('库位verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
//
const searchCustomerList = ()=>{
@ -838,22 +870,7 @@ const searchCustomerList = ()=>{
)
}
const blurCustomerList = async ()=>{
let customerCode = formData.value.condition.find(item=>item['ParamCode']=='CustomerCode')
if(customerCode&&customerCode.Value){
let verifyRes = await CustomerApi.getCustomerPage({
code:customerCode.Value
})
console.log('客户',verifyRes)
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = customerCode.Value.split(',')
customerCode.Value = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
customerCode.Value = ''
}
}
}
//
const searchItemCode = ()=>{

61
src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

@ -215,9 +215,9 @@
v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value">
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchItemCode">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -341,9 +341,10 @@
:key="'生产线Operator'+cur.value"
/>
</el-select>
<el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" disabled v-model="item.Value" @blur="blurTransactionType">
<el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" v-model="item.Value" @blur="blurProductionline"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchTransactionType">
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchTransactionType">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -376,7 +377,7 @@
<!-- 仓库 -->
<el-input style="flex:1" v-show="warehouseType == 'WarehouseCode'" placeholder="请选择从仓库" v-model="formData.configuration.WarehouseCode" @blur="blurWarehouse">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -385,7 +386,7 @@
<!-- 库区 -->
<el-input style="flex:1" v-show="warehouseType == 'AreaCode'" placeholder="请选择从库区" v-model="formData.configuration.AreaCode" @blur="blurWarehouse">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -395,7 +396,7 @@
<!-- 库位组 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="formData.configuration.LocationGroupCode" @blur="blurWarehouse">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -404,7 +405,7 @@
<!-- 库位 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationCode'" placeholder="请选择从库位" v-model="formData.configuration.LocationCode" @blur="blurWarehouse">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -955,8 +956,13 @@ const blurWarehouse = async ()=>{
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'AreaCode'){
@ -968,7 +974,12 @@ const blurWarehouse = async ()=>{
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
message.alert('代码' + str + '没有找到对应数据')
}
}else{
formData.value.configuration[warehouseType.value] = ''
}
@ -982,7 +993,12 @@ const blurWarehouse = async ()=>{
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
@ -995,8 +1011,13 @@ const blurWarehouse = async ()=>{
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
@ -1041,18 +1062,24 @@ const searchTransactionType = ()=>{
)
}
//
const blurTransactionType = async ()=>{
let transactionType = formData.value.condition.find(item=>item['ParamCode']=='TransactionType')
const blurProductionline= async ()=>{
let transactionType = formData.value.condition.find(item => item['ParamCode'] == 'Productionline')
console.log(transactionType)
if(transactionType&&transactionType.Value){
let verifyRes = await TransactiontypeApi.verifyTransactiontype({
code:transactionType.Value
let verifyRes = await ProductionlineApi.getProductionlineByCodes({
codes:transactionType.Value
})
console.log('事务类型verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = transactionType.Value.split(',')
transactionType.Value = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
transactionType.Value = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
message.alert('代码' + transactionType.Value + '没有找到对应数据')
transactionType.Value = ''
}
}
@ -1258,7 +1285,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success
const submitForm = async () => {
await blurWarehouse()
await blurTransactionType()
await blurProductionline()
console.log('规则条件',formData.value.condition)
//

161
src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue

@ -107,20 +107,14 @@
:key="'供应商option'+cur.value"
/>
</el-select>
<el-select :key="'供应商Value'+index"
v-model="item.Value"
placeholder="请选择供应商"
style="flex: 1"
clearable
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
v-for="cur in options.supplierList"
:key="'供应商Valueoption'+cur.code"
:label="cur.name"
:value="cur.code"
/>
</el-select>
<el-input key="供应商Value" style="flex:1" placeholder="请选择供应商" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'SupplierCode'})"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchList('SupplierCode')">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 物料 -->
<el-form-item :key="'物料formItem'+index" v-else-if="index == 2" label="物料" class="flex-top err-120">
@ -137,13 +131,14 @@
:key="'供应商OperatorOption'+cur.value"
/>
</el-select>
<el-input :key="'供应商Value'+index"
v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔"
clearable
style="flex: 1"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料Value" style="flex:1" placeholder="请选择物料" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'ItemCode'})"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchList('ItemCode')">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -252,6 +247,10 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -260,6 +259,10 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { getSupplierList } from '@/api/wms/supplier'
import * as RuleApi from '@/api/wms/rule'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic} from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
const { t } = useI18n() //
const message = useMessage() //
@ -588,6 +591,122 @@ const inputNumberBlur = () => {
formData.value.configurationRules = '1'
}
}
const warehouseType = ref()
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
}
if(!warehouseValue){
return
}
let verifyRes = []
if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){
//
verifyRes = await SupplierApi.getSupplierListByCodes({
codes:warehouseValue
})
console.log('供应商verifyRes',verifyRes)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
//
const searchTableRef = ref()
const searchList = (type) => {
if (type == 'SupplierCode') {
searchTableRef.value.open(
'请选择供应商',
Supplier.allSchemas,
SupplierApi.getSupplierPage,
'SupplierCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if (type == 'ItemCode') {
searchTableRef.value.open(
'请选择物料',
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
'ItemCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
if(formField=='SupplierCode' || formField=='ItemCode'){
let transactionType = formData.value.condition.find(item=>item['ParamCode']== formField)
if(transactionType){
transactionType.Value = val.map(item=>(item['code'])).join(',')
}
return
}
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
</script>
<style scoped lang="scss">
.item {

308
src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue

@ -114,32 +114,32 @@
:value="cur.value"
/>
</el-select>
<el-input
v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔"
clearable
style="flex: 1"
:disabled="formData.priority==0&&formType=='update'"
v-else-if="item.ParamCode == 'ItemCode'"
/>
<el-input key="物料Value" style="flex:1" placeholder="请选择物料" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'ItemCode'})" v-else-if="item.ParamCode == 'ItemCode'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({ module: 'condition', type: 'ItemCode' })"
>
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 仓库 库区 库位组 库位 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<el-select
<el-select key="仓库条件"
v-model="item.ParamCode"
placeholder=""
style="width: 110px; margin-right: 10px"
@change="changeWarehouse"
:disabled="formData.priority==0&&formType=='update'"
@change="item.Value = ''"
>
<el-option
:label="cur.label"
:label= "cur.label"
:value="cur.value"
v-for="(cur, index) in options.warehouseTypeOptions"
:key="index"
:key="'仓库'+cur.value"
/>
</el-select>
<el-select
<el-select key="供应商和客户Operator"
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
@ -149,35 +149,44 @@
:label="cur.label"
:value="cur.value"
v-for="cur in options.rangeOptions1"
:key="cur.value"
/>
</el-select>
<el-select
v-model="item.Value"
:placeholder="`请选择${
item.ParamCode == 'WarehouseCode'
? '仓库'
: item.ParamCode == 'AreaCode'
? '库区'
: item.ParamCode == 'LocationGroupCode'
? '库位组'
: item.ParamCode == 'LocationCode'
? '库位'
: ''
}`"
clearable
multiple
collapse-tags
style="flex: 1"
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.code"
:value="cur.code"
:key="'供应商和客户Operator'+cur.value"
/>
</el-select>
<!-- 仓库 -->
<el-input style="flex:1" v-show="item.ParamCode == 'WarehouseCode'" placeholder="请选择从仓库" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'WarehouseCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'WarehouseCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库区 -->
<el-input style="flex:1" v-show="item.ParamCode == 'AreaCode'" placeholder="请选择从库区" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'AreaCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'AreaCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位组 -->
<el-input style="flex:1" v-show="item.ParamCode == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'LocationGroupCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'LocationGroupCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位 -->
<el-input style="flex:1" v-show="item.ParamCode == 'LocationCode'" placeholder="请选择从库位" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'LocationCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'LocationCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -290,7 +299,7 @@
{ required: formData.configuration.emailNotification, message: '请输入邮箱地址', trigger: 'change' },
{ validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'}
]">
<el-input v-model="formData.configuration.emailAddress" />
<el-input v-model="formData.configuration.emailAddress" :disabled="!formData.configuration.emailNotification"/>
</el-form-item>
</el-col>
</el-row>
@ -302,16 +311,28 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'UpShelfStrategyAddForm' })
import { getWarehouseList } from '@/api/wms/warehouse'
import { getAreaList } from '@/api/wms/areabasic'
import { getLocationgroupList } from '@/api/wms/locationgroup'
import { getLocationList } from '@/api/wms/location'
import * as RuleApi from '@/api/wms/rule'
import { isString } from '@/utils/is'
import * as WarehouseApi from '@/api/wms/warehouse'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as AreaApi from '@/api/wms/areabasic'
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data'
import * as LocationgroupApi from '@/api/wms/locationgroup'
import { Locationgroup } from '@/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic} from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { validateHanset, validateEmail } from '@/utils/validator'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
@ -603,7 +624,7 @@ const resetForm = () => {
//
condition: [
// ///abc//
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' },
{ ParamCode: 'ItemType', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' }
],
@ -645,7 +666,202 @@ const validateFeedQty = (rule, value, callback) => {
callback()
}
}
const searchTableRef = ref()
const searchTableModule = ref('') // 条件 / 配置
const searchWarehouse = ({module='config',type})=>{
searchTableModule.value = module
// module: config condition
if( module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
searchTableRef.value.open(
'请选择仓库',
Warehouse.allSchemas,
WarehouseApi.getWarehousePage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
searchTableRef.value.open(
'请选择库区',
Area.allSchemas,
AreaApi.getAreaPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
searchTableRef.value.open(
'请选择库位组',
Locationgroup.allSchemas,
LocationgroupApi.getLocationgroupPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
searchTableRef.value.open(
'请选择库位',
Location.allSchemas,
LocationApi.getLocationPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
searchTableRef.value.open(
'请选择物料',
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
'ItemCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const warehouseType = ref('')
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
// { value: 'WarehouseCode', label: '' },
// { value: 'AreaCode', label: '' },
// { value: 'LocationGroupCode', label: '' },
// { value: 'LocationCode', label: '' }
}
if(!warehouseValue){
return
}
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue
})
console.log('仓库verifyRes',verifyRes)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
//
verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue
})
console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
if(searchTableModule.value == 'condition'){
// module: config condition
if (formField == 'ItemCode') {
//
let conditionObj = formData.value.condition.find(item => ['ItemCode'].includes(item['ParamCode']))
console.log(33,conditionObj)
conditionObj['Value'] = val.map(item=>(item['code'])).join(',')
}else{
//
let conditionObj = formData.value.condition.find(item => ['WarehouseCode', 'AreaCode', 'LocationGroupCode', 'LocationCode'].includes(item['ParamCode']))
console.log(33,conditionObj)
conditionObj['Value'] = val.map(item=>(item['code'])).join(',')
}
}else{
//
//
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
</script>
<style scoped lang="scss">
.item {

303
src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue

@ -130,32 +130,34 @@
v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input :key="'物料Value'+index"
v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料Value" style="flex:1" placeholder="请选择物料" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'ItemCode'})" v-else-if="item.ParamCode == 'ItemCode'"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({ module: 'condition', type: 'ItemCode' })"
>
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 仓库 库区 库位组 库位 -->
<el-form-item :key="'仓库'+index" label="" label-width="0" class="err-240" v-if="index == 1">
<el-select :key="'仓库title'+index"
<el-select key="仓库条件"
v-model="item.ParamCode"
placeholder=""
style="width: 110px; margin-right: 10px"
@change="changeWarehouse"
:disabled="formData.priority==0&&formType=='update'"
@change="item.Value = ''"
>
<el-option
:label="cur.label"
:label= "cur.label"
:value="cur.value"
v-for="(cur, index) in options.warehouseTypeOptions"
:key="'仓库titleOption'+index+cur.value"
:key="'仓库'+cur.value"
/>
</el-select>
<el-select :key="'仓库Operator'+index"
<el-select key="供应商和客户Operator"
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
@ -165,35 +167,47 @@
:label="cur.label"
:value="cur.value"
v-for="cur in options.rangeOptions1"
:key="'仓库Operator'+index+cur.value"
/>
</el-select>
<el-select :key="'仓库Value'+index"
v-model="item.Value"
:placeholder="`请选择${
item.ParamCode == 'WarehouseCode'
? '仓库'
: item.ParamCode == 'AreaCode'
? '库区'
: item.ParamCode == 'LocationGroupCode'
? '库位组'
: item.ParamCode == 'LocationCode'
? '库位'
: ''
}`"
clearable
multiple
collapse-tags
style="flex: 1"
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
v-for="cur in options.warehouseList"
:key="'仓库Value'+index+cur.code"
:label="cur.code"
:value="cur.code"
:key="'供应商和客户Operator'+cur.value"
/>
</el-select>
<!-- 仓库 -->
<el-input style="flex:1" v-show="item.ParamCode == 'WarehouseCode'" placeholder="请选择从仓库" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'WarehouseCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'WarehouseCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库区 -->
<el-input style="flex:1" v-show="item.ParamCode == 'AreaCode'" placeholder="请选择从库区" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'AreaCode'})"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse({module:'condition',type:'AreaCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位组 -->
<el-input style="flex:1" v-show="item.ParamCode == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'LocationGroupCode'})"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse({module:'condition',type:'LocationGroupCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位 -->
<el-input style="flex:1" v-show="item.ParamCode == 'LocationCode'" placeholder="请选择从库位" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'LocationCode'})"
:disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse({module:'condition',type:'LocationCode'})" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -284,17 +298,30 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'UpShelfStrategyAddForm' })
import { getWarehouseList } from '@/api/wms/warehouse'
import { getAreaList } from '@/api/wms/areabasic'
import { getLocationgroupList } from '@/api/wms/locationgroup'
import { getLocationList } from '@/api/wms/location'
import * as RuleApi from '@/api/wms/rule'
import { isString } from '@/utils/is'
import * as WarehouseApi from '@/api/wms/warehouse'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as AreaApi from '@/api/wms/areabasic'
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data'
import * as LocationgroupApi from '@/api/wms/locationgroup'
import { Locationgroup } from '@/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic} from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() //
@ -506,6 +533,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
resetForm()
}
}
defineExpose({ open }) // open
@ -599,7 +627,194 @@ const resetForm = () => {
}
}
}
const searchTableRef = ref()
const searchTableModule = ref('') // 条件 / 配置
const searchWarehouse = ({module='config',type})=>{
searchTableModule.value = module
// module: config condition
if( module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
searchTableRef.value.open(
'请选择仓库',
Warehouse.allSchemas,
WarehouseApi.getWarehousePage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
searchTableRef.value.open(
'请选择库区',
Area.allSchemas,
AreaApi.getAreaPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
searchTableRef.value.open(
'请选择库位组',
Locationgroup.allSchemas,
LocationgroupApi.getLocationgroupPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
searchTableRef.value.open(
'请选择库位',
Location.allSchemas,
LocationApi.getLocationPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
searchTableRef.value.open(
'请选择物料',
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
'ItemCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const warehouseType = ref('')
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
// { value: 'WarehouseCode', label: '' },
// { value: 'AreaCode', label: '' },
// { value: 'LocationGroupCode', label: '' },
// { value: 'LocationCode', label: '' }
}
if(!warehouseValue){
return
}
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue
})
console.log('仓库verifyRes',verifyRes)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
//
verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue
})
console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}else if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
if(searchTableModule.value == 'condition'){
// module: config condition
//
let conditionObj = formData.value.condition.find(item=>['ItemCode','WarehouseCode','AreaCode','LocationGroupCode','LocationCode'].includes(item['ParamCode']))
conditionObj['Value'] = val.map(item=>(item['code'])).join(',')
}else{
//
//
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
</script>
<style scoped lang="scss">
.item {

198
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -82,10 +82,13 @@
:key="'仓库和库区Operator'+cur.value"
/>
</el-select>
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouseByCodes(item.ParamCode)" :disabled="formData.priority==0&&formType=='update'"/>
<el-button type="info" plain @click="searchWarehouse" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" />
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:WarehouseCodeOrArea})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 供应商代码 -->
<el-form-item key="供应商代码formItem"
@ -107,10 +110,13 @@
:key="'供应商代码Operator'+cur.value"
/>
</el-select>
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurSupplierCode" :disabled="formData.priority==0&&formType=='update'"/>
<el-button type="info" plain @click="searchSupplier" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" />
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'SupplierCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchSupplier">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -145,10 +151,13 @@
</el-form-item>
<!-- 月台 -->
<el-form-item key="月台formItem" :label="t('ts.月台').replace('ts.','')" prop="configuration.DockCode">
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode"/>
<el-button type="info" plain @click="searchDockCode">
<Icon icon="ep:search" />
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchDockCode">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 收货人 -->
<el-form-item key="收货人formItem" :label="t('ts.收货人').replace('ts.','')" prop="Receiver">
@ -561,110 +570,93 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
formData.value.configuration.PhoneNumber = val[0].contactPhone
}
}
//
const blurWarehouseByCodes = async (formField) => {
if (formField == 'WarehouseCode') {
let WarehouseCode = formData.value.condition.find(item=>item['ParamCode']=='WarehouseCode')
if(WarehouseCode&&WarehouseCode.Value){
let verifyRes = await WarehouseApi.getWarehouseByCodes({
codes:WarehouseCode.Value
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes && verifyRes.length > 0) {
const arr1 = WarehouseCode.Value.split(',')
if (arr1.length != verifyRes.length) {
const arr2 = verifyRes.map((item) => item.code)
const str = [
...arr1.filter((item) => !arr2.includes(item)),
...arr2.filter((item) => !arr1.includes(item))
].join(',')
message.alert('代码' + str + '没有找到对应数据')
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[WarehouseCodeOrArea.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
// { value: 'WarehouseCode', label: '' },
// { value: 'AreaCode', label: '' },
// { value: 'LocationGroupCode', label: '' },
// { value: 'LocationCode', label: '' }
}
if(!warehouseValue){
return
}
} else {
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
message.alert('暂无数据')
}
}else{
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
}
} else {
let AreaCode = formData.value.condition.find(item=>item['ParamCode']=='AreaCode')
if(AreaCode&&AreaCode.Value){
let verifyRes = await AreaApi.getAreabasicByCodes({
codes:AreaCode.Value
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes && verifyRes.length > 0) {
const arr1 = AreaCode.Value.split(',')
if (arr1.length != verifyRes.length) {
const arr2 = verifyRes.map((item) => item.code)
const str = [
...arr1.filter((item) => !arr2.includes(item)),
...arr2.filter((item) => !arr1.includes(item))
].join(',')
console.log('仓库verifyRes',verifyRes)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
//
verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue
})
console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}else if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){
//
verifyRes = await SupplierApi.getSupplierListByCodes({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
AreaCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
return
}
} else {
AreaCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
message.alert('暂无数据')
}
}else{
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
//
const blurSupplierCode = async () => {
let SupplierCode = formData.value.condition.find(item => item['ParamCode'] == 'SupplierCode')
console.log(77,SupplierCode)
if(SupplierCode&&SupplierCode.Value){
let verifyRes = await SupplierApi.getSupplierListByCodes({
codes:SupplierCode.Value
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes && verifyRes.length > 0) {
const arr1 = SupplierCode.Value.split(',')
if (arr1.length != verifyRes.length) {
const arr2 = verifyRes.map((item) => item.code)
const str = [
...arr1.filter((item) => !arr2.includes(item)),
...arr2.filter((item) => !arr1.includes(item))
].join(',')
message.alert('代码' + str + '没有找到对应数据')
SupplierCode.Value = ''
return
}
} else {
SupplierCode.Value = ''
message.alert('暂无数据')
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
}else{
SupplierCode.Value = ''
})
}
}
//
const blurDockCode = async () => {
if (formData.value.configuration.DockCode) {
@ -689,9 +681,11 @@ const blurDockCode = async () => {
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes.list && verifyRes.list.length > 0) {
let codeList = formData.value.configuration.DockCode.split(',')
formData.value.configuration.DockCode= codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
} else {
message.alert('代码' + formData.value.configuration.DockCode + '没有找到对应数据')
formData.value.configuration.DockCode = ''
message.alert('暂无数据')
}
}

11
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

@ -1077,17 +1077,28 @@ const blurWarehouse = async ({module='config',type})=>{
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}

280
src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue

@ -54,21 +54,21 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="'规则条件col'+index">
<!-- 仓库 库区 库位组 库位 -->
<el-form-item :key="'规则条件formItem'+index" label="" label-width="0" class="err-130" v-if="index == 0">
<el-select :key="'规则条件select'+index"
<el-select key="仓库条件"
v-model="item.ParamCode"
placeholder=""
style="width: 120px; margin-right: 10px"
@change="changeWarehouse"
style="width: 110px; margin-right: 10px"
:disabled="formData.priority==0&&formType=='update'"
@change="item.Value = ''"
>
<el-option
:label="cur.label"
:label= "cur.label"
:value="cur.value"
v-for="(cur, index) in options.warehouseTypeOptions"
:key="'规则条件option'+index"
:key="'仓库'+cur.value"
/>
</el-select>
<el-select :key="'请选择范围select'+index"
<el-select key="供应商和客户Operator"
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
@ -78,35 +78,44 @@
:label="cur.label"
:value="cur.value"
v-for="cur in options.RangeOptions"
:key="'选择范围option'+cur.value"
/>
</el-select>
<el-select :key="'规则条件Value'+index"
v-model="item.Value"
:placeholder="`请选择${
item.ParamCode == 'WarehouseCode'
? '仓库'
: item.ParamCode == 'AreaCode'
? '库区'
: item.ParamCode == 'LocationGroupCode'
? '库位组'
: item.ParamCode == 'LocationCode'
? '库位'
: ''
}`"
clearable
style="flex: 1"
multiple
collapse-tags
:disabled="formData.priority==0&&formType=='update'"
>
<el-option
v-for="cur in options.warehouseList"
:key="'规则条件option'+cur.code"
:label="cur.code"
:value="cur.code"
:key="'供应商和客户Operator'+cur.value"
/>
</el-select>
<!-- 仓库 -->
<el-input style="flex:1" v-show="item.ParamCode == 'WarehouseCode'" placeholder="请选择从仓库" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'WarehouseCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'WarehouseCode'})">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库区 -->
<el-input style="flex:1" v-show="item.ParamCode == 'AreaCode'" placeholder="请选择从库区" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'AreaCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'AreaCode'})">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位组 -->
<el-input style="flex:1" v-show="item.ParamCode == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'LocationGroupCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'LocationGroupCode'})">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位 -->
<el-input style="flex:1" v-show="item.ParamCode == 'LocationCode'" placeholder="请选择从库位" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'LocationCode'})">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'LocationCode'})">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -231,14 +240,24 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'UpShelfStrategyAddForm' })
import { getWarehouseList } from '@/api/wms/warehouse'
import { getAreaList } from '@/api/wms/areabasic'
import { getLocationgroupList } from '@/api/wms/locationgroup'
import { getLocationList } from '@/api/wms/location'
import * as WarehouseApi from '@/api/wms/warehouse'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as AreaApi from '@/api/wms/areabasic'
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data'
import * as LocationgroupApi from '@/api/wms/locationgroup'
import { Locationgroup } from '@/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as RuleApi from '@/api/wms/rule'
import { isString } from '@/utils/is'
@ -461,6 +480,193 @@ const open = async (type: string, strategyCode: string, id?: number) => {
]
}
}
const searchTableRef = ref()
const searchTableModule = ref('') // 条件 / 配置
const searchWarehouse = ({module='config',type})=>{
searchTableModule.value = module
// module: config condition
if( module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
searchTableRef.value.open(
'请选择仓库',
Warehouse.allSchemas,
WarehouseApi.getWarehousePage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
searchTableRef.value.open(
'请选择库区',
Area.allSchemas,
AreaApi.getAreaPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
searchTableRef.value.open(
'请选择库位组',
Locationgroup.allSchemas,
LocationgroupApi.getLocationgroupPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
searchTableRef.value.open(
'请选择库位',
Location.allSchemas,
LocationApi.getLocationPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const warehouseType = ref('')
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
// { value: 'WarehouseCode', label: '' },
// { value: 'AreaCode', label: '' },
// { value: 'LocationGroupCode', label: '' },
// { value: 'LocationCode', label: '' }
}
if(!warehouseValue){
return
}
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue
})
console.log('仓库verifyRes',verifyRes)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
//
verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue
})
console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}
}else{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
// let searchTableTitle = warehouseType.value == 'WarehouseCode'?'':warehouseType.value == 'AreaCode'?'':warehouseType.value == 'LocationGroupCode'?'':warehouseType.value == 'LocationCode'?'':''
console.log('searchTableSuccess',formField, searchField, val, type, row)
console.log(val.map(item=>(item['code'])).join(','))
// if(formField=='BusinessType'){
// let BusinessType = formData.value.condition.find(item=>item['ParamCode']=='BusinessType')
// if(BusinessType){
// BusinessType.Value = val.map(item=>(item['code'])).join(',')
// }
// return
// }else
if(formField=='BusinessType'){
console.log('condition',formData.value.condition)
let businessType = formData.value.condition.find(item=>item['ParamCode']=='BusinessType')
console.log('businessType',businessType)
if(businessType){
businessType.Value = val.map(item=>(item['code'])).join(',')
}
return
}else if(searchTableModule.value == 'condition'){
// module: config condition
//
let conditionObj = formData.value.condition.find(item=>['WarehouseCode','AreaCode','LocationGroupCode','LocationCode'].includes(item['ParamCode']))
conditionObj['Value'] = val.map(item=>(item['code'])).join(',')
}else{
//
//
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
defineExpose({ open }) // open
/** 提交表单 */

6
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts

@ -121,7 +121,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '未税金额',
field: 'mainBeforeTaxAmount',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
@ -145,7 +145,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '税额',
field: 'mainTaxAmount',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
@ -155,7 +155,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '价税合计金额',
field: 'mainAdTaxAmount',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {

4
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue

@ -99,7 +99,7 @@ const detailButtonBaseClick = async (val, item,tableObject) => {
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRecordDetail(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}子表明细${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
@ -174,7 +174,7 @@ const handleExport = async () => {
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}主表${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()

89
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue

@ -20,6 +20,50 @@
@submitForm="submitForm"
@inputNumberChange="inputNumberChange"
@onChange="onChange"
:sumFormDataByForm="
(
formRef,
formModel,
tableData,
formType,
originFormModel,
updateOriginFormModel,
sumFormDataHandle1
) => {
const {
taxRate = 0,
amount = 0,
taxAmount = 0,
beforeTaxAmount = 0,
totalTaxAmount = 0,
discountAmount1 = 0,
beforeTaxDiffAmount = 0,
taxAmountDiff = 0,
rebateTax=0,
} = formModel
// 2X*2
if (formType == 'update') {
//
console.log('taxRate', taxRate)
console.log('originFormModel', originFormModel.taxRate)
console.log('taxAmount', taxAmount)
if (taxRate != originFormModel.taxRate) {
if (originFormModel) {
sumFormDataHandle1()
}
updateOriginFormModel(formModel)
}
// 2. mainTaxAmount = */100
let mainTaxAmount = Number(Number(beforeTaxAmount*taxRate*0.01).toFixed(2))
formRef.value.setValues({
//
taxAmount:mainTaxAmount,
// mainAdTaxAmount =+
adTaxAmount:beforeTaxAmount+taxAmount
})
}
}
"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
const { taxRate = 0 } = formModel
@ -70,6 +114,23 @@ const openForm =async (type: string, row?: any) => {
formRef.value.open(type, row)
}
const openFormTable =async (type: string, row?: any, list?:any) => {
row['customerStatementNumber'] = row['number'] //
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'customerStatementNumber'){
item.componentProps.disabled = true
item.componentProps.isSearchList = false
item.componentProps.enterSearch = false
}
})
tableData.value = list //
formRef.value.open(type, row)
nextTick(()=>{
initTableDataPrice()
})
}
const onChange = (field, cur, formRef)=>{
console.log('onChange',field, cur, formRef)
@ -205,28 +266,32 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}).then((res) => {
console.log(55,res)
tableData.value = res.list && res.list.length > 0 ?res.list : []
initTableDataPrice()
})
// tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const initTableDataPrice = ()=>{
tableData.value.forEach(item=>{
item['sumPrice'] = item['price'] + item['allocationPrice']
// *2
item['beforeTaxAmount'] = item['sumPrice']*item['qty']
// taxAmount */100,2
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //
// +,2
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
})
})
// tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
@ -250,6 +315,6 @@ const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
defineExpose({openForm})
defineExpose({openForm,openFormTable})
</script>
<style lang="scss" scoped></style>

16
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts

@ -409,8 +409,10 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'allocationPrice',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
disabled: true
disabled: true,
precision: 2
}
},
tableForm: {
@ -424,6 +426,7 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'sumPrice',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
disabled: true
}
@ -437,6 +440,12 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '未税金额',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
precision: 2
}
},
tableForm: {
type: 'InputNumber',
precision: 2,
@ -447,8 +456,8 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'taxAmount',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
type: 'InputNumber',
precision: 2,
disabled: true
}
@ -464,6 +473,7 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'afterTaxAmount',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
disabled: true,
precision: 2,
@ -472,12 +482,14 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 2,
}
},
{
label: '操作',
field: 'action',
isForm: false,
isTableForm: false,
table: {
width: 150,
fixed: 'right'

23
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

@ -57,6 +57,21 @@
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` })]"
:sumFormDataByForm="
(formRef, formModel) => {console.log('formModel====',formModel)
const { beforeTaxAmount = 0, taxAmount = 0 , qty=0,price,allocationPrice,taxRate=1} = formModel
formRef.value.setValues({
// = +,2
afterTaxAmount: Number((Number(beforeTaxAmount) + Number(taxAmount)).toFixed(2)),
// /-
allocationPrice: Number(Number(Number(beforeTaxAmount)/Number(qty)) - Number(price)),
// = +
sumPrice:Number(Number(price)+Number(allocationPrice)),
// taxAmount */100,2
taxAmount: Number((Number(beforeTaxAmount) * Number(taxRate)))/100 //
})
}
"
@buttonBaseClick="detailButtonBaseClick"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
@ -117,7 +132,7 @@ const detailButtonBaseClick = async (val, item,tableObject) => {
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRequestDetail(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}子表明细${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
@ -151,7 +166,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-request-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), //
//defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -217,7 +232,7 @@ const buttonTableClick = async (val, row) => {
await message.confirm('确认要发布吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
message.success('发布成功')
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
@ -265,7 +280,7 @@ const handleExport = async () => {
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}主表${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()

7
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts

@ -168,6 +168,13 @@ export const CustomerreturnRequestMain = useCrudSchemas(
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
},
{
key: 'businessType', // 查询列表中字段
value: 'Deliver', // 指查询具体值
action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
},
{
key: 'createTime', // 查询列表中字段
value: dateTime - 30 * 24 * 60 * 60 * 1000 + ',' + dateTime, // 指查询具体值

3
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts

@ -690,7 +690,8 @@ export const DeliverRequestMainRules = reactive({
{ required: true, message: '请选择客户月台代码', trigger: 'change' }
],
customerOrderNumber: [
{ required: true, message: '请输入客户订单号', trigger: 'blur' }
{ required: true, message: '请输入客户订单号', trigger: 'blur' },
{ max: 64, message: '最多64个字符', trigger: 'blur' },
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }

38
src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts

@ -25,7 +25,7 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 180
},
isSearch: true
isSearch: false
},
{
label: '任务单号',
@ -74,7 +74,7 @@ export const DeliverRecordMain = useCrudSchemas(
},
isTable: true,
isForm: true,
isSearch: true,
isSearch: false,
search: {
component: 'Input',
componentProps: {
@ -88,20 +88,20 @@ export const DeliverRecordMain = useCrudSchemas(
}
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: false,
isTable: false,
isForm: false,
isDetail: false,
sort: 'custom',
table: {
width: 150
}
},
// {
// label: '状态',
// field: 'status',
// dictType: DICT_TYPE.REQUEST_STATUS,
// dictClass: 'string',
// isSearch: false,
// isTable: false,
// isForm: false,
// isDetail: false,
// sort: 'custom',
// table: {
// width: 150
// }
// },
{
label: '客户代码',
field: 'customerCode',
@ -130,7 +130,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: true,
isSearch:true,
},
{
label: '承运商',
@ -999,7 +1000,8 @@ export const DeliverRecordImport = useCrudSchemas(reactive<CrudSchema[]>([
// 导入表单校验
export const DeliverRecordImportRules = reactive({
customerOrderNumber: [
{ required: true, message: '请输入订单号', trigger: 'blur' }
{ required: true, message: '请输入订单号', trigger: 'blur' },
{ max: 64, message: '最多64字符', trigger: 'blur' }
],
startDate: [
{ required: true, message: '请选择开始日期', trigger: 'change' }

57
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts

@ -1,5 +1,5 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { dateFormatter,dateFormatterYM } from '@/utils/formatTime'
import { validateTwoNum } from '@/utils/validator'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
@ -68,32 +68,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false,
},
{
label: '年月',
field: 'yearsMonth',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat: 'YYYY-MM'
},
isTable:false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'YYYY-MM'
}
},
},
// {
// label: '年月',
// field: 'yearsMonthStr',
@ -120,7 +95,31 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '年月',
field: 'yearsMonth',
sort: 'custom',
formatter: dateFormatterYM,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat: 'YYYY-MM'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'YYYY-MM'
}
},
},
{
label: '创建者',
field: 'creator',
@ -164,7 +163,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action',
isForm: false,
table: {
width: 360,
width: 400,
fixed: 'right'
}
}

12
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

@ -131,10 +131,14 @@
:importTemplateData="importShareTemplateData"
@success="importSuccess"
/>
<!-- 表单弹窗添加/修改 -->
<CustomerSaleInvoiceBasicForm ref="saleFormRef" @getList="getList" @buttonBaseClick="buttonBaseClick"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import CustomerSaleInvoiceBasicForm from '@/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue'
import {
CustomerStatementMain,
CustomerStatementMainRules,
@ -299,6 +303,8 @@ const butttondata = (row, $index) => {
]
}
const saleFormRef = ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'rematch') {
@ -315,6 +321,12 @@ const buttonTableClick = async (val, row) => {
handleConfirmShareMoney(row.id)
} else if (val == 'createTicketApply') {
//
let mainRes = await CustomerStatementMainApi.getCustomerStatementMain(row.id)
let detailRes = await CustomerStatementDetailApi.pageInvoice(row.id)
console.log('创建开票申请',mainRes)
console.log('创建开票申请11',detailRes)
saleFormRef.value.openFormTable('create',mainRes,detailRes?.list)
// handleConfirmShareMoney(row.id)
} else if (val == 'sendBack') {
// 退

16
src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts

@ -1,5 +1,5 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { dateFormatter,dateFormatterYM } from '@/utils/formatTime'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
@ -64,21 +64,24 @@ export const CustomerToolApportStatementForecastMain = useCrudSchemas(reactive<C
label: '年月',
field: 'yearsMonth',
sort: 'custom',
formatter: dateFormatter,
formatter: dateFormatterYM,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat: 'YYYY-MM'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
valueFormat: 'YYYY-MM'
}
},
},
@ -199,7 +202,6 @@ export const CustomerToolApportStatementForecastDetail = useCrudSchemas(reactive
field: 'forecastAllocationAmount',
sort: 'custom',
},
{
label: '操作',
field: 'action',
@ -215,13 +217,13 @@ export const CustomerToolApportStatementForecastDetail = useCrudSchemas(reactive
export const ForecastWithBillDifference = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '车型',
field: 'number',
field: 'vehicleType',
sort: 'custom',
isSearch: true,
},
{
label: '模具分摊预测金额',
field: 'articleNumber',
field: 'forecastAllocationAmount',
sort: 'custom',
isSearch: true,
},

19
src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue

@ -333,16 +333,15 @@ const changeTabs = async (item) => {
}]
apiPage.value = CustomerToolApportStatementForecastDetailApi.getCustomerToolApportStatementForecastDetailPage
DetailAllSchemas.value = CustomerToolApportStatementForecastDetail.allSchemas
otherHeadButttonData.value = []
// otherHeadButttonData.value = [{
// label: t(`ts.`).replace('ts.', ''),
// name: 'exportDetail',
// hide: false,
// type: 'success',
// icon: 'ep:download',
// color: '',
// hasPermi: ''
// }]
otherHeadButttonData.value = [{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportDetail',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
}]
} else if (item.prop == 'ForecastWithBilltDifference') {
//
tabsExtend.value = true

348
src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue

@ -0,0 +1,348 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search ref="seachRef"
:schema="SupplierMoldCostMain.allSchemas.searchSchema"
@search="searchClick"
@reset="searchClick"
@onChange="onSearchChange"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierMoldCostMain.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, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SupplierMoldCostMain.allSchemas"
:detailAllSchemas="SupplierMoldCostDetail.allSchemas"
:extendRowKeyValue = "[{
key:'number',
value:'number'
}]"
:apiPage="SuppliperMoldCostDetailApi.getSupplierMoldCostDetailPage"
:detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:supplier-mold-cost-main:export` })]"
@buttonBaseClick="detailButtonBaseClick"
/>
<!-- 导入 -->
<ImportSupplierMoldCostForm
ref="importFormRef"
url="/wms/supplier-tool-apport-statement-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SupplierMoldCostMain,
SupplierMoldCostDetail
} from './supplierMoldCostMain.data'
import * as SuppliperMoldCostMainApi from '@/api/wms/suppliperMoldCostMain'
import * as SuppliperMoldCostDetailApi from '@/api/wms/suppliperMoldCostDetail'
import ImportSupplierMoldCostForm from '@/components/ImportForm/src/ImportSupplierMoldCostForm.vue'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { formatDate } from '@/utils/formatTime'
//
defineOptions({ name: 'supplierMoldCostMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierMoldCostMain.allSchemas.tableColumns)
const otherHeadButttonData = ref()
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SuppliperMoldCostMainApi.getSupplierMoldCostMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn({hasPermi:'wms:supplier-mold-cost-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplier-mold-cost-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
const butttondata = (row, $index) => {
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
return [
{
label: t('ts.发布'),
name: 'publish',
hide: row.status!=0,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true //
},
{
label: t('ts.作废'),
name: 'abrogate',
hide: row.isAbrogate!=1,
type: 'danger',
icon: '',
color: '',
hasPermi: '',
link: true //
},
{
label: t('ts.退回'),
name: 'back',
hide: row.isBack!=1,
type: 'warning',
icon: '',
color: '',
hasPermi: '',
link: true //
}
]
}
// -
const buttonTableClick = async (val, row) => {
if(val=='publish'){
//
try {
//
await message.confirm('确认发布吗?')
//
await SuppliperMoldCostMainApi.publish(row.id)
message.success('发布成功')
//
buttonBaseClick('refresh')
} catch {}
}else if(val=='abrogate'){
//
try {
//
await message.confirm('确认作废吗?')
//
await SuppliperMoldCostMainApi.nodeAbrogate(row.id)
message.success('作废成功')
//
buttonBaseClick('refresh')
} catch {}
}else if(val=='back'){
//
try {
//
await message.confirm('确认退回吗?')
//
await SuppliperMoldCostMainApi.sendBack(row.id)
message.success('退回成功')
//
buttonBaseClick('refresh')
} catch {}
}
}
/** 详情操作 */
const detailRef = ref()
const tableObjectExtend = ref([])
const openDetail = (row: any, titleName: any, titleValue: any) => {
tableObjectExtend.value = [{
key: 'number',
value: row.number
}]
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerStatementMain')
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SuppliperMoldCostMainApi.exportSupplierMoldCostMain(tableObject.params)
download.excel(data, '供应商模具费用主表.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateTitle: '供应商模具费用导入模版.xlsx',
templateUrl : SuppliperMoldCostMainApi.importTemplate
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
const seachRef = ref()
const onSearchChange = (field, value)=>{
if(field=='status'){
//
if(value.length>0){
if(value[value.length-1]==''){
//
seachRef.value.setFormValues({
status:['']
})
}else{
seachRef.value.setFormValues({
status:value.filter(item=>item!='')
})
}
}
}
}
const searchClick = async (data)=>{
console.log('查询',data)
setSearchParams({...data,status:data.status.filter(item=>item!='')})
}
/** 初始化 **/
onMounted(async () => {
getList()
})
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const detailButtonBaseClick = async (val, item, detailTableObject) => {
console.log(val, item, detailTableObject)
if (val == 'export') {
//
handleExportDetail(detailTableObject)
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
//
const handleExportDetail = async (detailTableObject) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SuppliperMoldCostDetailApi.exportSupplierMoldCostDetail(
detailTableObject.params
)
download.excel(data, `对账差异【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
</script>

189
src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts

@ -0,0 +1,189 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter , dateFormatterYM } from '@/utils/formatTime'
import { validateTwoNum } from '@/utils/validator'
export const SupplierMoldCostMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
fixed: 'left',
isSearch: true,
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.SUPPLIER_TOOL_APPORT_STATEMENT_MAIN,
dictClass: 'string',
form: {
//value: '',//可以添加默认值 有无都可
component: 'Select',
},
isSearch: true,
search:{
component:'Select',
componentProps: {
multiple:true,
}
},
},
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
isTable: false
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '年月',
field: 'yearsMonth',
sort: 'custom',
formatter: dateFormatterYM,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat: 'YYYY-MM'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'YYYY-MM'
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isDetail:true,
isForm: false,
isTable:true
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
isTable:true,
isForm: false,
table:{
width:180
}
},
{
label: '更新者',
field: 'updater',
sort: 'custom',
isDetail:true,
isForm: false,
isTable:false
},
{
label: '更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
isTable:false,
isForm: false,
table:{
width:180
}
},
{
label: '操作',
field: 'action',
isForm: false,
isTable:true,
isDetail:false,
table: {
width: 180,
fixed: 'right'
}
}
]))
export const SupplierMoldCostDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料品号',
field: 'articleNumber',
sort: 'custom',
isForm: false,
},
{
label: '车型',
field: 'vehicleType',
sort: 'custom',
isForm: false,
},
{
label: '金额',
field: 'amount',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.SUPPLIER_TOOL_APPORT_STATEMENT_DETAIL,
dictClass: 'string',
form: {
//value: '',//可以添加默认值 有无都可
component: 'Select',
},
},
]))

219
src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/finishedShipmentMain.data.ts

@ -0,0 +1,219 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const FinishedShipmentMainRules = reactive({
orderNumber: [required],
shipmentRecordNumber: [required],
shipmentType: [required],
customerOrderNumber: [required],
available: [required],
concurrencyStamp: [required]
})
export const FinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '已发未结记录单号',
field: 'unfinishedNumber',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '发货记录单号',
field: 'shipmentRecordNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货类型',
field: 'shipmentType',
sort: 'custom',
table: {
width: 150,
},
dictType: DICT_TYPE.DELIVER_METHOD,
dictClass: 'string',
form: {
component: 'SelectV2'
}
},
{
label: '客户订单号',
field: 'customerOrderNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const FinishedShipmentDetailRules = reactive({
materialCode: [required],
materialName: [required],
backNumber: [required],
materialDescription: [required],
shipmentQuantity: [required],
unitPrice: [required],
lockedQuantity: [required],
available: [required],
concurrencyStamp: [required]
})
export const FinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '背番',
field: 'backNumber',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '物料描述',
field: 'itemDescription',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
// {
// label: '发货数量',
// field: 'shipmentQuantity',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
// {
// label: '锁定数量',
// field: 'lockedQuantity',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
{
label: '已结数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '销售单价',
field: 'unitPrice',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 150
},
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
hiddenInMain:true
},
{
label: '创建人',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true,
hiddenInMain:true
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

69
src/views/wms/deliversettlementManage/unfinishedShipmentDetail/index.vue → src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="UnfinishedShipmentDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="[...FinishedShipmentMain.allSchemas.searchSchema,...FinishedShipmentDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
@ -11,7 +11,8 @@
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="UnfinishedShipmentDetail.allSchemas"
:allSchemas="FinishedShipmentMain.allSchemas"
:detailAllSchemas="FinishedShipmentDetail.allSchemas"
/>
<!-- 列表 -->
@ -27,9 +28,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -42,31 +43,39 @@
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="UnfinishedShipmentDetailRules"
:formAllSchemas="UnfinishedShipmentDetail.allSchemas"
:apiUpdate="UnfinishedShipmentDetailApi.updateUnfinishedShipmentDetail"
:apiCreate="UnfinishedShipmentDetailApi.createUnfinishedShipmentDetail"
:rules="FinishedShipmentMainRules"
:formAllSchemas="FinishedShipmentMain.allSchemas"
:apiUpdate="FinishedShipmentMainApi.updateFinishedShipmentMain"
:apiCreate="FinishedShipmentMainApi.createFinishedShipmentMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="UnfinishedShipmentDetail.allSchemas" />
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="FinishedShipmentMain.allSchemas"
:detailAllSchemas="FinishedShipmentDetail.allSchemas"
:detailAllSchemasRules="FinishedShipmentDetailRules"
:apiPage="FinishedShipmentDetailApi.getFinishedShipmentDetailPage"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-main/import" :importTemplateData="importTemplateData" @success="importSuccess"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from './unfinishedShipmentDetail.data'
import * as UnfinishedShipmentDetailApi from '@/api/wms/unfinishedShipmentDetail'
import { FinishedShipmentMain,FinishedShipmentMainRules,FinishedShipmentDetail,FinishedShipmentDetailRules } from './finishedShipmentMain.data'
import * as FinishedShipmentMainApi from '@/api/wms/finishedShipmentMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as FinishedShipmentDetailApi from '@/api/wms/finishedShipmentDetail'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'UnfinishedShipmentDetail' })
defineOptions({ name: 'FinishedShipmentMain' })
const message = useMessage() //
const { t } = useI18n() //
@ -74,7 +83,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(UnfinishedShipmentDetail.allSchemas.tableColumns)
const tableColumns = ref([...FinishedShipmentMain.allSchemas.tableColumns,...FinishedShipmentDetail.allSchemas.tableMainColumns])
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -91,7 +100,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage //
getListApi: FinishedShipmentDetailApi.getFinishedShipmentDetailPage //
})
//
@ -99,9 +108,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:unfinishedShipmentDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:unfinishedShipmentDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:unfinishedShipmentDetail:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'wms:unfinishedShipmentMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:unfinishedShipmentMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:unfinishedShipmentMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +142,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:unfinishedShipmentDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:unfinishedShipmentDetail:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:unfinishedShipmentMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:unfinishedShipmentMain:delete'}), //
]
// -
@ -154,7 +163,7 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType,data) => {
var isHave =UnfinishedShipmentDetail.allSchemas.formSchema.some(function (item) {
var isHave =FinishedShipmentMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
@ -166,10 +175,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await UnfinishedShipmentDetailApi.createUnfinishedShipmentDetail(data)
await FinishedShipmentMainApi.createFinishedShipmentMain(data)
message.success(t('common.createSuccess'))
} else {
await UnfinishedShipmentDetailApi.updateUnfinishedShipmentDetail(data)
await FinishedShipmentMainApi.updateFinishedShipmentMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
@ -179,7 +188,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicUnfinishedShipmentDetail')
detailRef.value.openDetail(row, titleName, titleValue, 'basicFinishedShipmentMain')
}
/** 删除按钮操作 */
@ -188,7 +197,7 @@ const handleDelete = async (id: number) => {
//
await message.delConfirm()
//
await UnfinishedShipmentDetailApi.deleteUnfinishedShipmentDetail(id)
await FinishedShipmentMainApi.deleteFinishedShipmentMain(id)
message.success(t('common.delSuccess'))
//
await getList()
@ -203,8 +212,8 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await UnfinishedShipmentDetailApi.exportUnfinishedShipmentDetail(tableObject.params)
download.excel(data, '已发未结发货记录.xlsx')
const data = await FinishedShipmentMainApi.exportFinishedShipmentMain(tableObject.params)
download.excel(data, '已发未结发货记录.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -219,7 +228,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '已发未结发货记录导入模版.xlsx'
templateTitle: '已发未结发货记录导入模版.xlsx'
})
//
const importSuccess = () => {
@ -238,7 +247,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await UnfinishedShipmentDetailApi.importTemplate()
importTemplateData.templateUrl = await FinishedShipmentMainApi.importTemplate()
})
</script>

4
src/views/wms/deliversettlementManage/unfinishedShipmentMain/index.vue → src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/index.vue

@ -67,10 +67,9 @@
<script setup lang="ts">
import download from '@/utils/download'
import { UnfinishedShipmentMain,UnfinishedShipmentMainRules } from './unfinishedShipmentMain.data'
import { UnfinishedShipmentMain,UnfinishedShipmentMainRules,UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from './unfinishedShipmentMain.data'
import * as UnfinishedShipmentMainApi from '@/api/wms/unfinishedShipmentMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from '../unfinishedShipmentDetail/unfinishedShipmentDetail.data'
import * as UnfinishedShipmentDetailApi from '@/api/wms/unfinishedShipmentDetail'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -102,6 +101,7 @@ const updataTableColumns = (val) => {
const { tableObject, tableMethods } = useTable({
getListApi: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage //
})
//

110
src/views/wms/deliversettlementManage/unfinishedShipmentDetail/unfinishedShipmentDetail.data.ts → src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/unfinishedShipmentMain.data.ts

@ -1,6 +1,72 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const UnfinishedShipmentMainRules = reactive({
orderNumber: [required],
shipmentRecordNumber: [required],
shipmentType: [required],
customerOrderNumber: [required],
available: [required],
concurrencyStamp: [required]
})
export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货记录单号',
field: 'shipmentRecordNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货类型',
field: 'shipmentType',
sort: 'custom',
table: {
width: 150,
},
dictType: DICT_TYPE.DELIVER_METHOD,
dictClass: 'string',
form: {
component: 'SelectV2'
}
},
{
label: '客户订单号',
field: 'customerOrderNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const UnfinishedShipmentDetailRules = reactive({
materialCode: [required],
@ -41,7 +107,6 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150,
},
isSearch: true
},
{
label: '物料描述',
@ -50,7 +115,6 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150,
},
isSearch: true,
form: {
component: 'Editor',
componentProps: {
@ -66,21 +130,12 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150,
},
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '销售单价',
field: 'unitPrice',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '锁定数量',
field: 'lockedQuantity',
@ -88,29 +143,19 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150,
},
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '销售单价',
field: 'unitPrice',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '创建时间',
field: 'createTime',
@ -128,7 +173,8 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
isForm: false,
hiddenInMain:true
},
{
label: '创建人',
@ -138,6 +184,8 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
isTable: true,
hiddenInMain:true
},
// {
// label: '操作',

2
src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -914,7 +914,7 @@ export const ExtendColumn = useCrudSchemas(
//表单校验
export const ExtendColumnRules = reactive({
requestNumber: [
fromLocationCode: [
{ required: true, message: '请选择从库位', trigger: 'change' }
],
})

68
src/views/wms/deliversettlementManage/unfinishedShipmentMain/unfinishedShipmentMain.data.ts

@ -1,68 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const UnfinishedShipmentMainRules = reactive({
orderNumber: [required],
shipmentRecordNumber: [required],
shipmentType: [required],
customerOrderNumber: [required],
available: [required],
concurrencyStamp: [required]
})
export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货记录单号',
field: 'shipmentRecordNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货方式',
field: 'shipmentType',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
dictType: DICT_TYPE.DELIVER_METHOD,
dictClass: 'string',
form: {
component: 'SelectV2'
}
},
{
label: '客户订单号',
field: 'customerOrderNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

21
src/views/wms/inventoryManage/balance/index.vue

@ -41,7 +41,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -266,8 +266,20 @@ const handleSelectionPoint = async () => {
})
// window.open(srcPoint.value+'&relateNumber='+rows.join(','))
}
const isShowPointBtn = (row) =>{
 if(row.qty>0){
   return false
 }else{
   return true
 }
}
// -
const butttondata = [
const butttondata = (row) => {
  return [
// {
// label: '',
// name: 'bqxx',
@ -279,10 +291,11 @@ const butttondata = [
// float: 'right',
// hasPermi: ''
// },
defaultButtons.mainListPointBtn(null) //
defaultButtons.mainListPointBtn({hide: isShowPointBtn(row)} ) //
// defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), //
]
  ]
}
// -
const buttonTableClick = async (val, row) => {

156
src/views/wms/inventoryjobManage/packageManage/packagesplitMain/packagesplitMain.data.ts

@ -12,30 +12,30 @@ export const PackagesplitMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 180
},
},
{
label: '仓库代码',
field: 'warehouseCode',
sort: 'custom',
table: {
width: 120
},
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '仓库代码',
// field: 'warehouseCode',
// sort: 'custom',
// table: {
// width: 120
// },
// },
// {
// label: '出库事务类型',
// field: 'outTransactionType',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '入库事务类型',
// field: 'inTransactionType',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '执行时间',
field: 'executeTime',
@ -225,30 +225,30 @@ export const PackagesplitDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 180
},
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库位组代码',
field: 'locationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库区代码',
field: 'areaCode',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '库位代码',
// field: 'locationCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '库位组代码',
// field: 'locationGroupCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '库区代码',
// field: 'areaCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '从包装号',
field: 'fromPackingNumber',
@ -297,28 +297,28 @@ export const PackagesplitDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: '从库存状态',
field: 'fromInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库存状态',
field: 'toInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '从库存状态',
// field: 'fromInventoryStatus',
// dictType: DICT_TYPE.INVENTORY_STATUS,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '到库存状态',
// field: 'toInventoryStatus',
// dictType: DICT_TYPE.INVENTORY_STATUS,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '从器具号',
// field: 'fromContainerNumber',
@ -383,14 +383,14 @@ export const PackagesplitDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '项目代码',
// field: 'projectCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '计量单位',
field: 'uom',

19
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -76,6 +76,9 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
@detailOpenForm="detailOpenForm"
:detailValidate="detailValidate"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false"
/>
<!-- 创建标签 -->
@ -651,6 +654,14 @@ const openForm =async (type: string, row?: number) => {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
}
if (itemColumns.field == 'productionLineCode') {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
}
if (itemColumns.field == 'workStationCode') {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
}
})
} else {
// tableform
@ -658,6 +669,14 @@ const openForm =async (type: string, row?: number) => {
if(itemColumns.field == 'workshopCode') {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
}
if (itemColumns.field == 'productionLineCode') {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
}
if (itemColumns.field == 'workStationCode') {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
}
})
}

6
src/views/wms/moveManage/inventorymove/inventorymoveJobMain/inventorymoveJobMain.data.ts

@ -200,7 +200,7 @@ export const InventorymoveJobMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
isTable: true,
sortTableDefault:6,
sortTableDefault:1000,
},
// {
// label: '自动完成',
@ -474,7 +474,7 @@ export const InventorymoveJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sortTableDefault:20,
},
{
label: '要求截止时间',
label: '截止时间',
field: 'requestDueTime',
formatter: dateFormatter,
detail: {
@ -606,7 +606,7 @@ export const InventorymoveJobMainRules = reactive({
{ required: true, message: '请输入申请时间', trigger: 'change' }
],
requestDueTime: [
{ required: true, message: '请输入要求截止时间', trigger: 'change' }
{ required: true, message: '请输入截止时间', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }

18
src/views/wms/moveManage/inventorymove/inventorymoveRecordMain/inventorymoveRecordMain.data.ts

@ -141,6 +141,8 @@ export const InventorymoveRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
isForm: false,
isTable: false,
isDetail: false,
},
{
label: '从仓库代码',
@ -475,14 +477,14 @@ export const InventorymoveRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: '供应商批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '123',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '从包装号',
field: 'fromPackingNumber',

3
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

@ -362,6 +362,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// newRow['fromPackingNumber'] = item['packingNumber']
newRow['fromContainerNumber'] = item['containerNumber']
newRow['itemCode'] = item['itemCode']
newRow['balanceQty'] = item['qty']
if (item['batch'] != '') {
newRow['fromBatch'] = item['batch']
}
@ -420,6 +421,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
})
}
tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)

17
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts

@ -655,6 +655,23 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
// isTableForm: false,
// isForm: false,
// },
{
label: '库存余额',
field: 'balanceQty',
isTable:false,
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled:true
}
},
tableForm: {
disabled: true
}
},
{
label: '数量',
field: 'qty',

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

@ -1239,7 +1239,7 @@ const print = async () => {
//
// const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const documentSrc = ref(BASE_URL + '/jmreport/view/932556833517789184?token=' + getAccessToken())
const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}

24
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts

@ -26,7 +26,7 @@ export const PurchaseClaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
isForm: false,
table: {
width: 150
width: 180
},
},
{
@ -36,7 +36,7 @@ export const PurchaseClaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
isForm: false,
table: {
width: 150
width: 180
},
},
{
@ -119,7 +119,7 @@ export const PurchaseClaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
table: {
width: 180
width: 200
},
},
{
@ -211,8 +211,6 @@ export const PurchaseClaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
tableForm:{
multiple:false,//多选
@ -291,7 +289,6 @@ export const PurchaseClaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled:true,
@ -307,7 +304,6 @@ export const PurchaseClaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
disabled:true,
@ -321,7 +317,6 @@ export const PurchaseClaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
type: 'InputNumber',
@ -336,24 +331,11 @@ export const PurchaseClaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 5
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
hiddenInMain:true,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))

94
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

@ -80,7 +80,7 @@
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:detailButtonIsShowAddStatusArray="['1','2']"
:detailButtonIsShowAddStatusArray="['1', '2']"
:isChangeDetailDrawer="['2']"
@searchTableSuccessDetail="searchTableSuccessDetail"
@detailOpenForm="detailOpenForm"
@ -154,18 +154,24 @@ const updataTableColumns = (val) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode'){
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
if (formField == 'itemCode') {
let itemCodes = val.filter((item) =>
tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
if (itemCodes.length > 0) {
itemCodes = itemCodes.map((item) => item['itemCode'])
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0){
val = val.filter(
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
if (val.length == 0) {
return
}
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
newVal.forEach(item=>{
let newVal = val.filter(
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
newVal.forEach((item) => {
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk['itemCode'] = item['itemCode']
tfk['itemName'] = item['itemName']
@ -175,7 +181,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
}
}
const setV = {}
if(formField === 'supplierCode'){
if (formField === 'supplierCode') {
setV['supplierCode'] = val[0]['code']
setV['supplierName'] = val[0]['name']
tableData.value = []
@ -194,7 +200,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
if (formField == 'itemCode') {
setV['itemName'] = val[0]['itemName']
setV['uom'] = val[0]['supplierUom']
}
formRef.setValues(setV)
})
@ -277,9 +282,14 @@ const butttondata = (row, $index) => {
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchaseClaimRequest:update'
}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPermi:'wms:purchaseClaimRequest:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchaseClaimRequest:reAdd'}), //
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3']),
hasPermi: 'wms:purchaseClaimRequest:close'
}), //
defaultButtons.mainListReAddBtn({
hide: isShowMainButton(row, ['4', '5']),
hasPermi: 'wms:purchaseClaimRequest:reAdd'
}) //
]
}
@ -291,44 +301,46 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanSub') {
//
handleSub(row.masterId)
}
else if (val == 'mainPlanApp') {
} else if (val == 'mainPlanApp') {
//
handleAgree(row.masterId)
}
else if (val == 'mainPlanTur') {
} else if (val == 'mainPlanTur') {
//
handleReject(row.masterId)
}
else if (val == 'delete') {
} else if (val == 'delete') {
//
handleDelete(row.masterId)
}else if (val == 'mainClose') { //
} else if (val == 'mainClose') {
//
await message.confirm('确认要关闭吗?')
tableObject.loading = true
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId).then(() => {
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
buttonBaseClick('refresh', null)
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
    await message.confirm('确认要重新添加吗?')
    tableObject.loading = true
    PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => {
      message.success(t('common.updateSuccess'))
      tableObject.loading = false
      buttonBaseClick('refresh',null)
    }).catch(err => {
      tableObject.loading = false
      console.log(err)
    })
  }
} else if (val == 'mainReAdd') {
//
await message.confirm('确认要重新添加吗?')
tableObject.loading = true
PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
}
}
/** 提交审批按钮操作 */
const handleSub = async (masterId: number) => {
try {
@ -383,20 +395,19 @@ const handleReject = async (masterId: number) => {
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: any) => {
tableData.value = [] //
if (row?.id) {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = false
item.componentProps.disabled = true
}
})
} else {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = true
item.componentProps.disabled = false
@ -561,7 +572,7 @@ const detailOpenForm = (type, row, masterParmas) => {
}
}
//
const submitFormDetail =async (formType,data) => {
const submitFormDetail = async (formType, data) => {
detailFormRef.value.formLoading = true
try {
if (formType === 'create') {
@ -577,7 +588,6 @@ const submitFormDetail =async (formType,data) => {
} catch {
detailFormRef.value.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {

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

@ -1364,6 +1364,20 @@ export const SupplierinvoiceRecordDetailMain = useCrudSchemas(reactive<CrudSchem
]))
const singlePriceFormart = (row, column, cellValue) => {
cellValue= Number(cellValue).toFixed(5)
cellValue = cellValue + '' || ''
let x = cellValue.split('.')
let x1 = x[0]
let x2 = x.length > 1 ? '.' + x[1] : ''
const reg = /(\d+)(\d{3})/
while(reg.test(x1)){
x1 = x1.replace(reg, '$1,$2')
}
return x1+x2
}
//表单校验
export const SupplierinvoiceRecordMainRules = reactive({
requestNumber: [
@ -1636,6 +1650,26 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
disabled: true
}
},
{
label: '模具分摊单价',
field: 'allocationPrice',
formatter: singlePriceFormart,
table: {
width: 150
},
isForm:false,
form: {
componentProps: {
disabled: true,
precision: 2,
}
},
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 2,
}
},
// {
// label: '未税差额',
// field: 'untaxedDifference',

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

@ -556,6 +556,7 @@ const inputNumberChange = (field, index, row, val) => {
message.error(t('ts.可开票数量范围是')+`:${row.maxInvoicableQuantity}~0`)
}
}
handleAllocationPrice()
}
}
const onChange = (field, cur) => {
@ -603,6 +604,7 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
}
tableData.value.push(newRow)
})
handleAllocationPrice()
} else {
//
console.log(11,val[0][searchField])
@ -626,6 +628,18 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
}
})
}
//
const handleAllocationPrice = async ()=>{
let res = await SupplierinvoiceRequestDetailApi.handleAllocationPrice(tableData.value)
tableData.value.forEach(item=>{
let findItem = res.find(item1=>item1.id == item?.id)
if(findItem){
item['allocationPrice'] = findItem['allocationPrice']
}
})
console.log('模具分摊单价',res)
}
const Echo = []
const { tableObject, tableMethods } = useTable({

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

@ -1918,6 +1918,26 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
precision: 5,
}
},
{
label: '模具分摊单价',
field: 'allocationPrice',
formatter: singlePriceFormart,
table: {
width: 150
},
isForm:false,
form: {
componentProps: {
disabled: true,
precision: 2,
}
},
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 2,
}
},
{
label: '到货数量',
field: 'arrivalQty',

Loading…
Cancel
Save