Browse Source

采购收货管理--供应商发货---采购订单---新增--添加明细--多选功能

master_hella_20240701
yufei0306 8 months ago
parent
commit
863f0561ab
  1. 8
      src/components/BasicForm/src/BasicForm.vue
  2. 40
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue
  3. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts

8
src/components/BasicForm/src/BasicForm.vue

@ -266,6 +266,12 @@ const props = defineProps({
required: false,
default: false
},
// TableForm
indexTableColumn :{
type: Number,
required: false,
default: 0
}
})
const { t } = useI18n() //
@ -576,7 +582,7 @@ const handleAddTable = () => {
tableAllSchemas.value.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
inpuFocus(tableAllSchemas.value.tableFormColumns[0],tableFormKeys,0)
inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0)
}else{
emit('handleAddTable')
}

40
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -28,6 +28,8 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef"
@success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="PurchaseMainRules"
:formAllSchemas="PurchaseMain.allSchemas"
:tableAllSchemas="PurchaseDetail.allSchemas"
@ -96,25 +98,33 @@
if (type == 'tableForm') {
//
if(formField == 'itemCode'){
let subList = tableData.value
let flag = false;
if(subList.length > 0){
subList.forEach((item) => {
if(item.itemCode == val[0]['itemCode']){
flag = true;
const repeatCode = [] //
if(tableData.value.length > 0){
tableData.value.forEach((item) => {
const findIndex = val.findIndex(valItem=>valItem['itemCode']==item.itemCode)
if(findIndex > -1){
val.splice(findIndex,1)
repeatCode.push(item.itemCode)
}
})
}
if(flag){
message.warning("物料代码已经存在");
return;
if(repeatCode.length>0){
message.warning(`物料代码${repeatCode.join(',')}已经存在`);
}
row[formField] = val[0][searchField]
await ItembasicApi.getItembasicPage({
code: row['itemCode']
}).then(res => {
row['uom'] = res.list[0].uom
})
if(val.length>0){
val.forEach(item=>{
const newRow = {...row}
newRow[formField] = item[searchField]
tableData.value.push(newRow)
})
const itemCodes = val.map(valItem=>valItem['itemCode'])
await ItembasicApi.getItembasicPage({
code: itemCodes.join(',')
}).then(res => {
row['uom'] = res.list[0].uom
})
}
}
} else {
const setV = {}

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

@ -400,6 +400,7 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
tableForm:{
multiple:true,//多选
isInpuFocusShow: true,
searchListPlaceholder: '请选择供应商物料',
searchField: 'itemCode',

Loading…
Cancel
Save