Browse Source

修改调拨列表数据选择

dev
caoyizhong 2 years ago
parent
commit
d730978bde
  1. 27
      src/components/jeecg/CEditableTable.vue
  2. 49
      src/components/jeecg/PEditableTable.vue
  3. 151
      src/views/activiti/form/ProcessMaterialsAllotForm.vue
  4. 56
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

27
src/components/jeecg/CEditableTable.vue

@ -701,6 +701,16 @@
type: Boolean,
default: false
},
//
verify: {
type: Number,
default: false
},
// l
verifyType: {
type: String,
default: false
},
//
dragSort: {
type: Boolean,
@ -788,7 +798,8 @@
number:0,
url:{
descriptionRakeUrl: "/description/processDescription/list",
merchandiseNewsList: '/wastematerials/processWasteMaterials/merchandiseNewsName',
merchandiseNewsListZW: '/wastematerials/processWasteMaterials/merchandiseNewsName', //
merchandiseNewsListZK: '/suppliesstronger/processSuppliesStronger/merchandiseNews', //
}
}
},
@ -2688,9 +2699,19 @@
let res = JSON.parse(ue)
let par = {
departId: res.departIds,
accountingAttributes: this.verifyType,
materialsNumber: input
}
await getAction(this.url.merchandiseNewsList,par).then( (res)=>{
let urls = '' ;
if(this.verify !== 1){
urls = this.url.merchandiseNewsListZW;
console.log("账外")
}else{
urls = this.url.merchandiseNewsListZK;
console.log("总库")
}
await getAction(urls,par).then( (res)=>{
// getAction(this.url.descriptionRake,par).then((res)=>{
let a= [];
if(res.success){
@ -2723,8 +2744,8 @@
})
})
this.columns[index].options = a
resolve( );
}
resolve( );
});
// await getAction(this.url.merchandiseNewsList,par).then( (res)=>{

49
src/components/jeecg/PEditableTable.vue

