Browse Source

采购退货申请bug

master
zhang_li 11 months ago
parent
commit
e7434823e7
  1. 13
      src/components/SearchHigh/src/SearchHigh.vue
  2. 3
      src/views/wms/basicDataManage/documentSetting/jobsetting/jobsetting.data.ts
  3. 27
      src/views/wms/basicDataManage/labelManage/barcode/barcode.data.ts
  4. 46
      src/views/wms/basicDataManage/labelManage/labeltype/labeltype.data.ts
  5. 67
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue
  6. 15
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue

13
src/components/SearchHigh/src/SearchHigh.vue

@ -21,7 +21,7 @@
<!-- 输入框 --> <!-- 输入框 -->
<el-input v-if="getInputType(item.column) == 'input'" v-model="item.value" placeholder="请输入内容" clearable :disabled="item.disabled"/> <el-input v-if="getInputType(item.column) == 'input'" v-model="item.value" placeholder="请输入内容" clearable :disabled="item.disabled"/>
<!-- 数字输入框 --> <!-- 数字输入框 -->
<el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="6" :disabled="item.disabled"/> <el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="getInputPrecision(item.column)" :disabled="item.disabled"/>
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" placeholder="请选择内容" :filterable="true" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action"> <el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" placeholder="请选择内容" :filterable="true" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action">
<el-option v-for="dict in initSelectOptions(item.column)" :key="dict.value" :label="dict.label" <el-option v-for="dict in initSelectOptions(item.column)" :key="dict.value" :label="dict.label"
@ -79,6 +79,7 @@ const message = useMessage() // 消息弹窗
const route = useRoute() // const route = useRoute() //
const popoverVisible = ref(false) const popoverVisible = ref(false)
const searchOption_high = ref(props.allSchemas?.tableColumns.filter(item => (item.field != "action"))) const searchOption_high = ref(props.allSchemas?.tableColumns.filter(item => (item.field != "action")))
console.log(searchOption_high.value);
const moreListData = ref({ const moreListData = ref({
filters:[] filters:[]
}) })
@ -148,7 +149,15 @@ const moreListOptions = ref({
} }
return data return data
} }
//
const getInputPrecision = (val) => {
const type = searchOption_high.value.find(item => (item.field == val))
let precision = 6
if (type?.form?.component == 'InputNumber') {
precision = type?.form?.componentProps?.precision || type?.form?.componentProps?.precision == 0 ? type.form.componentProps.precision : 6
}
return precision
}
// ==,!=,>,<,>=,<=,like,in,notIn,betweeen,isNull,isNotNull // ==,!=,>,<,>=,<=,like,in,notIn,betweeen,isNull,isNotNull
const formatMoreListActions = (val) => { const formatMoreListActions = (val) => {
if (val) { if (val) {

3
src/views/wms/basicDataManage/documentSetting/jobsetting/jobsetting.data.ts

@ -31,7 +31,8 @@ export const Jobsetting = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0 min: 0,
precision:0
} }
}, },
}, },

27
src/views/wms/basicDataManage/labelManage/barcode/barcode.data.ts

