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. 61
      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-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-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 popoverVisible = ref(false)
const searchOption_high = ref(props.allSchemas?.tableColumns.filter(item => (item.field != "action")))
console.log(searchOption_high.value);
const moreListData = ref({
filters:[]
})
@ -148,7 +149,15 @@ const moreListOptions = ref({
}
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
const formatMoreListActions = (val) => {
if (val) {

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

@ -31,7 +31,8 @@ export const Jobsetting = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
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({
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],
length: [required],
prefixLenght: [required],
entityProperties: [required],
trimEnd: [required],
prefixChar: [
{ 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],
})

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({
labelCode: [
{ required: true, message: '请输入标签代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
labelType: [required],
dataProtocol: [required],
splitMehod: [required],
validateMethod: [required],
templateName: [required],
labelCode: [required],
description: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
dataProtocol: [
{ 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],
isCompress: [required],
})

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

@ -132,7 +132,12 @@
:key="cur.value"
/>
</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-col>
</el-row>
@ -146,7 +151,10 @@
<!-- 检验方式 -->
<el-form-item label="检验方式" class="flex-top">
<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
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)"
@ -292,9 +300,18 @@ const formData = ref({
//
const rules = ref({
strategyCode: [{ 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' }],
strategyCode: [
{ 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' }
],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }]
})
@ -364,14 +381,16 @@ const changeSupplierType = (e) => {
}
getFormSupplierList()
//
function changeInspectType(e){
function changeInspectType(e) {
if (e == 'SAMPLING') {
formData.value.configuration.SampleMethod='QTY'
formData.value.configuration.AqlList=[{
formData.value.configuration.SampleMethod = 'QTY'
formData.value.configuration.AqlList = [
{
FloorQty: 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
if (formData.value.priority == 0) {
Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), //
defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) //
]
} else {
@ -436,21 +455,35 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
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 () => {
//
inputNumberBlur()
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
if(formData.value.priority == 0){
if (formData.value.priority == 0) {
message.error('优先级不可以为0')
return
}
if (hasSameData(formData.value.configuration.AqlList)) {
message.error('抽检规则数据范围重叠,请重新填写')
return
}
//
formLoading.value = true
if(formData.value.configuration.InspectType != 'SAMPLING'){
formData.value.configuration.SampleMethod= ''
formData.value.configuration.AqlList=[]
if (formData.value.configuration.InspectType != 'SAMPLING') {
formData.value.configuration.SampleMethod = ''
formData.value.configuration.AqlList = []
}
try {
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 PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { log } from 'console'
// 退
defineOptions({ name: 'PurchasereturnRequestMain' })
@ -128,6 +129,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['supplierCode'] = val[0]['supplierCode']
row['poNumber'] = val[0]['poNumber']
row['poLine'] = val[0]['poLine']
row['itemCode'] = val[0]['itemCode']
@ -187,7 +189,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// item.fromLocationGroupCode = item.fromLocationGroupCode
})
isShowButton.value = false
console.log('formSchema', PurchasereturnRequestMain.allSchemas.formSchema)
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
@ -486,8 +487,18 @@ const handleDeleteTable = (item, index, formRef) => {
//
const submitForm = async (formType, data) => {
console.log(formType)
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 {
if (formType === 'create') {
await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data)

Loading…
Cancel
Save