Browse Source

要货计划根据生产日期与物料有效期计算出失效时间

master_hella_20240701
chenfang 8 months ago
parent
commit
efb472b173
  1. 8
      src/utils/formatTime.ts
  2. 6
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  3. 1
      src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts
  4. 11
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

8
src/utils/formatTime.ts

@ -23,6 +23,14 @@ export function formatDate(date: Date | number, format?: string): string {
return dayjs(date).format(format) return dayjs(date).format(format)
} }
/**
* +
*/
export function addDay(date: Date | number,addDay:number) {
return dayjs(date).add(addDay,'day')
}
/** /**
* + * +
*/ */

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

@ -237,7 +237,7 @@
<el-input v-model="formData.configuration.Receiver" placeholder="请输入收货人名称" clearable /> <el-input v-model="formData.configuration.Receiver" placeholder="请输入收货人名称" clearable />
</el-form-item> </el-form-item>
<!-- 在途库位 --> <!-- 在途库位 -->
<el-form-item label="联系电话" prop="PhoneNumber"> <el-form-item label="联系电话" prop="configuration.PhoneNumber">
<el-input v-model="formData.configuration.PhoneNumber" placeholder="请输入联系电话" clearable /> <el-input v-model="formData.configuration.PhoneNumber" placeholder="请输入联系电话" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -314,8 +314,8 @@ const rules = ref({
name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
PhoneNumber: [{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, 'configuration.PhoneNumber': [{ max: 11, message: '不得超过11个字符', trigger: 'blur' },
{message: '请输入联系电话', trigger: 'blur' ,validator:validateHanset}] {message: '请输入正确格式的电话', trigger: 'blur' ,validator:validateHanset}]
}) })
// //

1
src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts

@ -300,6 +300,7 @@ export const SupplierRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],
email: [ email: [
{ required: true, message: '请输入邮箱', trigger: 'blur' },
{ max: 128, message: '不得超过128个字符', trigger: 'blur' }, { max: 128, message: '不得超过128个字符', trigger: 'blur' },
{ validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'} { validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'}
], ],

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

@ -116,7 +116,8 @@ import {
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime' import { formatDate,addDay } from '@/utils/formatTime'
import * as itemBasicApi from '@/api/wms/itembasic'
// //
defineOptions({ name: 'SupplierdeliverRequestMain' }) defineOptions({ name: 'SupplierdeliverRequestMain' })
@ -148,6 +149,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
row['poLine'] = val[0]['poLine'] row['poLine'] = val[0]['poLine']
row['orderQty'] = val[0]['orderQty'] row['orderQty'] = val[0]['orderQty']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
itemBasicApi.getItembasicPage({
code: val[0]['itemCode']
}).then((res) => {
let cf = addDay(row['produceDate'],res.list[0].validityDays);
row['expireDate'] = cf;
}).catch((err) => {
console.log(err)
})
} }
} else { } else {
const setV = {} const setV = {}

Loading…
Cancel
Save