22e3d078f89502b41bfd92766552d27cb309805e.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <a-spin :spinning="confirmLoading">
  3. <j-form-container :disabled="formDisabled">
  4. <!-- 主表单区域 -->
  5. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  6. <a-row>
  7. <a-col :span="12" >
  8. <a-form-model-item label="项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmmc">
  9. <a-input v-model="model.xmmc" placeholder="请输入项目名称" ></a-input>
  10. </a-form-model-item>
  11. </a-col>
  12. <a-col :span="12" >
  13. <a-form-model-item label="项目类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmlx">
  14. <j-dict-select-tag type="list" v-model="model.xmlx" dictCode="xmlx" placeholder="请选择项目类型" />
  15. </a-form-model-item>
  16. </a-col>
  17. <a-col :span="12" >
  18. <a-form-model-item label="所在河流" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="szhl">
  19. <a-input v-model="model.szhl" placeholder="所在河流" ></a-input>
  20. </a-form-model-item>
  21. </a-col>
  22. <a-col :span="12" >
  23. <a-form-model-item label="行政区划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xzqh">
  24. <j-area-linkage type="cascader" v-model="model.xzqh" placeholder="请输入省市区" />
  25. </a-form-model-item>
  26. </a-col>
  27. <a-col :span="12" >
  28. <a-form-model-item label="县级区划代码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xjqhdm">
  29. <a-input v-model="model.xjqhdm" placeholder="请输入县级区划代码" ></a-input>
  30. </a-form-model-item>
  31. </a-col>
  32. <a-col :span="12" >
  33. <a-form-model-item label="项目负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmfzr">
  34. <a-input v-model="model.xmfzr" placeholder="请输入项目负责人" ></a-input>
  35. </a-form-model-item>
  36. </a-col>
  37. <a-col :span="12" >
  38. <a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dha">
  39. <a-input v-model="model.dha" placeholder="请输入电话" ></a-input>
  40. </a-form-model-item>
  41. </a-col>
  42. <a-col :span="12" >
  43. <a-form-model-item label="立项情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lxqk">
  44. <a-input v-model="model.lxqk" placeholder="请输入立项情况" ></a-input>
  45. </a-form-model-item>
  46. </a-col>
  47. <a-col :span="12" >
  48. <a-form-model-item label="防洪标准" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fhbz">
  49. <a-input v-model="model.fhbz" placeholder="请输入防洪标准" ></a-input>
  50. </a-form-model-item>
  51. </a-col>
  52. <a-col :span="12" >
  53. <a-form-model-item label="建设状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jszt">
  54. <j-dict-select-tag type="list" v-model="model.jszt" dictCode="gcjsqk" placeholder="请选择建设状态" />
  55. </a-form-model-item>
  56. </a-col>
  57. <a-col :span="12" >
  58. <a-form-model-item label="审批状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spzt">
  59. <j-dict-select-tag type="list" v-model="model.spzt" dictCode="spzt" placeholder="请选择审批状态" />
  60. </a-form-model-item>
  61. </a-col>
  62. <a-col :span="12" >
  63. <a-form-model-item label="批复年度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pfnd">
  64. <a-input v-model="model.pfnd" placeholder="请输入批复年度" ></a-input>
  65. </a-form-model-item>
  66. </a-col>
  67. <a-col :span="12" >
  68. <a-form-model-item label="开工年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kgny">
  69. <a-input v-model="model.kgny" placeholder="请输入开工年月" ></a-input>
  70. </a-form-model-item>
  71. </a-col>
  72. <a-col :span="12" >
  73. <a-form-model-item label="建成年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jcny">
  74. <a-input v-model="model.jcny" placeholder="请输入建成年月" ></a-input>
  75. </a-form-model-item>
  76. </a-col>
  77. <a-col :span="12" >
  78. <a-form-model-item label="工期计划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gqjh">
  79. <a-input v-model="model.gqjh" placeholder="请输入工期计划" ></a-input>
  80. </a-form-model-item>
  81. </a-col>
  82. <a-col :span="12" >
  83. <a-form-model-item label="是否为评估保留项目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfwpgblxm">
  84. <j-dict-select-tag type="list" v-model="model.sfwpgblxm" dictCode="yn" placeholder="请选择是否为评估保留项目" />
  85. </a-form-model-item>
  86. </a-col>
  87. <a-col :span="12" >
  88. <a-form-model-item label="管理单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gldw">
  89. <a-input v-model="model.gldw" placeholder="请输入管理单位" ></a-input>
  90. </a-form-model-item>
  91. </a-col>
  92. <a-col :span="12" >
  93. <a-form-model-item label="主管部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zgbm">
  94. <a-input v-model="model.zgbm" placeholder="请输入主管部门" ></a-input>
  95. </a-form-model-item>
  96. </a-col>
  97. <a-col :span="12" >
  98. <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bz">
  99. <a-input v-model="model.bz" placeholder="请输入备注" ></a-input>
  100. </a-form-model-item>
  101. </a-col>
  102. </a-row>
  103. </a-form-model>
  104. </j-form-container>
  105. <!-- 子表单区域 -->
  106. <a-tabs v-model="activeKey" @change="handleChangeTabs">
  107. <a-tab-pane tab="监管记录" :key="refKeys[0]" :forceRender="true">
  108. <j-editable-table
  109. :ref="refKeys[0]"
  110. :loading="rmJgjlbTable.loading"
  111. :columns="rmJgjlbTable.columns"
  112. :dataSource="rmJgjlbTable.dataSource"
  113. :maxHeight="300"
  114. :disabled="formDisabled"
  115. :rowNumber="true"
  116. :rowSelection="true"
  117. :actionButton="true"/>
  118. </a-tab-pane>
  119. </a-tabs>
  120. </a-spin>
  121. </template>
  122. <script>
  123. import { getAction } from '@/api/manage'
  124. import { FormTypes,getRefPromise,VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
  125. import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
  126. import { validateDuplicateValue } from '@/utils/util'
  127. export default {
  128. name: 'RmShxmxxbForm',
  129. mixins: [JEditableTableModelMixin],
  130. components: {
  131. },
  132. data() {
  133. return {
  134. labelCol: {
  135. xs: { span: 24 },
  136. sm: { span: 6 },
  137. },
  138. wrapperCol: {
  139. xs: { span: 24 },
  140. sm: { span: 16 },
  141. },
  142. labelCol2: {
  143. xs: { span: 24 },
  144. sm: { span: 3 },
  145. },
  146. wrapperCol2: {
  147. xs: { span: 24 },
  148. sm: { span: 20 },
  149. },
  150. model:{
  151. },
  152. // 新增时子表默认添加几行空数据
  153. addDefaultRowNum: 1,
  154. validatorRules: {
  155. xmmc:[
  156. { required: true, message: '请输入项目名称!'},
  157. ],
  158. xmlx:[
  159. { required: true, message: '请输入项目类型!'},
  160. ],
  161. jszt:[{
  162. required: true, message: '请输入建设状态!'
  163. }]
  164. },
  165. refKeys: ['rmJgjlb', ],
  166. tableKeys:['rmJgjlb', ],
  167. activeKey: 'rmJgjlb',
  168. // 监管记录
  169. rmJgjlbTable: {
  170. loading: false,
  171. dataSource: [],
  172. columns: [
  173. {
  174. title: '建设项目名称',
  175. key: 'jsxmmc',
  176. type: FormTypes.input,
  177. width:"200px",
  178. placeholder: '请输入${title}',
  179. defaultValue:'',
  180. },
  181. {
  182. title: '建设项目所在地',
  183. key: 'jsxmszd',
  184. type: FormTypes.input,
  185. width:"200px",
  186. placeholder: '请输入${title}',
  187. defaultValue:'',
  188. },
  189. {
  190. title: '施工现场是否符合要求',
  191. key: 'sgxcsffhyq',
  192. type: FormTypes.input,
  193. dictCode:"yn",
  194. width:"200px",
  195. placeholder: '请输入${title}',
  196. defaultValue:'',
  197. },
  198. {
  199. title: '建设情况',
  200. key: 'jsqk',
  201. type: FormTypes.select,
  202. dictCode:"gcjsqk",
  203. width:"200px",
  204. placeholder: '请输入${title}',
  205. defaultValue:'',
  206. },
  207. {
  208. title: '存在问题及处理情况',
  209. key: 'czwtjclqk',
  210. type: FormTypes.input,
  211. width:"200px",
  212. placeholder: '请输入${title}',
  213. defaultValue:'',
  214. },
  215. ]
  216. },
  217. url: {
  218. add: "/hzz.shjsgc.shxmxx/rmShxmxxb/add",
  219. edit: "/hzz.shjsgc.shxmxx/rmShxmxxb/edit",
  220. queryById: "/hzz.shjsgc.shxmxx/rmShxmxxb/queryById",
  221. rmJgjlb: {
  222. list: '/hzz.shjsgc.shxmxx/rmShxmxxb/queryRmJgjlbByMainId'
  223. },
  224. }
  225. }
  226. },
  227. props: {
  228. //表单禁用
  229. disabled: {
  230. type: Boolean,
  231. default: false,
  232. required: false
  233. }
  234. },
  235. computed: {
  236. formDisabled(){
  237. return this.disabled
  238. },
  239. },
  240. created () {
  241. },
  242. methods: {
  243. addBefore(){
  244. this.rmJgjlbTable.dataSource=[]
  245. },
  246. getAllTable() {
  247. let values = this.tableKeys.map(key => getRefPromise(this, key))
  248. return Promise.all(values)
  249. },
  250. /** 调用完edit()方法之后会自动调用此方法 */
  251. editAfter() {
  252. this.$nextTick(() => {
  253. })
  254. // 加载子表数据
  255. if (this.model.id) {
  256. let params = { id: this.model.id }
  257. this.requestSubTableData(this.url.rmJgjlb.list, params, this.rmJgjlbTable)
  258. }
  259. },
  260. //校验所有一对一子表表单
  261. validateSubForm(allValues){
  262. return new Promise((resolve,reject)=>{
  263. Promise.all([
  264. ]).then(() => {
  265. resolve(allValues)
  266. }).catch(e => {
  267. if (e.error === VALIDATE_NO_PASSED) {
  268. // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
  269. this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
  270. } else {
  271. console.error(e)
  272. }
  273. })
  274. })
  275. },
  276. /** 整理成formData */
  277. classifyIntoFormData(allValues) {
  278. let main = Object.assign(this.model, allValues.formValue)
  279. return {
  280. ...main, // 展开
  281. rmJgjlbList: allValues.tablesValue[0].values,
  282. }
  283. },
  284. validateError(msg){
  285. this.$message.error(msg)
  286. },
  287. }
  288. }
  289. </script>
  290. <style scoped>
  291. </style>