Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
0.0 2 years ago
parent
commit
9f36e97703
  1. 11
      src/components/jeecg/JEditableTable.vue
  2. 3142
      src/components/jeecg/PEditableTable.vue
  3. 3
      src/components/jeecg/index.js
  4. 189
      src/views/activiti/form/ProcessUdgetPlanForm.vue

11
src/components/jeecg/JEditableTable.vue

@ -534,7 +534,7 @@
:placeholder="replaceProps(col, col.placeholder)"
@change="(v)=>handleSearchSelectChange(v,id,row,col)"
allowClear
/><!-- asdfasdf-->
/>
<span
v-else
class="j-td-span no-edit"
@ -2246,6 +2246,7 @@
},
//
handleEditRow(row, col) {
console.log("handleEditRow================")
if (this.alwaysEdit) {
return
}
@ -2448,6 +2449,7 @@
/** 辅助方法:替换${...}变量 */
replaceProps(col, value) {
// console.log("replaceProps===============")
if (value && typeof value === 'string') {
value = value.replace(/\${title}/g, col.title)
value = value.replace(/\${key}/g, col.key)
@ -2502,6 +2504,7 @@
},
/** view辅助方法:构造props */
buildProps(row, col) {
// console.log("buildProps=========================")
let props = {}
// props
if (typeof col.props === 'object') {
@ -2623,11 +2626,15 @@
this.elemValueChange(FormTypes.list_multi, row, column, value)
},
handleSearchSelectChange(value, id, row, column) {
// console.log("handleSearchSelectChange=================",value,id,row,column)
this.searchSelectValues = this.bindValuesChange(value, id, 'searchSelectValues')
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.elemValueChange(FormTypes.sel_search, row, column, value)
},
filterOption(input, option) {
console.log("filterOption=========",input,option);
console.log("option.componentOptions.children[0]",option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 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
}

3142
src/components/jeecg/PEditableTable.vue

File diff suppressed because it is too large Load Diff

3
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)
}
}

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

@ -64,7 +64,7 @@
<!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs" ref="tabs">
<a-tab-pane tab="预算计划采购流程物料清单表" :key="refKeys[0]" :forceRender="true">
<j-editable-table
<p-editable-table
ref="processUdgetPlanMaterial"
:loading="processUdgetPlanMaterialTable.loading"
:columns="processUdgetPlanMaterialTable.columns"
@ -75,17 +75,19 @@
:rowNumber="true"
:disabled="hieg"
:rowSelection="true"
:actionButton="true">
<template v-slot:group="props">
<a-auto-complete
v-decorator="[`materialGroup`]"
:data-source="bigIdRake"
placeholder="请选择"
@search="onSearchRake"
@select="onSelectRake(props,$event)"
/>
</template>
:actionButton="true"
@descriptionFetch="descriptionFetchDatas"
>
<!-- <template v-slot:group="props">-->
<!-- <a-auto-complete-->
<!-- v-decorator="[`materialGroup`]"-->
<!-- :data-source="bigIdRake"-->
<!-- placeholder="请选择"-->
<!-- @search="onSearchRake"-->
<!-- @select="onSelectRake(props,$event)"-->
<!-- />-->
<!-- </template>-->
<template v-slot:action="props">
<a-tooltip placement="top">
@ -96,7 +98,7 @@
</a-tooltip>
<!-- <a-button @click="chaKan(props)">查看</a-button>-->
</template>
</j-editable-table>
</p-editable-table>
</a-tab-pane>
</a-tabs>
@ -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,
@ -640,8 +645,6 @@
},
fetchMerchandiseNews(value){ //
return new Promise((resolve, reject)=>{
//
let par = {
delFlag: 0,
@ -691,33 +694,90 @@
})
}
this.bigIdMerchandiseNewsList = res.result
resolve( res.result );
}
});
})
},
fetchData(value){ //
//
let par = {
delFlag: 0,
}
this.bigId = [];
// getAction(this.url.descriptionRake,par).then((res)=>{
// 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){
// if(this.processUdgetPlanMaterialTable.columns[0].options.length > 0){
// this.processUdgetPlanMaterialTable.columns[0].options = [];
// 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;
// }
// res.result.forEach( item => {
// this.processUdgetPlanMaterialTable.columns[0].options.push({
// title : item.descriptionName,
// });
// })
// 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 );
// }
// });
//
// })
//
// },
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.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;

Loading…
Cancel
Save