{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/expandedComponents/form_template.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/expandedComponents/form_template.vue","mtime":1725957645733},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["\nimport API from \"@/api.js\";\nexport default {\n name: \"form-searchform\",\n props: [\"openParams\"],\n created: function() {\n this.initForm({\n appId: this.openParams.appId,\n formId: this.openParams.actionContent,\n docId: this.openParams._select,\n });\n },\n\n data: function() {\n return {\n formdata: undefined,\n };\n },\n\n methods: {\n form(data) {\n if (data) {\n return {\n methods: {\n findField(id) {\n for (let i = 0; i < data.fields.length; i++) {\n let fld = data.fields[i];\n if (id == fld.id) return fld;\n }\n return null;\n }\n },\n template: \"
\" + data.formTemplate.template + \"
\"\n };\n } else\n return {\n template: \"
\"\n };\n },\n\n getAllFields(){return this.formdata.fields;},\n\n initForm({ appId, formId, docId }) {\n let obj = {\n appId: this.openParams.appId,\n\t\t\t\t\tformId: this.openParams.actionContent,\n _: new Date().getTime(),\n\t\t\t\t};\n API.getDocumentEmpty(\n appId,\n formId,\n obj,\n {\n onSucess: response => {\n if (response.data.data) {\n let docId = response.data.data.id;\n if(this.openParams.relatedFormId) { //获取的是模板表单\n let obj = {\n appId: this.openParams.appId,\n formId: this.openParams.relatedFormId,\n docid: docId,\n templateForm: true,\n _: new Date().getTime(),\n }\n API.getForm(\n appId,\n this.openParams.relatedFormId,\n docId,\n obj,\n {\n onSucess: res => {\n this.formdata = res.data.data;\n this.formdata.formId = formId;\n this.formdata.docId = response.data.data.id; //docId,一直拿新页面的docId;\n }\n }\n );\n }else {\n API.getForm(\n appId,\n formId,\n docId,\n {},\n {\n onSucess: res => {\n this.formdata = res.data.data;\n this.formdata.formId = formId;\n this.formdata.docId = response.data.data.id; //docId,一直拿新页面的docId;\n }\n }\n );\n }\n }\n }\n }\n );\n },\n\n onSubmit(){\n let buildFormData = this.buildFormData();\n buildFormData.formId = this.openParams.relatedFormId;\n let data = {\n applicationId: this.openParams.appId,\n docId: buildFormData.id,\n document: buildFormData,\n formId: buildFormData.formId,\n id: buildFormData.id,\n parentId: \"\",\n templateForm: \"\",\n viewId: \"\",\n }\n\n let params = {\n docId: buildFormData.docId,\n viewId: buildFormData.viewId ? buildFormData.viewId:'',\n formId: buildFormData.formId,\n _templateForm: buildFormData.templateForm ? buildFormData.templateForm:'', \n parentId: buildFormData.parentId ? buildFormData.parentId:'',\n };\n\n this.$api.executeCustom(\n this.$api.appid, \n buildFormData.id, \n data,\n params,\n {\n onSucess: res => {\n if(res.data.errcode === 0) {\n this.$emit(\"event\")\n this.$notify({\n title: this.$t('success'),\n message: '',\n type: 'success'\n });\n }\n }\n }\n )\n\n },\n\n onCancel(){\n\n },\n \n searchBtnShow(data) {\n return data && data.template && data.template.length > 0;\n },\n\n buildFormData() {\n let items = {};\n for (let i = 0; i < this.formdata.fields.length; i++) {\n let fld = this.formdata.fields[i];\n if (\n fld.name &&\n fld.value != undefined &&\n fld.formField != \"ButtonField\" && \n fld.displayType != undefined\n ) {\n if(fld.textType ==\"hidden\" && fld.value) {\n items[fld.name] = fld.value;\n }else if(fld.textType !=\"hidden\"){\n items[fld.name] = fld.value;\n }\n }\n }\n return {\n applicationId: this.openParams.appId,\n formId: this.formdata.formId,\n id: this.formdata.docId,\n items: items,\n parentId: \"\",\n sign: \"\",\n subDocuments: [],\n versions: \"0\"\n };\n },\n \n }\n};\n",null]}