Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | /** |
| | | * è·åebomä¿¡æ¯ |
| | | * @param parentOid ä¸çº§ä¿¡æ¯ |
| | | * @param productNo 产åç¼å· |
| | | * @param productOid 产åä¸»é® |
| | | * @param parentOid ä¸çº§é¶ä»¶ä¸»é® |
| | | * @return |
| | | */ |
| | | @VciUnCheckRight |
| | |
| | | baseResult.setCode(200); |
| | | return baseResult; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸çº§é¶ä»¶ä¿¡æ¯ |
| | | * @param productOid 产åä¸»é® |
| | | * @param parentOid ä¸çº§é¶ä»¶ä¸»é® |
| | | * @return |
| | | */ |
| | | @VciUnCheckRight |
| | | @GetMapping("/getChildInfo") |
| | | public BaseResult getChildInfo(String productOid, String parentOid){ |
| | | if(StringUtils.isBlank(productOid)){ |
| | | return BaseResult.fail("产å主é®ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(parentOid)){ |
| | | return BaseResult.fail("é¶ä»¶ä¸çº§ä¸»é®ä¸ºç©ºï¼"); |
| | | } |
| | | String sql = "select p.*,e.oid as eoid from platformbtm_part p left join platformlt_ebom e on p.oid = e.t_oid \n" + |
| | | "where e.f_oid = '"+parentOid+"' and e.workcontextoid = '"+productOid+"' \n" + |
| | | "and p.islastr = '1' and p.islastv = '1' order by p.code asc"; |
| | | List<Map> ebomList = boServiceI.queryByOnlySqlForMap(sql); |
| | | BaseResult baseResult = new BaseResult(); |
| | | baseResult.setData(ebomList); |
| | | baseResult.setSuccess(true); |
| | | return baseResult; |
| | | } |
| | | |
| | | /** |
| | | * è·åé¶ä»¶å®ä¾ä¿¡æ¯ |
| | | * @param productOid 产åä¸»é® |
| | | * @param partOid é¶ä»¶ä¸»é® |
| | | * @param eoid æ èç¹ä¸çæ©å±å±æ§eoidçå¼ |
| | | * @return |
| | | */ |
| | | @VciUnCheckRight |
| | | @GetMapping("/getPartInstance") |
| | | public BaseResult getPartInstance(String productOid, String partOid, String eoid){ |
| | | if(StringUtils.isBlank(productOid)){ |
| | | return BaseResult.fail("产å主é®ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(partOid)){ |
| | | return BaseResult.fail("é¶ä»¶ä¸»é®ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(eoid)){ |
| | | return BaseResult.fail("EBOMå
³ç³»ä¸»é®ä¸ºç©ºï¼"); |
| | | } |
| | | String sql = "select t.* from platformbtm_partinstance t where t.partoid = '"+partOid+"' \n" + |
| | | "and t.workcontextoid = '"+productOid+"' and t.ebomoid = '"+eoid+"'"; |
| | | List<Map> mapList = boServiceI.queryByOnlySqlForMap(sql); |
| | | BaseResult baseResult = new BaseResult(); |
| | | baseResult.setData(mapList); |
| | | baseResult.setSuccess(true); |
| | | return baseResult; |
| | | } |
| | | |
| | | /** |
| | | * è·åé¶ä»¶åºæ¬ä¿¡æ¯ |
| | | * @param partOid é¶ä»¶ä¸»é® |
| | | * @return |
| | | */ |
| | | @GetMapping("/getPartInfo") |
| | | public BaseResult getPartInfo(String partOid){ |
| | | if(StringUtils.isBlank(partOid)){ |
| | | return BaseResult.fail("é¶ä»¶ä¸»é®ä¸ºç©ºï¼"); |
| | | } |
| | | String sql = "select * from platformbtm_part where oid = '"+partOid+"'"; |
| | | List<Map> mapList = boServiceI.queryByOnlySqlForMap(sql); |
| | | BaseResult baseResult = new BaseResult(); |
| | | baseResult.setData(mapList); |
| | | baseResult.setSuccess(true); |
| | | return baseResult; |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | // äº§åæ |
| | | export function getEbomInfo(params) { |
| | | return request({ |
| | | url: "/api/dataTestController/getEbomInfo", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | |
| | | col.display=false |
| | | } |
| | | } |
| | | if (col.type === "select") { |
| | | if(col.data && col.data.length>0){ |
| | | if (col.type === "select" || col.type==='radio' || col.type==='checkbox') { |
| | | if (col.data && col.data.length > 0) { |
| | | col.dicData = col.data.map((d) => { |
| | | return { |
| | | label: d.key, |
| | | key: d.value, |
| | | value: d.value, |
| | | attributes:d.attributes |
| | | attributes: d.attributes |
| | | }; |
| | | }); |
| | | }else if(!validatenull(col.dictCode)) { |
| | | } else if (!validatenull(col.dictCode)) { |
| | | getDicts(col.dictCode).then((res) => { |
| | | if (res.data.success){ |
| | | if(res.data.data && res.data.obj == null){ |
| | | if (res.data.success) { |
| | | if (res.data.data && res.data.obj == null) { |
| | | res.data.obj = res.data.data |
| | | } |
| | | const dic = res.data.obj; |
| | |
| | | label: d.value, |
| | | key: d.key, |
| | | value: d.key, |
| | | attributes:d.attributes |
| | | attributes: d.attributes |
| | | }; |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | col.dicData = []; |
| | | } |
| | | } |
| | | if (col.type==='refer') { |
| | |
| | | } |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doEdit(options, function (type,formData) { |
| | | callPostEvent(options, doAfter,type, callback); |
| | | callPostEvent(options, doAfter,callback,type); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | } |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doRev(options, function (formData) { |
| | | callPostEvent(options, doAfter,'rev', callback); |
| | | callPostEvent(options, doAfter,callback,'rev'); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | showStartWindow(options, function () { |
| | | callPostEvent(options, doAfter, callback,type); |
| | | callPostEvent(options, doAfter, callback,'startwork'); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | /** |
| | | * æé®å¤ç 页é¢å±ç¤ºä¸ºtabéé¡¹å¡ |
| | | * æé®å¤ç å¼¹çªå±ç¤ºè¯¦æ
|
| | | */ |
| | | import {paramLow,callPreEvent,callPostEvent,replaceFreeMarker} from '../BaseAction'; |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | import ViewDialog from "@/components/actions/base/ViewDialog"; |
| | | import ViewTab from "@/views/base/ViewTab"; |
| | | import router from "@/router/router" |
| | | import store from "@/store/index" |
| | | |
| | | export const doAction = (options,callback) => { |
| | | const paramVOS = Object.assign({ |
| | |
| | | Vue.prototype.$message.error("ä»
è½éæ©ä¸æ¡æ°æ®æ¥æä½"); |
| | | return false; |
| | | } |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doView(options, function (type,formData) { |
| | | callPostEvent(options, doAfter,type, callback); |
| | |
| | | name="æ¥çã"+replaceFreeMarker(paramVOS.showname,options.dataStore,options.sourceData)+"ã" |
| | | } |
| | | paramVOS.title=name; |
| | | const dialogConstructor = Vue.extend(ViewDialog); |
| | | let instance = new dialogConstructor(); |
| | | instance.sourceData = options.sourceData; |
| | | instance.dataStore = options.dataStore; |
| | | instance.paramVOS = paramVOS |
| | | |
| | | instance.dialogClose = function () { |
| | | vm.visible = false; |
| | | document.body.removeChild(vm.$el); |
| | | instance.$destroy(); |
| | | instance = null; |
| | | }; |
| | | if (callback) { |
| | | instance.saveCallback = callback; |
| | | const params= { |
| | | options:options, |
| | | paramVOS:paramVOS, |
| | | saveCallback:callback |
| | | } |
| | | let vm = instance.$mount(); |
| | | document.body.appendChild(vm.$el); |
| | | instance.visible = true; |
| | | |
| | | store.dispatch("setViewtabparams", params); |
| | | router.push({ |
| | | name: "æ¥ç详æ
", |
| | | params:params, |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * åç½®äºä»¶ |
| | | * @param options æé®çé
ç½®ä¿¡æ¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * æé®å¤ç å¼¹çªå±ç¤ºè¯¦æ
|
| | | */ |
| | | import {paramLow,callPreEvent,callPostEvent,replaceFreeMarker} from '../BaseAction'; |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | import ViewDialog from "@/components/actions/base/ViewDialog"; |
| | | |
| | | export const doAction = (options,callback) => { |
| | | const paramVOS = Object.assign({ |
| | | getdataurl: '/api/uiDataController/dataFormQuery', |
| | | getdatamethod: 'post', |
| | | url: '/api/uiDataController/editSave', |
| | | method: 'put', |
| | | uploadfileurl: 'vciFileUploadController/uploadFile' |
| | | }, options.paramVOS) |
| | | options.paramVOS = paramVOS; |
| | | |
| | | options.sourceData = options.sourceData || {}; |
| | | options.dataStore = options.dataStore || []; |
| | | if (!options.dataStore || options.dataStore.length < 1) { |
| | | Vue.prototype.$message.error("è¯·éæ©éè¦æµè§çæ°æ®"); |
| | | return false; |
| | | } |
| | | if (!paramVOS.multi && options.dataStore.length > 1) { |
| | | Vue.prototype.$message.error("ä»
è½éæ©ä¸æ¡æ°æ®æ¥æä½"); |
| | | return false; |
| | | } |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doView(options, function (type,formData) { |
| | | callPostEvent(options, doAfter,type, callback); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ§è¡ |
| | | * @param options æé®çé
ç½®ä¿¡æ¯ |
| | | * @param callback åè° |
| | | */ |
| | | export const doView = (options,callback)=> { |
| | | const paramVOS = options.paramVOS; |
| | | let component = 'base/UIContentViewerInDialog'; |
| | | if (!validatenull(paramVOS.customurl)) { |
| | | //èªå®ä¹js |
| | | component = `custom-ui/` + paramVOS.customurl; |
| | | }else{ |
| | | if (!paramVOS['type'] || !paramVOS['context']) { |
| | | Vue.prototype.$message.error("æé®é
ç½®ä¸æ£ç¡®"); |
| | | return false; |
| | | } |
| | | } |
| | | paramVOS.component=component; |
| | | let name="æ¥ç详æ
" |
| | | if(paramVOS.showname){ |
| | | name="æ¥çã"+replaceFreeMarker(paramVOS.showname,options.dataStore,options.sourceData)+"ã" |
| | | } |
| | | paramVOS.title=name; |
| | | const dialogConstructor = Vue.extend(ViewDialog); |
| | | let instance = new dialogConstructor(); |
| | | instance.sourceData = options.sourceData; |
| | | instance.dataStore = options.dataStore; |
| | | instance.paramVOS = paramVOS |
| | | |
| | | instance.dialogClose = function () { |
| | | vm.visible = false; |
| | | document.body.removeChild(vm.$el); |
| | | instance.$destroy(); |
| | | instance = null; |
| | | }; |
| | | if (callback) { |
| | | instance.saveCallback = callback; |
| | | } |
| | | let vm = instance.$mount(); |
| | | document.body.appendChild(vm.$el); |
| | | instance.visible = true; |
| | | } |
| | | |
| | | /** |
| | | * åç½®äºä»¶ |
| | | * @param options æé®çé
ç½®ä¿¡æ¯ |
| | | * @param callback åè° |
| | | */ |
| | | export const doBefore = (options,callback)=> { |
| | | console.log('æ§è¡æ¥çåç½®äºä»¶'); |
| | | if(callback){ |
| | | callback(options); |
| | | } |
| | | } |
| | | /** |
| | | * åç½®äºä»¶ |
| | | * @param options æé®çé
ç½®ä¿¡æ¯ |
| | | * @param callback åè° |
| | | */ |
| | | export const doAfter = (options,callback,actionType)=> { |
| | | console.log('æ§è¡æ¥çåç½®äºä»¶'); |
| | | if(callback){ |
| | | callback(actionType); |
| | | } |
| | | } |
| | |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | showStartWindow(options, function () { |
| | | callPostEvent(options, doAfter, callback,type); |
| | | callPostEvent(options, doAfter, callback,'downloadfile'); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | showStartWindow(options, function () { |
| | | callPostEvent(options, doAfter, callback,type); |
| | | callPostEvent(options, doAfter, callback,'uprevision'); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | } |
| | | callPreEvent(options, doBefore, function (options) { |
| | | showStartWindow(options, function () { |
| | | callPostEvent(options, doAfter, callback,type); |
| | | callPostEvent(options, doAfter, callback,'uploadfile'); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | |
| | | export const handlerAction=function (type,options, callback) { |
| | | const handlers = { |
| | | //æ¥ç |
| | | //æ¥çï¼tabå±ç¤ºè¯¦æ
|
| | | view: () => {import("@/components/actions/base/ViewAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //æ¥çï¼å¼¹çªå±ç¤ºè¯¦æ
|
| | | viewdialog: () => {import("@/components/actions/base/ViewDialogAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //å建 |
| | | add: () => {import("@/components/actions/base/AddAction").then(module => { |
| | | module.doAction(options,callback); |
| | |
| | | component: () => |
| | | import( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail') |
| | | }] |
| | | }] |
| | | },{ |
| | | path: '/viewTab', |
| | | component: Layout, |
| | | redirect: '/viewTab/index', |
| | | children: [{ |
| | | path: 'index', |
| | | name: 'æ¥ç详æ
', |
| | | meta: { |
| | | i18n: 'viewTab' |
| | | }, |
| | | component: () => |
| | | import('@/views/base/ViewTab') |
| | | }] |
| | | } ] |
| | |
| | | import dict from './modules/dict' |
| | | import getters from './getters' |
| | | import flow from './modules/LifeFlow' |
| | | import { setStore } from "@/util/store.js"; |
| | | |
| | | Vue.use(Vuex) |
| | | const store = new Vuex.Store({ |
| | |
| | | flow |
| | | }, |
| | | getters, |
| | | state: { |
| | | viewtabparams:undefined, //æ¥çtab Actionåæ° |
| | | }, |
| | | mutations: { |
| | | // è§ç¨è¯¦æ
åæ° |
| | | getViewtabparams(state, obj) { |
| | | state.viewtabparams = obj; |
| | | }, |
| | | }, |
| | | actions: { |
| | | setViewtabparams({ commit }, obj){ |
| | | commit("getViewtabparams", obj); |
| | | setStore({ |
| | | name:'viewtabparams', |
| | | content:obj, |
| | | type:'session' |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | export default store |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--Action æ¥çTabçå®ç°--> |
| | | <component :is="currentComponent" |
| | | ref="uiViewRef" |
| | | key="ViewTab" |
| | | :btmType="paramVOS.type" |
| | | :context="paramVOS.context" |
| | | :inDialog="false" |
| | | :canEdit="false" |
| | | actionType="view" |
| | | :sourceData="sourceData" |
| | | :dataStore="dataStore" |
| | | :paramVOS="paramVOS"></component> |
| | | </template> |
| | | |
| | | <script> |
| | | import {validatenull} from "@/util/validate"; |
| | | import { getStore } from "@/util/store.js"; |
| | | |
| | | export default { |
| | | name: "ViewTab", |
| | | components:{}, |
| | | data(){ |
| | | return { |
| | | sourceData:{}, |
| | | dataStore:[], |
| | | paramVOS:{}, |
| | | currentComponent: null, |
| | | } |
| | | }, |
| | | computed:{ |
| | | title(){ |
| | | return this.paramVOS.title || "æ¥ç详æ
" |
| | | } |
| | | }, |
| | | created() { |
| | | let config = {}; |
| | | if (!validatenull(this.$store.state.viewtabparams)) { |
| | | config = this.$store.state.viewtabparams; |
| | | } else { |
| | | config = getStore('viewtabparams'); |
| | | } |
| | | this.sourceData = config.options.sourceData; |
| | | this.dataStore = config.options.dataStore; |
| | | this.paramVOS = config.paramVOS; |
| | | }, |
| | | mounted() { |
| | | this.loadCompoent(); |
| | | }, |
| | | methods: { |
| | | loadCompoent(){ |
| | | // 卿坼å
¥ç»ä»¶ |
| | | import(`@/views/${this.paramVOS.component}.vue`).then((module) => { |
| | | // æå导å
¥åï¼å°ç»ä»¶æ³¨åå°Vueå®ä¾ä¸ |
| | | this.currentComponent = module.default; |
| | | }).catch((error) => { |
| | | // å¤ç导å
¥å¤±è´¥çæ
åµ |
| | | console.log('ç»ä»¶å 载失败:', error); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <p>产åèªå®ä¹é¡µé¢</p> |
| | | <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | </avue-tree> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getEbomInfo} from "@/api/UI/uiDefine"; |
| | | |
| | | export default { |
| | | name: "product" |
| | | name: "product", |
| | | props: { |
| | | sourceData: { |
| | | type: Array, |
| | | default: {} |
| | | }, |
| | | dataStore: { |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | paramVOS: { |
| | | type: Array, |
| | | default: {} |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | treeLoading: false, |
| | | treeData: [], |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: false, |
| | | props: { |
| | | label: 'text', |
| | | value: 'oid', |
| | | children: 'children', |
| | | }, |
| | | lazy: true, |
| | | treeLoad: (node, resolve) => { |
| | | console.log(node); |
| | | const params = { |
| | | productNo: this.dataStore[0].productnumber, |
| | | productOid: this.dataStore[0].oid, |
| | | parentOid: node.level === 0 ? '' : node.data.oid |
| | | } |
| | | getEbomInfo(params).then(res => { |
| | | console.log(res); |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: item.leaf |
| | | } |
| | | })) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | // console.log(this.sourceData); |
| | | console.log(this.dataStore); |
| | | // console.log(this.paramVOS); |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | |
| | | this.$message.success('åç±»å建æå'); |
| | | this.getTreeList(); |
| | | } |
| | | done(); |
| | | }) |
| | | done(); |
| | | loading(); |
| | | }, |
| | | |
| | |
| | | text: data.text, |
| | | oid: data.oid, |
| | | itemType: 'text', |
| | | itemName: data.data.name |
| | | itemName: data.data.name, |
| | | itemCols :"1" |
| | | } |
| | | console.log(data); |
| | | const isDuplicate = this.formList.some(item => item.text === data.text); |
| | |
| | | this.activeItem = item; |
| | | this.activeItemIndex = index; |
| | | this.form = {...item}; |
| | | // this.form.itemCols = "1"; |
| | | console.log(item); |
| | | |
| | | // console.log(item,index); |
| | |
| | | }, |
| | | { |
| | | label: 'æå±å¯çº§', |
| | | prop: 'secretGradeText', |
| | | prop: 'secretGrade', |
| | | width: 100, |
| | | sortable:true, |
| | | type: 'select', |
| | |
| | | value: 'key', |
| | | res: "obj", |
| | | }, |
| | | // formatter:(row,value,label)=>{ |
| | | // return row.secretGrade === 0 ? '' : label; |
| | | // } |
| | | }, |
| | | ]; |