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. 191
      src/views/activiti/form/ProcessUdgetPlanForm.vue

11
src/components/jeecg/JEditableTable.vue

@ -534,7 +534,7 @@
:placeholder="replaceProps(col, col.placeholder)" :placeholder="replaceProps(col, col.placeholder)"
@change="(v)=>handleSearchSelectChange(v,id,row,col)" @change="(v)=>handleSearchSelectChange(v,id,row,col)"
allowClear allowClear
/><!-- asdfasdf--> />
<span <span
v-else v-else
class="j-td-span no-edit" class="j-td-span no-edit"
@ -2246,6 +2246,7 @@
}, },
// //
handleEditRow(row, col) { handleEditRow(row, col) {
console.log("handleEditRow================")
if (this.alwaysEdit) { if (this.alwaysEdit) {
return return
} }
@ -2448,6 +2449,7 @@
/** 辅助方法:替换${...}变量 */ /** 辅助方法:替换${...}变量 */
replaceProps(col, value) { replaceProps(col, value) {
// console.log("replaceProps===============")
if (value && typeof value === 'string') { if (value && typeof value === 'string') {
value = value.replace(/\${title}/g, col.title) value = value.replace(/\${title}/g, col.title)
value = value.replace(/\${key}/g, col.key) value = value.replace(/\${key}/g, col.key)
@ -2502,6 +2504,7 @@
}, },
/** view辅助方法:构造props */ /** view辅助方法:构造props */
buildProps(row, col) { buildProps(row, col) {
// console.log("buildProps=========================")
let props = {} let props = {}
// props // props
if (typeof col.props === 'object') { if (typeof col.props === 'object') {
@ -2623,11 +2626,15 @@
this.elemValueChange(FormTypes.list_multi, row, column, value) this.elemValueChange(FormTypes.list_multi, row, column, value)
}, },
handleSearchSelectChange(value, id, row, column) { handleSearchSelectChange(value, id, row, column) {
// console.log("handleSearchSelectChange=================",value,id,row,column)
this.searchSelectValues = this.bindValuesChange(value, id, 'searchSelectValues') this.searchSelectValues = this.bindValuesChange(value, id, 'searchSelectValues')
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change') this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.elemValueChange(FormTypes.sel_search, row, column, value) this.elemValueChange(FormTypes.sel_search, row, column, value)
}, },
filterOption(input, option) { 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 return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
getEllipsisWord(content, len){ getEllipsisWord(content, len){
@ -2644,12 +2651,14 @@
/** 获取Select等组件翻译后的文本 */ /** 获取Select等组件翻译后的文本 */
getSelectTranslateText(value, row, col) { getSelectTranslateText(value, row, col) {
// console.log("getSelectTranslateText====================")
// //
return filterDictText(col.options, value) return filterDictText(col.options, value)
}, },
// //
isEditRow(row, col) { isEditRow(row, col) {
// console.log("isEditRow=======================")
if (this.alwaysEdit) { if (this.alwaysEdit) {
return true 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 JSwitch from './JSwitch.vue'
import JTime from './JTime.vue' import JTime from './JTime.vue'
import JTreeTable from './JTreeTable.vue' import JTreeTable from './JTreeTable.vue'
import PEditableTable from './PEditableTable'
export default { export default {
install(Vue) { install(Vue) {
Vue.component('JMarkdownEditor', JMarkdownEditor) Vue.component('JMarkdownEditor', JMarkdownEditor)
@ -67,5 +67,6 @@ export default {
Vue.component('JTreeTable', JTreeTable) Vue.component('JTreeTable', JTreeTable)
Vue.component('JUpload', JUpload) Vue.component('JUpload', JUpload)
Vue.component('FileList', FileList) Vue.component('FileList', FileList)
Vue.component('PEditableTable',PEditableTable)
} }
} }

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

@ -64,7 +64,7 @@
<!-- 子表单区域 --> <!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs" ref="tabs"> <a-tabs v-model="activeKey" @change="handleChangeTabs" ref="tabs">
<a-tab-pane tab="预算计划采购流程物料清单表" :key="refKeys[0]" :forceRender="true"> <a-tab-pane tab="预算计划采购流程物料清单表" :key="refKeys[0]" :forceRender="true">
<j-editable-table <p-editable-table
ref="processUdgetPlanMaterial" ref="processUdgetPlanMaterial"
:loading="processUdgetPlanMaterialTable.loading" :loading="processUdgetPlanMaterialTable.loading"
:columns="processUdgetPlanMaterialTable.columns" :columns="processUdgetPlanMaterialTable.columns"
@ -75,17 +75,19 @@
:rowNumber="true" :rowNumber="true"
:disabled="hieg" :disabled="hieg"
:rowSelection="true" :rowSelection="true"
:actionButton="true"> :actionButton="true"
<template v-slot:group="props"> @descriptionFetch="descriptionFetchDatas"
<a-auto-complete >
v-decorator="[`materialGroup`]" <!-- <template v-slot:group="props">-->
:data-source="bigIdRake" <!-- <a-auto-complete-->
placeholder="请选择" <!-- v-decorator="[`materialGroup`]"-->
@search="onSearchRake" <!-- :data-source="bigIdRake"-->
@select="onSelectRake(props,$event)" <!-- placeholder="请选择"-->
<!-- @search="onSearchRake"-->
/> <!-- @select="onSelectRake(props,$event)"-->
</template>
<!-- />-->
<!-- </template>-->
<template v-slot:action="props"> <template v-slot:action="props">
<a-tooltip placement="top"> <a-tooltip placement="top">
@ -96,7 +98,7 @@
</a-tooltip> </a-tooltip>
<!-- <a-button @click="chaKan(props)">查看</a-button>--> <!-- <a-button @click="chaKan(props)">查看</a-button>-->
</template> </template>
</j-editable-table> </p-editable-table>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@ -186,11 +188,11 @@
key: 'materialGroup', key: 'materialGroup',
// type: FormTypes.slot, // <------------- slot // type: FormTypes.slot, // <------------- slot
// slotName: 'actions', // <-------------slot v-slot // slotName: 'actions', // <-------------slot v-slot
type: FormTypes.slot, // type: FormTypes.slot,
// type: FormTypes.sel_search, type: FormTypes.sel_search,
slotName: 'group', // slotName: 'group',
width: '200px', width: '200px',
// options: [], options: [],
// scopedSlots: { customRender: 'edit' },// // scopedSlots: { customRender: 'edit' },//
// customRender:function (t,r,index) { // customRender:function (t,r,index) {
// console.log(t,r); // console.log(t,r);
@ -381,6 +383,7 @@
needTime: {rules:[{ required: true, message: '请选择需求时间!' }]}, needTime: {rules:[{ required: true, message: '请选择需求时间!' }]},
processPlan: {rules:[ { required: true, message: '请选择流程计划!'}]} processPlan: {rules:[ { required: true, message: '请选择流程计划!'}]}
}, },
isBu: undefined,
} }
}, },
props: { props: {
@ -444,7 +447,7 @@
let userInfo=sessionStorage.getItem("USER_INFORMATION"); let userInfo=sessionStorage.getItem("USER_INFORMATION");
// userInfo.company=company; // userInfo.company=company;
this.popupCallback(company,userInfo); this.popupCallback(company,userInfo);
this.descriptionFetchDatas();
}, },
mounted() { mounted() {
console.log( this.$refs.processUdgetPlanMaterial); console.log( this.$refs.processUdgetPlanMaterial);
@ -557,32 +560,33 @@
//table //table
onSelect(record) { onSelect(record) {
// console.log("0",record.row); // console.log("0",record.row);
// if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.materialNumber === ''){ let isEr = true;
// console.log("1",record.row); if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined){
// // this.fetchMerchandiseNews(record.row.materialGroup); if( record.row.id !== undefined && record.row.id !== '' && this.isBu !== record.row.materialGroup ){
// if(record.row.id !== undefined){ console.log("1出发了",record.row);
// let values = [ this.fetchMerchandiseNews(record.row.materialGroup);
// { this.isBu = record.row.materialGroup;
// rowKey: record.row.id, let values = [
// values: { {
// 'materialNumber': '', rowKey: record.row.id,
// 'materialGroup': this.materialId, values: {
// 'materialSeries': '', 'materialNumber': '',
// 'materialName': '', 'materialSeries': '',
// 'materialUnit': '', 'materialName': '',
// 'supplierId': '', 'materialUnit': '',
// 'materialAmount': '', 'supplierId': '',
// 'materialType': '' 'materialAmount': '',
// }, 'materialType': ''
// }, },
// ] },
// // console.log(values); ]
// this.$refs.processUdgetPlanMaterial.setValues(values); this.$refs.processUdgetPlanMaterial.setValues(values);
// } isEr = false;
// } }
}
// console.log("5555",record.row); // console.log("5555",record.row);
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.materialNumber !== ''){ if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.materialNumber !== '' && record.row.materialNumber !== undefined && isEr){
// console.log("2",record.row); console.log("2出发了",record.row);
let materialName = { } let materialName = { }
// console.log("this.bigIdMerchandiseNewsList",this.bigIdMerchandiseNewsList) // console.log("this.bigIdMerchandiseNewsList",this.bigIdMerchandiseNewsList)
this.bigIdMerchandiseNewsList.forEach( item => { this.bigIdMerchandiseNewsList.forEach( item => {
@ -602,7 +606,8 @@
rowKey: record.row.id, rowKey: record.row.id,
values: { values: {
'materialNumber': record.row.materialNumber, 'materialNumber': record.row.materialNumber,
'materialGroup': this.materialId, 'materialGroup': record.row.materialGroup,
// 'materialGroup': this.materialId,
'materialSeries': "SM-JD36-BA", 'materialSeries': "SM-JD36-BA",
'materialName': materialName.name, 'materialName': materialName.name,
'materialUnit': materialName.unit, 'materialUnit': materialName.unit,
@ -639,9 +644,7 @@
} }
}, },
fetchMerchandiseNews(value){ // fetchMerchandiseNews(value){ //
return new Promise((resolve, reject)=>{
// //
let par = { let par = {
delFlag: 0, delFlag: 0,
@ -691,33 +694,90 @@
}) })
} }
this.bigIdMerchandiseNewsList = res.result 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 = { let par = {
delFlag: 0, delFlag: 0,
pageSize: 50
} }
this.bigId = []; this.bigId = [];
getAction(this.url.descriptionRakeUrl,par).then((res)=>{
// getAction(this.url.descriptionRake,par).then((res)=>{ // getAction(this.url.descriptionRake,par).then((res)=>{
// if(res.success){ if(res.success){
// if(this.processUdgetPlanMaterialTable.columns[0].options.length > 0){ if(this.processUdgetPlanMaterialTable.columns[0].options.length > 0){
// this.processUdgetPlanMaterialTable.columns[0].options = []; this.processUdgetPlanMaterialTable.columns[0].options = [];
// } }
// res.result.forEach( item => { res.result.records.forEach( item => {
// this.processUdgetPlanMaterialTable.columns[0].options.push({ this.processUdgetPlanMaterialTable.columns[0].options.push({
// title : item.descriptionName, title : item.descriptionName,
// value : item.id, value : item.id,
// }) })
// }) })
// } }
// }); });
}, },
/*回显数据*/ /*回显数据*/
init(){ init(){
@ -733,7 +793,8 @@
if (formData.materialType){ if (formData.materialType){
this.hieg=false; this.hieg=false;
this.fetchDataRake(); // this.fetchDataRake();
this.fetchData();
} }
this.editAfter(); this.editAfter();
this.btndisabled = false; this.btndisabled = false;

Loading…
Cancel
Save