@ -701,6 +701,10 @@
type: Boolean,
default: false
},
//
appropriationPlan: {
type: String
},
//
dragSort: {
type: Boolean,
@ -789,6 +793,7 @@
url:{
descriptionRakeUrl: "/description/processDescription/list",
merchandiseNewsList: '/merchandisenews/processMerchandiseNews/merchandiseNewsList',
merchandiseNewsListDB: '/wastematerials/processWasteMaterials/merchandiseNewsName',
}
}
},
@ -2685,41 +2690,37 @@
// console.log("searchOption=========",input,pro,index);
return new Promise(async (resolve, reject) => {
let par = {
materialsNumber: input
}
await getAction(this.url.merchandiseNewsList,par).then( (res)=>{
let url = '' ;
if(!this.appropriationPlan){
//
url = this.url.merchandiseNewsList;
}else{
//
url = this.url.merchandiseNewsListDB;
par.departId= this.appropriationPlan;
}
await getAction(url,par).then( (res)=>{
// getAction(this.url.descriptionRake,par).then((res)=>{
let a= [];
if(res.success){
// console.log("222222222222222===",res.result);
console.log("222222222222222===",res.result);
let pam = res.result.records||res.result;
pam.forEach( item => {
pam.forEach( item => {
let isb = false;
// this.getValues((a, b, c) => {
// console.log("bbbbbbbbbbbbbb",b.materialNumber)
// if(!!b.materialNumber){
// console.log("bbbbbbbbbbbbbb",b)
// b.forEach(item => {
// if (item.materialNumber === item.id) {
// isb = true;
// }
// })
// }
//
//
// })
let val = '';
if(!this.appropriationPlan){
val = item.id
}else{
val = item.merchandiseNewsId
}
a.push({
title : item.materialsNumber,
value : item.id,
value : val,
disabled: isb
})
})
})
this.columns[index].options = a
}
resolve( );

151
src/views/activiti/form/ProcessMaterialsAllotForm.vue

@ -75,9 +75,10 @@
:isabled="isabled"
:rowNumber="true"
:rowSelection="true"
:appropriationPlan ="this.libraryInvisible"
:actionButton="!task"
@valueChange="onSelect"
@descriptionFetch="descriptionFetchData"
@descriptionFetch="fetchMerchandiseNews"
/>
</a-tab-pane>
</a-tabs>
@ -175,7 +176,7 @@
dictCode: '',
width: '200px',
placeholder: '请输入${title}',
disabled: this.disabled,
disabled: true,
options: []
// props:{title: 'show title'}
// scopedSlots: { customRender: 'edit' },//
@ -420,58 +421,89 @@
// console.log(record)
// console.log("keykey",record.column.key)
let isDB = true
if (!!record.row.materialGroup) {
if (this.issh){
return;
}
if (!!record.row.id && this.materialGroupId !== record.row.materialGroup && record.column.key !== "allotNumber" ) {
// console.log("record.row.materialGroup")
await this.fetchMerchandiseNews(record.row.materialGroup, 1)
let value = [
{
rowKey: record.row.id,
values: {
'equipment': '',
'materialGroup': record.row.materialGroup,
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
// 'number': '',
'allotNumber': '',
'materialAmount': ''
}
// if (!!record.row.materialGroup) {
// if (this.issh){
// return;
// }
// if (!!record.row.id && this.materialGroupId !== record.row.materialGroup && record.column.key !== "allotNumber" ) {
// // console.log("record.row.materialGroup")
// await this.fetchMerchandiseNews(record.row.materialGroup, 1)
// let value = [
// {
// rowKey: record.row.id,
// values: {
// 'equipment': '',
// 'materialGroup': record.row.materialGroup,
// 'materialName': '',
// 'materialUnit': '',
// 'supplierId': '',
// 'materialPrice': '',
// // 'number': '',
// 'allotNumber': '',
// 'materialAmount': ''
// }
// }
// ]
// this.$nextTick(() => {
// this.$refs.processMaterialsAllotList.setValues(value)
// })
// this.materialGroupId = record.row.materialGroup
// isDB = false
// }
//
// }
if (!!record.row.equipment && !record.row.allotNumber && isDB && this.materialGroupId !== record.row.materialGroup) {
console.log("执行materialNumber")
await this.$refs.processMaterialsAllotList.getValues((a, b, c) => {
// console.log("bbbbbbbbbbbbbb",b)
b.forEach(item => {
if (item.equipment === record.row.equipment && !!item.materialGroup && !record.row.materialGroup) {
let values = [
{
rowKey: record.row.id,
values: {
'equipment': record.row.equipment,
'materialGroup': '',
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
'allotNumber': '',
'materialAmount': ''
}
}
]
// console.log("sadf1111")
this.$refs.processMaterialsAllotList.setValues(values)
return ;
}
]
this.$nextTick(() => {
this.$refs.processMaterialsAllotList.setValues(value)
})
this.materialGroupId = record.row.materialGroup
isDB = false
}
}
if ( !!record.row.materialGroup && record.row.equipment !== '' && record.row.allotNumber === '' && isDB) {
// console.log("materialNumber")
})
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
if (item.merchandiseNewsId === record.row.equipment) {
materialName = {
name: item.merchandiseName,
unit: item.materialsUnit,
materialGroup: item.materialClassify,
supplierName: item.supplierId,
price: item.materialPrice
// number : item.residueNumber === undefined ? 0 : item.residueNumber,
}
}
})
console.log("materialName",materialName);
if(Object.keys(materialName).length > 0){
let values = [
{
rowKey: record.row.id,
values: {
'equipment': record.row.equipment,
'materialGroup': record.row.materialGroup,
'materialGroup': materialName.materialGroup,
'materialName': materialName.name,
'materialUnit': materialName.unit,
'supplierId': materialName.supplierName,
@ -536,8 +568,6 @@
return new Promise((resolve, reject) => {
//
let par = {
delFlag: 0,
descriptionId: value,
departId: this.libraryInvisible
}
this.bigIdMerchandiseNewsList = []
@ -594,37 +624,41 @@
})
},
descriptionFetchData(value) { //
descriptionFetchData(type,value) { //
//
let par = {
delFlag: 0,
accountingAttributes: value
// departId: this.data.departId
}
getAction(this.url.descriptionRake, par).then((res) => {
if (res.success) {
if (this.processMaterialsAllotListTable.columns[0].options.length > 0) {
this.processMaterialsAllotListTable.columns[0].options = []
}
res.result.forEach(item => {
this.processMaterialsAllotListTable.columns[0].options.push({
title: item.materialClassify,
value: item.descriptionId
})
})
}
})
// let par = {
// delFlag: 0,
// accountingAttributes: value
// // departId: this.data.departId
// }
// getAction(this.url.descriptionRake, par).then((res) => {
// if (res.success) {
//
// if (this.processMaterialsAllotListTable.columns[0].options.length > 0) {
// this.processMaterialsAllotListTable.columns[0].options = []
// }
// res.result.forEach(item => {
// this.processMaterialsAllotListTable.columns[0].options.push({
// title: item.materialClassify,
// value: item.descriptionId
// })
// })
// }
// })
getAction(this.url.unitWasteNameUrl, null).then((res) => {
if (res.success) {
if (this.processMaterialsAllotListTable.columns[6].options.length > 0) {
this.processMaterialsAllotListTable.columns[6].options = []
}
res.result.forEach(item => {
let is= false;
if(item.unit === value){
is = true;
}
this.processMaterialsAllotListTable.columns[6].options.push({
title: item.departName,
value: item.unit
value: item.unit,
disabled : is
})
})
}
@ -638,7 +672,8 @@
this.materialTypeRecord = val;
if (!!val && !!this.libraryInvisible ) {
this.heid = false
this.descriptionFetchData(val,this.libraryInvisible)
// this.descriptionFetchData(val,this.libraryInvisible)
this.fetchMerchandiseNews()
}
},
/*回显数据*/

56
src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

@ -78,6 +78,8 @@
:dataSource="processMaterialsDeliveryListTable.dataSource"
:maxHeight="300"
:disabled="this.hiegs"
:verify="this.deliveryType"
:verify-type="this.accountingAttributesVal"
@valueChange="onSelect"
:rowNumber="true"
:rowSelection="true"
@ -354,6 +356,7 @@
processPlan: { rules: [{ required: true, message: '请选择流程计划!' }] }
},
materialGroupId: undefined,
accountingAttributesVal: '',
hiegs:true,
}
},
@ -456,35 +459,35 @@
this.materialGroupId = undefined
// this.fetchData(this.accountingAttributesVal);
// this.fetchMerchandiseNews();
if (this.accountingAttributesVal === "1" ) {
console.log("执行账外")
if (this.deliveryType !== 1 ) {
// console.log("")
//
await this.fetchMerchandiseNewsZW()
} else {
console.log("执行总库")
// console.log("")
//
await this.fetchMerchandiseNews()
}
},
//
isMaterialType(val) {
async isMaterialType(val) {
if (val !== undefined) {
this.accountingAttributesVal = val
this.hiegs = false
// if (val === "1" ) {
// console.log("")
// //
// await this.fetchMerchandiseNewsZW()
// } else {
// console.log("")
// //
// await this.fetchMerchandiseNews()
// }
if (this.deliveryType !== 1 ) {
console.log("执行账外")
//
await this.fetchMerchandiseNewsZW()
} else {
// console.log("")
//
await this.fetchMerchandiseNews()
}
}
},
async onSelect(record) {
console.log(record)
// console.log(record)
let isMA = true;
// if (!!record.row.materialGroup && !!record.row.materialGroup ) {
// // console.log("materialGroup111")
@ -535,18 +538,16 @@
// console.log("materialNumber")
if(!b){
if (this.accountingAttributesVal === "1" ) {
console.log("执行账外")
//
await this.fetchMerchandiseNewsZW(record.row.equipment)
} else {
console.log("执行总库")
//
await this.fetchMerchandiseNews()
await this.fetchMerchandiseNews(record.row.equipment)
}
}
await this.$refs.processMaterialsDeliveryList.getValues((a, b, c) => {
console.log("bbbbbbbbbbbbbb",b)
// console.log("bbbbbbbbbbbbbb",b)
b.forEach(item => {
if (item.equipment === record.row.equipment && !!item.materialGroup && !record.row.materialGroup) {
let values = [
@ -578,7 +579,6 @@
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
console.log(item)
if (item.merchandiseNewsId === record.row.equipment) {
materialName = {
name: item.merchandiseName,
@ -612,7 +612,7 @@
this.$refs.processMaterialsDeliveryList.setValues(values)
}else{
// console.log("this.data.materialType",this.data.materialType)
if (parseInt(this.data.materialType) === 1) {
if (parseInt(this.deliveryType) !== 1) {
//
await this.getEquipmentInvisible(record.row.equipment);
eAll = 2;
@ -739,6 +739,7 @@
let par = {
delFlag: 0,
accountingAttributes: this.accountingAttributesVal,
merchandiseNewsId:value
}
this.bigIdMerchandiseNewsList = []
let qc = []
@ -747,7 +748,7 @@
this.processMaterialsDeliveryListTable.columns[1].options = []
}
this.$refs.processMaterialsDeliveryList.getValues((a, b, c) => {
console.log(a, b, c)
// console.log(a, b, c)
b.forEach(item => {
if (item.equipment !== '' && item.equipment !== undefined && item.equipment !== null) {
numberList.push(item.equipment)
@ -756,7 +757,7 @@
})
getAction(this.url.merchandiseNewsList, par).then((res) => {
if (res.success) {
console.log(res.result)
// console.log(res.result)
let newList = res.result
// console.log('12312312:' + numberList.length)
if (numberList.length > 0) {
@ -769,10 +770,10 @@
})
numberList.forEach(num => {
qc.forEach(i => {
console.log(num)
console.log(i.value)
// console.log(num)
// console.log(i.value)
if (num === i.value) {
console.log(num, i.value)
// console.log(num, i.value)
i.disabled = true
}
})
@ -802,7 +803,8 @@
//
let par = {
delFlag: 0,
merchandiseNewsId: value
merchandiseNewsId: value,
accountingAttributes: this.accountingAttributesVal,
}
let ue = sessionStorage.getItem('USER_INFORMATION')
let res = JSON.parse(ue)
@ -819,7 +821,7 @@
this.processMaterialsDeliveryListTable.columns[1].options = []
}
this.$refs.processMaterialsDeliveryList.getValues((a, b, c) => {
console.log(a, b, c)
// console.log(a, b, c)
b.forEach(item => {
if (item.equipment !== '' && item.equipment !== undefined && item.equipment !== null) {
numberList.push(item.equipment)

Loading…
Cancel
Save