diff --git a/src/components/jeecg/JEditableTable.vue b/src/components/jeecg/JEditableTable.vue index 8be7b1e..8b6f9ba 100644 --- a/src/components/jeecg/JEditableTable.vue +++ b/src/components/jeecg/JEditableTable.vue @@ -534,7 +534,7 @@ :placeholder="replaceProps(col, col.placeholder)" @change="(v)=>handleSearchSelectChange(v,id,row,col)" allowClear - /> + /> = 0) return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, getEllipsisWord(content, len){ @@ -2644,12 +2651,14 @@ /** 获取Select等组件翻译后的文本 */ getSelectTranslateText(value, row, col) { + // console.log("getSelectTranslateText====================") // 翻译支持单选和多选(数组、逗号分割) return filterDictText(col.options, value) }, // 判定当前行是否是正在编辑的 isEditRow(row, col) { + // console.log("isEditRow=======================") if (this.alwaysEdit) { return true } diff --git a/src/components/jeecg/PEditableTable.vue b/src/components/jeecg/PEditableTable.vue new file mode 100644 index 0000000..4cbea60 --- /dev/null +++ b/src/components/jeecg/PEditableTable.vue @@ -0,0 +1,3142 @@ + + + + + + + + diff --git a/src/components/jeecg/index.js b/src/components/jeecg/index.js index 8f68049..5a39bad 100644 --- a/src/components/jeecg/index.js +++ b/src/components/jeecg/index.js @@ -31,7 +31,7 @@ import JSlider from './JSlider.vue' import JSwitch from './JSwitch.vue' import JTime from './JTime.vue' import JTreeTable from './JTreeTable.vue' - +import PEditableTable from './PEditableTable' export default { install(Vue) { Vue.component('JMarkdownEditor', JMarkdownEditor) @@ -67,5 +67,6 @@ export default { Vue.component('JTreeTable', JTreeTable) Vue.component('JUpload', JUpload) Vue.component('FileList', FileList) + Vue.component('PEditableTable',PEditableTable) } } \ No newline at end of file diff --git a/src/views/activiti/form/ProcessUdgetPlanForm.vue b/src/views/activiti/form/ProcessUdgetPlanForm.vue index 92cb615..3373761 100644 --- a/src/views/activiti/form/ProcessUdgetPlanForm.vue +++ b/src/views/activiti/form/ProcessUdgetPlanForm.vue @@ -64,7 +64,7 @@ - - + :actionButton="true" + @descriptionFetch="descriptionFetchDatas" + > + + + + + + + + + + - + @@ -186,11 +188,11 @@ key: 'materialGroup', // type: FormTypes.slot, // <-------------改为 slot 格式 // slotName: 'actions', // <-------------slot 的名称,对应 v-slot 冒号后面和等号前面的内容 - type: FormTypes.slot, - // type: FormTypes.sel_search, - slotName: 'group', + // type: FormTypes.slot, + type: FormTypes.sel_search, + // slotName: 'group', width: '200px', - // options: [], + options: [], // scopedSlots: { customRender: 'edit' },//引入的插槽 // customRender:function (t,r,index) { // console.log(t,r); @@ -381,6 +383,7 @@ needTime: {rules:[{ required: true, message: '请选择需求时间!' }]}, processPlan: {rules:[ { required: true, message: '请选择流程计划!'}]} }, + isBu: undefined, } }, props: { @@ -444,7 +447,7 @@ let userInfo=sessionStorage.getItem("USER_INFORMATION"); // userInfo.company=company; this.popupCallback(company,userInfo); - + this.descriptionFetchDatas(); }, mounted() { console.log( this.$refs.processUdgetPlanMaterial); @@ -557,32 +560,33 @@ //table 值改变触发 onSelect(record) { // console.log("0出发了",record.row); - // if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.materialNumber === ''){ - // console.log("1出发了",record.row); - // // this.fetchMerchandiseNews(record.row.materialGroup); - // if(record.row.id !== undefined){ - // let values = [ - // { - // rowKey: record.row.id, - // values: { - // 'materialNumber': '', - // 'materialGroup': this.materialId, - // 'materialSeries': '', - // 'materialName': '', - // 'materialUnit': '', - // 'supplierId': '', - // 'materialAmount': '', - // 'materialType': '' - // }, - // }, - // ] - // // console.log(values); - // this.$refs.processUdgetPlanMaterial.setValues(values); - // } - // } + let isEr = true; + if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined){ + if( record.row.id !== undefined && record.row.id !== '' && this.isBu !== record.row.materialGroup ){ + console.log("1出发了",record.row); + this.fetchMerchandiseNews(record.row.materialGroup); + this.isBu = record.row.materialGroup; + let values = [ + { + rowKey: record.row.id, + values: { + 'materialNumber': '', + 'materialSeries': '', + 'materialName': '', + 'materialUnit': '', + 'supplierId': '', + 'materialAmount': '', + 'materialType': '' + }, + }, + ] + this.$refs.processUdgetPlanMaterial.setValues(values); + isEr = false; + } + } // console.log("5555出发了",record.row); - if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.materialNumber !== ''){ - // console.log("2出发了",record.row); + if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.materialNumber !== '' && record.row.materialNumber !== undefined && isEr){ + console.log("2出发了",record.row); let materialName = { } // console.log("this.bigIdMerchandiseNewsList",this.bigIdMerchandiseNewsList) this.bigIdMerchandiseNewsList.forEach( item => { @@ -602,7 +606,8 @@ rowKey: record.row.id, values: { 'materialNumber': record.row.materialNumber, - 'materialGroup': this.materialId, + 'materialGroup': record.row.materialGroup, + // 'materialGroup': this.materialId, 'materialSeries': "SM-JD36-BA", 'materialName': materialName.name, 'materialUnit': materialName.unit, @@ -639,9 +644,7 @@ } }, - fetchMerchandiseNews(value){ //查询物料清单信息 - return new Promise((resolve, reject)=>{ - + fetchMerchandiseNews(value){ //查询物料清单信息 //查询大品类数据 let par = { delFlag: 0, @@ -691,33 +694,90 @@ }) } this.bigIdMerchandiseNewsList = res.result - resolve( res.result ); } }); - - }) - }, + // fetchMerchandiseNews(value){ //查询物料清单信息 + // return new Promise((resolve, reject)=>{ + // + // //查询大品类数据 + // let par = { + // delFlag: 0, + // descriptionId:value, + // } + // this.bigIdMerchandiseNews = []; + // this.bigIdMerchandiseNewsList = []; + // let qc = []; + // let numberList = []; + // if(this.processUdgetPlanMaterialTable.columns[1].options.length > 0){ + // this.processUdgetPlanMaterialTable.columns[1].options = []; + // } + // this.$refs.processUdgetPlanMaterial.getValues((a,b,c)=>{ + // b.forEach(item =>{ + // if(item.materialNumber !== '' && item.materialNumber !== undefined && item.materialNumber !== null){ + // numberList.push(item.materialNumber); + // } + // }); + // }); + // getAction(this.url.merchandiseNewsList,par).then((res)=>{ + // console.log(res.result); + // if(res.success){ + // let newList = res.result; + // if(numberList.length > 0){ + // newList.forEach( item => { + // qc.push({ + // title : item.materialsNumber, + // value : item.id, + // disabled : false + // }) + // }) + // numberList.forEach( num => { + // qc.forEach( i => { + // if(num === i.value){ + // i.disabled = true; + // } + // }); + // }) + // this.processUdgetPlanMaterialTable.columns[1].options = qc; + // }else{ + // newList.forEach( item => { + // this.processUdgetPlanMaterialTable.columns[1].options.push({ + // title : item.materialsNumber, + // value : item.id, + // disabled : false + // }) + // }) + // } + // this.bigIdMerchandiseNewsList = res.result + // resolve( res.result ); + // } + // }); + // + // }) + // + // }, - fetchData(value){ //查询物料组 + descriptionFetchDatas(value){ //查询物料组 //查询大品类数据 let par = { delFlag: 0, + pageSize: 50 } this.bigId = []; + getAction(this.url.descriptionRakeUrl,par).then((res)=>{ // getAction(this.url.descriptionRake,par).then((res)=>{ - // if(res.success){ - // if(this.processUdgetPlanMaterialTable.columns[0].options.length > 0){ - // this.processUdgetPlanMaterialTable.columns[0].options = []; - // } - // res.result.forEach( item => { - // this.processUdgetPlanMaterialTable.columns[0].options.push({ - // title : item.descriptionName, - // value : item.id, - // }) - // }) - // } - // }); + if(res.success){ + if(this.processUdgetPlanMaterialTable.columns[0].options.length > 0){ + this.processUdgetPlanMaterialTable.columns[0].options = []; + } + res.result.records.forEach( item => { + this.processUdgetPlanMaterialTable.columns[0].options.push({ + title : item.descriptionName, + value : item.id, + }) + }) + } + }); }, /*回显数据*/ init(){ @@ -733,7 +793,8 @@ if (formData.materialType){ this.hieg=false; - this.fetchDataRake(); + // this.fetchDataRake(); + this.fetchData(); } this.editAfter(); this.btndisabled = false;