Browse Source

修改入库数据加载

dev
caoyizhong 2 years ago
parent
commit
b2b4329d01
  1. 16
      src/components/jeecg/HPlan.vue
  2. 86
      src/views/activiti/form/ProcessMaterialWarehousingForm.vue
  3. 2
      src/views/activiti/form/ProcessUdgetPlanForm.vue

16
src/components/jeecg/HPlan.vue

@ -115,7 +115,7 @@
value: {
immediate: true,
handler: function(val) {
console.log(val,'4444444444444444444')
// console.log(val,'4444444444444444444')
if (!val) {
this.showText = ''
} else {
@ -145,7 +145,7 @@
showTextVal(){
getAction("/hy/processUdgetPlan/queryById", {id:this.showText}).then((res) => {
if (res.success) {
console.log(res.result)
// console.log(res.result)
let params={}
params.ids=[];
params.vals=[];
@ -213,7 +213,7 @@
if(!val){
val = ""
}
console.log(val,"这是什么鬼")
// console.log(val,"")
tempDestArr.push(val)
}
res[destFieldsArr[i]] = tempDestArr.join(",")
@ -224,7 +224,7 @@
params.ids=[];
params.vals=[];
for(let rw of rows){
console.log(rw,"11111111111111111111")
// console.log(rw,"11111111111111111111")
if(!rw){
rw = ""
}
@ -232,10 +232,10 @@
params.vals.push(rw.warehousingBatch)
}
params.vals=params.vals.join(",")
console.log(params,"*-*-*-*-*-*-*-")
// console.log(params,"*-*-*-*-*-*-*-")
this.showText = params
}else {
console.log("222222222222222222")
// console.log("222222222222222222")
this.showText =rows[0].id
}
// update--end--autor:lvdandan-----date:20200630------for------
@ -245,11 +245,11 @@
this.$emit('callback', rows[0].id)
this.$emit('mounted', rows)
this.$emit('callType', rows[0])
console.log(rows,"选中的数据-----")
// console.log(rows,"-----")
} else {
//v-model field
// this.$emit("input",row[orgFieldsArr[destFieldsArr.indexOf(this.field)]])
console.log(rows,"选中的数据")
// console.log(rows,"")
this.$emit('input', this.showText, rows[0])
this.$emit('mounted', rows)
this.$emit('callType', rows[0])

86
src/views/activiti/form/ProcessMaterialWarehousingForm.vue

@ -383,6 +383,18 @@ import JSelectItem from '@/components/jeecgbiz/JSelectItem'
this.popupCallback(company, userInfo, puwwcid)
}
},
watch:{
'processMaterialWarehousingListTable.dataSource': { //
handler(nv) {
// console.log(nv)
if(nv.length>0){
this.echoStorage(nv);
}
},
immediate: true,
deep: true
}
},
methods: {
//tab
onSelect(record){
@ -559,7 +571,7 @@ import JSelectItem from '@/components/jeecgbiz/JSelectItem'
//1
this.data = getRecord(this.data)
}
console.log(this.data,'回显表单数据')
// console.log(this.data,'')
let fieldval = pick(this.data, 'id', 'company', 'createTime', 'departId', 'createBy', 'processUdgetPlanId', 'materialType', 'targetLibrary', 'warehousingBatch', 'fileId','opinion')
this.$nextTick(() => {
this.form.setFieldsValue(fieldval)
@ -570,6 +582,54 @@ import JSelectItem from '@/components/jeecgbiz/JSelectItem'
this.requestSubTableData(this.url.processMaterialWarehousingList.list, params, this.processMaterialWarehousingListTable)
}
},
/** 查询某个tab的数据 */
requestSubTableData(url, params, tab, success) {
// tab.loading = true
getAction(url, params).then(res => {
let { result } = res
let dataSource = []
if (result) {
if (Array.isArray(result)) {
dataSource = result
} else if (Array.isArray(result.records)) {
dataSource = result.records
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
}).finally(() => {
// tab.loading = false
})
},
async echoStorage(nv){
this.processMaterialWarehousingListTable.loading = true;
for (const item of nv) {
let par = { id : item.materialGroup,}
let param = {id : item.materialNumber,}
await getAction(this.url.queryByIdDescription,par).then( res=>{
// console.log(res);
if(res.success){
this.processMaterialWarehousingListTable.columns[0].options= [{
title : res.result.materialClassify,
value : item.materialGroup,
disabled : true }];
}
})
await getAction(this.url.queryByIdMerchandiseNews,param).then( res=>{
// console.log(res);
if(res.success){
this.processMaterialWarehousingListTable.columns[1].options= [{
title : res.result.materialsNumber,
value : item.materialNumber,
disabled : true }];
}
})
}
this.processMaterialWarehousingListTable.loading = false;
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let main = Object.assign(this.model, allValues.formValue)
@ -597,30 +657,6 @@ import JSelectItem from '@/components/jeecgbiz/JSelectItem'
}
}
this.processUdgetPlanIds=ids.join(",");
this.processMaterialWarehousingListTable.dataSource.forEach(item =>{
let par = { id : item.materialGroup,}
let param = {id : item.materialNumber,}
getAction(this.url.queryByIdDescription,par).then( res=>{
// console.log(res);
if(res.success){
this.processMaterialWarehousingListTable.columns[0].options= [{
title : res.result.materialClassify,
value : item.materialGroup,
disabled : true }];
}
})
getAction(this.url.queryByIdMerchandiseNews,param).then( res=>{
// console.log(res);
if(res.success){
this.processMaterialWarehousingListTable.columns[1].options= [{
title : res.result.materialsNumber,
value : item.materialNumber,
disabled : true }];
}
})
})
},
validateError(msg) {
this.$message.error(msg)

2
src/views/activiti/form/ProcessUdgetPlanForm.vue

@ -856,7 +856,7 @@
}
})
if (!!record.row.id) {
if (!!record.row.id && Object.keys(materialName).length > 0 ) {
await this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
// console.log("bbbbbbbbbbbbbb",b)
b.forEach(item => {

Loading…
Cancel
Save