ab1293e230492f4f21f398849f32946ddd359842.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <#include "/common/utils.ftl">
  2. <template>
  3. <a-spin :spinning="confirmLoading">
  4. <j-form-container :disabled="formDisabled">
  5. <!-- 主表单区域 -->
  6. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  7. <a-row>
  8. <#assign form_popup = false>
  9. <#assign form_cat_tree = false>
  10. <#assign form_cat_back = "">
  11. <#assign bpm_flag=false>
  12. <#assign form_span = 24>
  13. <#if tableVo.fieldRowNum==2>
  14. <#assign form_span = 12>
  15. <#elseif tableVo.fieldRowNum==3>
  16. <#assign form_span = 8>
  17. <#elseif tableVo.fieldRowNum==4>
  18. <#assign form_span = 6>
  19. </#if>
  20. <#list columns as po>
  21. <#if po.fieldDbName=='bpm_status'>
  22. <#assign bpm_flag=true>
  23. </#if>
  24. <#if po.isShow =='Y' && po.fieldName != 'id'>
  25. <#assign form_field_dictCode="">
  26. <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
  27. <#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
  28. <#elseif po.dictField?default("")?trim?length gt 1>
  29. <#assign form_field_dictCode="${po.dictField}">
  30. </#if>
  31. <#if po.classType =='textarea'>
  32. <a-col :span="24">
  33. <a-form-model-item label="${po.filedComment}" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="${autoStringSuffixForModel(po)}">
  34. <#else>
  35. <a-col :span="${form_span}" >
  36. <a-form-model-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="${autoStringSuffixForModel(po)}">
  37. </#if>
  38. <#if po.classType =='date'>
  39. <j-date placeholder="请选择${po.filedComment}" v-model="model.${po.fieldName}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
  40. <#elseif po.classType =='datetime'>
  41. <j-date placeholder="请选择${po.filedComment}" v-model="model.${po.fieldName}" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
  42. <#elseif po.classType =='time'>
  43. <j-time placeholder="请选择${po.filedComment}" v-model="model.${po.fieldName}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
  44. <#elseif po.classType =='popup'>
  45. <#assign form_popup=true>
  46. <j-popup
  47. v-model="model.${po.fieldName}"
  48. field="${po.fieldName}"
  49. org-fields="${po.dictField}"
  50. dest-fields="${Format.underlineToHump(po.dictText)}"
  51. code="${po.dictTable}"
  52. :multi="${po.extendParams.popupMulti?c}"
  53. @input="popupCallback"
  54. <#if po.readonly=='Y'>disabled</#if>/>
  55. <#elseif po.classType =='sel_depart'>
  56. <j-select-depart v-model="model.${po.fieldName}" multi <#if po.readonly=='Y'>disabled</#if>/>
  57. <#elseif po.classType =='switch'>
  58. <j-switch v-model="model.${po.fieldName}" <#if po.dictField != 'is_open'>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
  59. <#elseif po.classType =='pca'>
  60. <j-area-linkage type="cascader" v-model="model.${po.fieldName}" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
  61. <#elseif po.classType =='markdown'>
  62. <j-markdown-editor v-model="model.${autoStringSuffixForModel(po)}" id="${po.fieldName}"></j-markdown-editor>
  63. <#elseif po.classType =='password'>
  64. <a-input-password v-model="model.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
  65. <#elseif po.classType =='sel_user'>
  66. <j-select-user-by-dep v-model="model.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if>/>
  67. <#elseif po.classType =='textarea'>
  68. <a-textarea v-model="model.${autoStringSuffixForModel(po)}" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
  69. <#elseif po.classType=='list' || po.classType=='radio'>
  70. <j-dict-select-tag type="${po.classType}" v-model="model.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
  71. <#elseif po.classType=='list_multi' || po.classType=='checkbox'>
  72. <j-multi-select-tag type="${po.classType}" v-model="model.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
  73. <#elseif po.classType=='sel_search'>
  74. <j-search-select-tag v-model="model.${po.fieldName}" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if>/>
  75. <#elseif po.classType=='cat_tree'>
  76. <#assign form_cat_tree = true>
  77. <j-category-select v-model="model.${po.fieldName}" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${dashedToCamel(po.dictText)}" @change="handleCategoryChange"</#if> <#if po.readonly=='Y'>disabled</#if>/>
  78. <#if po.dictText?default("")?trim?length gt 1>
  79. <#assign form_cat_back = "${po.dictText}">
  80. </#if>
  81. <#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
  82. <a-input-number v-model="model.${po.fieldName}" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
  83. <#elseif po.classType=='file'>
  84. <j-upload v-model="model.${autoStringSuffixForModel(po)}" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
  85. <#elseif po.classType=='image'>
  86. <j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-model="model.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
  87. <#elseif po.classType=='umeditor'>
  88. <j-editor v-model="model.${autoStringSuffixForModel(po)}" <#if po.readonly=='Y'>disabled</#if>/>
  89. <#elseif po.classType == 'sel_tree'>
  90. <j-tree-select
  91. ref="treeSelect"
  92. placeholder="请选择${po.filedComment}"
  93. v-model="model.${autoStringSuffixForModel(po)}"
  94. <#if po.dictText??>
  95. <#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??>
  96. dict="${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}"
  97. <#elseif po.dictText?split(',')[1]??>
  98. pidField="${po.dictText?split(',')[1]}"
  99. <#elseif po.dictText?split(',')[3]??>
  100. hasChildField="${po.dictText?split(',')[3]}"
  101. </#if>
  102. </#if>
  103. pidValue="${po.dictField}"
  104. <#if po.readonly=='Y'>disabled</#if>>
  105. </j-tree-select>
  106. <#else>
  107. <a-input v-model="model.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
  108. </#if>
  109. </a-form-model-item>
  110. </a-col>
  111. </#if>
  112. </#list>
  113. </a-row>
  114. </a-form-model>
  115. </j-form-container>
  116. <!-- 子表单区域 -->
  117. <a-tabs v-model="activeKey" @change="handleChangeTabs">
  118. <#list subTables as sub><#rt/>
  119. <#if sub.foreignRelationType =='1'>
  120. <a-tab-pane tab="${sub.ftlDescription}" :key="refKeys[${sub_index}]" :forceRender="true">
  121. <${Format.humpToShortbar(sub.entityName)}-form ref="${sub.entityName?uncap_first}Form" @validateError="validateError" :disabled="formDisabled"></${Format.humpToShortbar(sub.entityName)}-form>
  122. </a-tab-pane>
  123. <#else>
  124. <a-tab-pane tab="${sub.ftlDescription}" :key="refKeys[${sub_index}]" :forceRender="true">
  125. <j-vxe-table
  126. keep-source
  127. :ref="refKeys[${sub_index}]"
  128. :loading="${sub.entityName?uncap_first}Table.loading"
  129. :columns="${sub.entityName?uncap_first}Table.columns"
  130. :dataSource="${sub.entityName?uncap_first}Table.dataSource"
  131. :maxHeight="300"
  132. :disabled="formDisabled"
  133. :rowNumber="true"
  134. :rowSelection="true"
  135. :toolbar="true"
  136. />
  137. </a-tab-pane>
  138. </#if>
  139. </#list>
  140. </a-tabs>
  141. <#if bpm_flag>
  142. <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
  143. </#if>
  144. </a-spin>
  145. </template>
  146. <script>
  147. import { getAction } from '@/api/manage'
  148. import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  149. import { JVXETypes } from '@/components/jeecg/JVxeTable'
  150. import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  151. import { validateDuplicateValue } from '@/utils/util'
  152. import JFormContainer from '@/components/jeecg/JFormContainer'
  153. <#list subTables as sub>
  154. <#if sub.foreignRelationType =='1'>
  155. import ${sub.entityName}Form from './${sub.entityName}Form.vue'
  156. </#if>
  157. </#list>
  158. export default {
  159. name: '${entityName}Form',
  160. mixins: [JVxeTableModelMixin],
  161. components: {
  162. JFormContainer,
  163. <#list subTables as sub>
  164. <#if sub.foreignRelationType =='1'>
  165. ${sub.entityName}Form,
  166. </#if>
  167. </#list>
  168. },
  169. data() {
  170. return {
  171. labelCol: {
  172. xs: { span: 24 },
  173. sm: { span: 6 },
  174. },
  175. wrapperCol: {
  176. xs: { span: 24 },
  177. sm: { span: 16 },
  178. },
  179. labelCol2: {
  180. xs: { span: 24 },
  181. sm: { span: 3 },
  182. },
  183. wrapperCol2: {
  184. xs: { span: 24 },
  185. sm: { span: 20 },
  186. },
  187. model:{
  188. <#include "/common/init/initValue.ftl">
  189. },
  190. // 新增时子表默认添加几行空数据
  191. addDefaultRowNum: 1,
  192. <#include "/common/validatorRulesTemplate/main.ftl">
  193. refKeys: [<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>],
  194. <#assign hasOne2Many = false>
  195. tableKeys:[<#list subTables as sub><#if sub.foreignRelationType =='0'>'${sub.entityName?uncap_first}', <#assign hasOne2Many = true></#if></#list>],
  196. activeKey: '${subTables[0].entityName?uncap_first}',
  197. <#list subTables as sub><#rt/>
  198. // ${sub.ftlDescription}
  199. ${sub.entityName?uncap_first}Table: {
  200. loading: false,
  201. dataSource: [],
  202. columns: [
  203. <#if sub.foreignRelationType =='0'>
  204. <#assign popupBackFields = "">
  205. <#-- 循环子表的列 开始 -->
  206. <#list sub.colums as col><#rt/>
  207. <#if col.isShow =='Y'>
  208. <#if col.filedComment !='外键' >
  209. {
  210. title: '${col.filedComment}',
  211. key: '${autoStringSuffixForModel(col)}',
  212. <#if col.classType =='date'>
  213. type: JVXETypes.date,
  214. <#if col.readonly=='Y'>
  215. disabled:true,
  216. </#if>
  217. <#elseif col.classType =='datetime'>
  218. type: JVXETypes.datetime,
  219. <#if col.readonly=='Y'>
  220. disabled:true,
  221. </#if>
  222. <#elseif col.classType =='textarea'>
  223. type: JVXETypes.textarea,
  224. <#if col.readonly=='Y'>
  225. disabled:true,
  226. </#if>
  227. <#elseif "int,decimal,double,"?contains(col.classType)>
  228. type: JVXETypes.inputNumber,
  229. <#if col.readonly=='Y'>
  230. disabled:true,
  231. </#if>
  232. <#elseif col.classType =='list' || col.classType =='radio'>
  233. type: JVXETypes.select,
  234. options:[],
  235. <#if col.dictTable?default("")?trim?length gt 1>
  236. dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
  237. <#else>
  238. dictCode:"${col.dictField}",
  239. </#if>
  240. <#if col.readonly=='Y'>
  241. disabled:true,
  242. </#if>
  243. <#elseif col.classType =='list_multi' || col.classType =='checkbox'>
  244. type: JVXETypes.selectMultiple,
  245. options:[],
  246. <#if col.dictTable?default("")?trim?length gt 1>
  247. dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
  248. <#else>
  249. dictCode:"${col.dictField}",
  250. </#if>
  251. <#if col.readonly=='Y'>
  252. disabled:true,
  253. </#if>
  254. <#elseif col.classType =='sel_search'>
  255. type: JVXETypes.selectSearch,
  256. <#if col.dictTable?default("")?trim?length gt 1>
  257. dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
  258. <#else>
  259. dictCode:"${col.dictField}",
  260. </#if>
  261. <#if col.readonly=='Y'>
  262. disabled:true,
  263. </#if>
  264. <#elseif col.classType =='image'>
  265. type: JVXETypes.image,
  266. token:true,
  267. responseName:"message",
  268. <#if col.readonly=='Y'>
  269. disabled:true,
  270. </#if>
  271. <#if col.uploadnum??>
  272. number: ${col.uploadnum},
  273. </#if>
  274. <#elseif col.classType =='file'>
  275. type: JVXETypes.file,
  276. token:true,
  277. responseName:"message",
  278. <#if col.readonly=='Y'>
  279. disabled:true,
  280. </#if>
  281. <#if col.uploadnum??>
  282. number: ${col.uploadnum},
  283. </#if>
  284. <#elseif col.classType =='switch'>
  285. type: JVXETypes.checkbox,
  286. <#if col.dictField == 'is_open'>
  287. customValue: ['Y', 'N'],
  288. <#else>
  289. customValue: ${col.dictField},
  290. </#if>
  291. <#if col.readonly=='Y'>
  292. disabled:true,
  293. </#if>
  294. <#elseif col.classType =='popup'>
  295. <#if popupBackFields?length gt 0>
  296. <#assign popupBackFields = "${popupBackFields}"+","+"${col.dictText}">
  297. <#else>
  298. <#assign popupBackFields = "${col.dictText}">
  299. </#if>
  300. type: JVXETypes.popup,
  301. popupCode:"${col.dictTable}",
  302. field:"${col.dictField}",
  303. orgFields:"${col.dictField}",
  304. destFields:"${Format.underlineToHump(col.dictText)}",
  305. <#if col.readonly=='Y'>
  306. disabled:true,
  307. </#if>
  308. <#else>
  309. type: JVXETypes.input,
  310. <#if col.readonly=='Y'>
  311. disabled:true,
  312. </#if>
  313. </#if>
  314. <#if col.classType =='list_multi' || col.classType =='checkbox'>
  315. width:"250px",
  316. <#else>
  317. width:"200px",
  318. </#if>
  319. <#if col.classType =='file'>
  320. placeholder: '请选择文件',
  321. <#else>
  322. placeholder: '请输入${'$'}{title}',
  323. </#if>
  324. <#if col.defaultVal??>
  325. <#if col.fieldDbType=="BigDecimal" || col.fieldDbType=="double" || col.fieldDbType=="int">
  326. defaultValue:${col.defaultVal},
  327. <#else>
  328. defaultValue:"${col.defaultVal}",
  329. </#if>
  330. <#else>
  331. defaultValue:'',
  332. </#if>
  333. <#-- 子表的校验 -->
  334. <#assign subFieldValidType = col.fieldValidType!''>
  335. <#-- 非空校验 -->
  336. <#if col.nullable == 'N' || subFieldValidType == '*'>
  337. validateRules: [{ required: true, message: '${'$'}{title}不能为空' }],
  338. <#-- 其他情况下,只要有值就被认为是正则校验 -->
  339. <#elseif subFieldValidType?length gt 0>
  340. <#assign subMessage = '格式不正确'>
  341. <#if subFieldValidType == 'only' >
  342. <#assign subMessage = '不能重复'>
  343. </#if>
  344. validateRules: [{ pattern: "${subFieldValidType}", message: "${'$'}{title}${subMessage}" }],
  345. </#if>
  346. },
  347. </#if>
  348. </#if>
  349. </#list>
  350. <#-- 循环子表的列 结束 -->
  351. <#-- 处理popup的隐藏列 -->
  352. <#if popupBackFields?length gt 0>
  353. <#list popupBackFields?split(",") as item>
  354. <#if item?length gt 0>
  355. <#assign tempItemFlag = true>
  356. <#list sub.colums as col>
  357. <#if col.isShow =='Y' && col.fieldName == item>
  358. <#assign tempItemFlag = false>
  359. </#if>
  360. </#list>
  361. <#if tempItemFlag>
  362. {
  363. title: '${item}',
  364. key: '${item}',
  365. type:"hidden"
  366. },
  367. </#if>
  368. </#if>
  369. </#list>
  370. </#if>
  371. </#if>
  372. ]
  373. },
  374. </#list>
  375. url: {
  376. add: "/${entityPackage}/${entityName?uncap_first}/add",
  377. edit: "/${entityPackage}/${entityName?uncap_first}/edit",
  378. queryById: "/${entityPackage}/${entityName?uncap_first}/queryById",
  379. <#list subTables as sub><#rt/>
  380. ${sub.entityName?uncap_first}: {
  381. list: '/${entityPackage}/${entityName?uncap_first}/query${sub.entityName}ByMainId'
  382. },
  383. </#list>
  384. }
  385. }
  386. },
  387. props: {
  388. <#if bpm_flag>
  389. //流程表单data
  390. formData: {
  391. type: Object,
  392. default: ()=>{},
  393. required: false
  394. },
  395. //表单模式:false流程表单 true普通表单
  396. formBpm: {
  397. type: Boolean,
  398. default: false,
  399. required: false
  400. },
  401. </#if>
  402. //表单禁用
  403. disabled: {
  404. type: Boolean,
  405. default: false,
  406. required: false
  407. }
  408. },
  409. computed: {
  410. formDisabled(){
  411. <#if bpm_flag>
  412. if(this.formBpm===true){
  413. if(this.formData.disabled===false){
  414. return false
  415. }
  416. return true
  417. }
  418. </#if>
  419. return this.disabled
  420. },
  421. <#if bpm_flag>
  422. showFlowSubmitButton(){
  423. if(this.formBpm===true){
  424. if(this.formData.disabled===false){
  425. return true
  426. }
  427. }
  428. return false
  429. }
  430. </#if>
  431. },
  432. created () {
  433. <#if bpm_flag>
  434. //如果是流程中表单,则需要加载流程表单data
  435. this.showFlowData();
  436. </#if>
  437. },
  438. methods: {
  439. addBefore(){
  440. <#list subTables as sub><#rt/>
  441. <#if sub.foreignRelationType =='1'>
  442. this.$refs.${sub.entityName?uncap_first}Form.clearFormData()
  443. <#else>
  444. this.${sub.entityName?uncap_first}Table.dataSource=[]
  445. </#if>
  446. </#list>
  447. },
  448. getAllTable() {
  449. <#if hasOne2Many==true>
  450. let values = this.tableKeys.map(key => getRefPromise(this, key))
  451. return Promise.all(values)
  452. <#else>
  453. return new Promise(resolve => {
  454. resolve([]);
  455. })
  456. </#if>
  457. },
  458. /** 调用完edit()方法之后会自动调用此方法 */
  459. editAfter() {
  460. this.$nextTick(() => {
  461. <#list subTables as sub><#rt/>
  462. <#if sub.foreignRelationType =='1'>
  463. this.$refs.${sub.entityName?uncap_first}Form.initFormData(this.url.${sub.entityName?uncap_first}.list,this.model.id)
  464. </#if>
  465. </#list>
  466. })
  467. // 加载子表数据
  468. if (this.model.id) {
  469. let params = { id: this.model.id }
  470. <#list subTables as sub><#rt/>
  471. <#if sub.foreignRelationType =='0'>
  472. this.requestSubTableData(this.url.${sub.entityName?uncap_first}.list, params, this.${sub.entityName?uncap_first}Table)
  473. </#if>
  474. </#list>
  475. }
  476. },
  477. //校验所有一对一子表表单
  478. validateSubForm(allValues){
  479. return new Promise((resolve,reject)=>{
  480. Promise.all([
  481. <#list subTables as sub><#rt/>
  482. <#if sub.foreignRelationType =='1'>
  483. this.$refs.${sub.entityName?uncap_first}Form.validate(${sub_index}),
  484. </#if>
  485. </#list>
  486. ]).then(() => {
  487. resolve(allValues)
  488. }).catch(e => {
  489. if (e.error === VALIDATE_FAILED) {
  490. // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
  491. this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
  492. } else {
  493. console.error(e)
  494. }
  495. })
  496. })
  497. },
  498. /** 整理成formData */
  499. classifyIntoFormData(allValues) {
  500. let main = Object.assign(this.model, allValues.formValue)
  501. return {
  502. ...main, // 展开
  503. <#assign subManyIndex = 0>
  504. <#list subTables as sub><#rt/>
  505. <#if sub.foreignRelationType =='0'>
  506. ${sub.entityName?uncap_first}List: allValues.tablesValue[${subManyIndex}].tableData,
  507. <#assign subManyIndex = subManyIndex+1>
  508. <#else>
  509. ${sub.entityName?uncap_first}List: this.$refs.${sub.entityName?uncap_first}Form.getFormData(),
  510. </#if>
  511. </#list>
  512. }
  513. },
  514. <#if bpm_flag>
  515. //渲染流程表单数据
  516. showFlowData(){
  517. if(this.formBpm === true){
  518. let params = {id:this.formData.dataId};
  519. getAction(this.url.queryById,params).then((res)=>{
  520. if(res.success){
  521. this.edit (res.result);
  522. }
  523. })
  524. }
  525. },
  526. </#if>
  527. validateError(msg){
  528. this.$message.error(msg)
  529. },
  530. <#if form_popup>
  531. popupCallback(value,row){
  532. this.model = Object.assign(this.model, row);
  533. },
  534. </#if>
  535. <#if form_cat_tree>
  536. handleCategoryChange(value,backObj){
  537. this.model = Object.assign(this.model, backObj);
  538. }
  539. </#if>
  540. }
  541. }
  542. </script>
  543. <style scoped>
  544. </style>