@ -2,12 +2,33 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验 // 表单校验
export const BarcodeRules = reactive({ export const BarcodeRules = reactive({
code: [required], code: [
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
description: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
order: [required], order: [required],
length: [required], length: [required],
prefixLenght: [required], prefixLenght: [required],
entityProperties: [required], prefixChar: [
trimEnd: [required], { max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
entityProperties: [
{ required: true, message: '请输入实体属性', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
encyptMethod: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
trimEnd: [
{ required: true, message: '请输入截断尾部空格', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
isEncypt: [required], isEncypt: [required],
}) })

46
src/views/wms/basicDataManage/labelManage/labeltype/labeltype.data.ts

@ -2,12 +2,48 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验 // 表单校验
export const LabeltypeRules = reactive({ export const LabeltypeRules = reactive({
labelCode: [
{ required: true, message: '请输入标签代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
labelType: [required], labelType: [required],
dataProtocol: [required], description: [
splitMehod: [required], { max: 50, message: '不得超过50个字符', trigger: 'blur' }
validateMethod: [required], ],
templateName: [required], dataProtocol: [
labelCode: [required], { required: true, message: '请输入数据协议', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
splitMehod: [
{ required: true, message: '请输入拆分方法', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
header: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
version: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
separators: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
validateMethod: [
{ required: true, message: '请输入校验方法', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
encyptEthod: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
compressMethod: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
templateName: [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
templateFile: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
isEncypt: [required], isEncypt: [required],
isCompress: [required], isCompress: [required],
}) })

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

@ -132,7 +132,12 @@
:key="cur.value" :key="cur.value"
/> />
</el-select> </el-select>
<el-input v-model="item.Value" placeholder="请输入物品,多个物品以逗号分隔" clearable style="flex: 1" /> <el-input
v-model="item.Value"
placeholder="请输入物品,多个物品以逗号分隔"
clearable
style="flex: 1"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -146,7 +151,10 @@
<!-- 检验方式 --> <!-- 检验方式 -->
<el-form-item label="检验方式" class="flex-top"> <el-form-item label="检验方式" class="flex-top">
<div class="checkbox"> <div class="checkbox">
<el-radio-group v-model="formData.configuration.InspectType" @change="changeInspectType"> <el-radio-group
v-model="formData.configuration.InspectType"
@change="changeInspectType"
>
<el-radio <el-radio
:label="cur.value" :label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)" v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)"
@ -292,9 +300,18 @@ const formData = ref({
// //
const rules = ref({ const rules = ref({
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], strategyCode: [
name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], { required: true, message: '请输入代码', trigger: 'blur' },
description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', 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' }
],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }] configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }]
}) })
@ -364,14 +381,16 @@ const changeSupplierType = (e) => {
} }
getFormSupplierList() getFormSupplierList()
// //
function changeInspectType(e){ function changeInspectType(e) {
if (e == 'SAMPLING') { if (e == 'SAMPLING') {
formData.value.configuration.SampleMethod='QTY' formData.value.configuration.SampleMethod = 'QTY'
formData.value.configuration.AqlList=[{ formData.value.configuration.AqlList = [
FloorQty: 1, {
CeilingQty: 2, FloorQty: 1,
SampleValue: 1 CeilingQty: 2,
}] SampleValue: 1
}
]
} }
} }
// //
@ -404,7 +423,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) { if (formData.value.priority == 0) {
Butttondata.value = [ Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), // defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
} else { } else {
@ -436,21 +455,35 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const hasSameData = (array) => {
for (let k = 0; k < array.length; k++) {
for (let n = k + 1; n < array.length; n++) {
if(array[k].FloorQty <= array[n].FloorQty && array[n].FloorQty<=array[k].CeilingQty){
return true
}
}
}
return false
}
const submitForm = async () => { const submitForm = async () => {
// //
inputNumberBlur() inputNumberBlur()
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
if (!valid) return if (!valid) return
if(formData.value.priority == 0){ if (formData.value.priority == 0) {
message.error('优先级不可以为0') message.error('优先级不可以为0')
return return
} }
if (hasSameData(formData.value.configuration.AqlList)) {
message.error('抽检规则数据范围重叠,请重新填写')
return
}
// //
formLoading.value = true formLoading.value = true
if(formData.value.configuration.InspectType != 'SAMPLING'){ if (formData.value.configuration.InspectType != 'SAMPLING') {
formData.value.configuration.SampleMethod= '' formData.value.configuration.SampleMethod = ''
formData.value.configuration.AqlList=[] formData.value.configuration.AqlList = []
} }
try { try {
let data = { let data = {

15
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue

@ -103,6 +103,7 @@ import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMa
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { log } from 'console'
// 退 // 退
defineOptions({ name: 'PurchasereturnRequestMain' }) defineOptions({ name: 'PurchasereturnRequestMain' })
@ -128,6 +129,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['supplierCode'] = val[0]['supplierCode']
row['poNumber'] = val[0]['poNumber'] row['poNumber'] = val[0]['poNumber']
row['poLine'] = val[0]['poLine'] row['poLine'] = val[0]['poLine']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
@ -187,7 +189,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// item.fromLocationGroupCode = item.fromLocationGroupCode // item.fromLocationGroupCode = item.fromLocationGroupCode
}) })
isShowButton.value = false isShowButton.value = false
console.log('formSchema', PurchasereturnRequestMain.allSchemas.formSchema)
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') { if (item.field == 'supplierCode') {
@ -486,8 +487,18 @@ const handleDeleteTable = (item, index, formRef) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
console.log(formType)
data.subList = tableData.value // data.subList = tableData.value //
let array =[]
data.subList.forEach((item,index) => {
if(item.supplierCode != data.supplierCode){
array.push(index+1)
}
})
if (array.length>0) {
formRef.value.formLoading = false
message.error(`${array.join(',')}行数据的供应商代码与上方填写的供应商代码不一致`)
return
}
try { try {
if (formType === 'create') { if (formType === 'create') {
await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data) await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data)

Loading…
Cancel
Save