grantEdit.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <template>
  2. <edit :visible='visible'>
  3. <template v-slot:form>
  4. <!-- 表头按钮-->
  5. <div class="form-toolbar hidden-print">
  6. <div class="ibps-toolbar">
  7. <div class="header" style="height: 30px;">
  8. <div class="buttons" style="float: right;margin-right:8%;">
  9. <el-button type="primary" icon="ibps-icon-lastfm" @click="sendBack()">退回</el-button>
  10. <el-button type="primary" icon="ibps-icon-send" @click="confirmSubmit()">提 交</el-button>
  11. <!-- <ibps-toolbar ref="toolbar" :actions="toolbars" @action-event="handleActionEvent" /> -->
  12. <el-button icon="el-icon-circle-close" type="danger" @click="closeDialog()">取 消</el-button>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- 标题 -->
  18. <div class="form-header">
  19. <div class="title ibps-tc">尺寸检测报告发放
  20. </div>
  21. </div>
  22. <div class="dynamic-form">
  23. <!--表头-->
  24. <el-form ref="form" v-loading="!visible" :rules="rules" :element-loading-text="$t('common.loading')"
  25. :model="form" label-width="180px">
  26. <el-row
  27. :gutter="0"
  28. justify="start"
  29. align="top"
  30. class="widget-col"
  31. type="flex"
  32. >
  33. <el-col :span="8">
  34. <el-form-item
  35. label="报告编号:"
  36. prop="baoGaoBianHao"><el-input
  37. v-model="models.baoGaoBianHao"
  38. placeholder="请输入"
  39. type="text"
  40. name="baoGaoBianHao"
  41. :autosize="autosize"
  42. :rows="3"
  43. :readonly="readonly"
  44. clearable
  45. :style="{width:width}"
  46. />
  47. </el-form-item>
  48. <!-- <el-form-item
  49. label="委托单号:"
  50. prop="weiTuoDanHao"><el-input
  51. v-model="models.weiTuoDanHao"
  52. placeholder="请输入"
  53. type="text"
  54. name="weiTuoDanHao"
  55. :autosize="autosize"
  56. :rows="3"
  57. :readonly="readonly"
  58. clearable
  59. :style="{width:width}"
  60. />
  61. </el-form-item> -->
  62. </el-col>
  63. <el-col :span="8">
  64. <el-form-item
  65. label="委托部门"
  66. prop="weiTuoBuMen">
  67. <el-select
  68. v-model="models.weiTuoBuMen"
  69. placeholder="请选择"
  70. name="weiTuoBuMen"
  71. :style="{width:width}"
  72. clearable
  73. >
  74. <el-option
  75. key="1"
  76. label="选项一"
  77. value="1"
  78. />
  79. <el-option
  80. key="2"
  81. label="选项二"
  82. value="2"
  83. />
  84. </el-select>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. </el-col>
  89. </el-row>
  90. <el-form-item
  91. label="主键"
  92. prop="id"><el-input
  93. v-model="models.id"
  94. placeholder="请输入"
  95. type="text"
  96. name="id"
  97. :autosize="autosize"
  98. :rows="3"
  99. :readonly="readonly"
  100. clearable
  101. :style="{width:width}"
  102. />
  103. </el-form-item>
  104. <!-- <el-form-item
  105. label="委托id"
  106. prop="weiTuoId"><el-input
  107. v-model="models.jcwt.id"
  108. placeholder="请输入"
  109. type="text"
  110. name="weiTuoId"
  111. :autosize="autosize"
  112. :rows="3"
  113. :readonly="readonly"
  114. clearable
  115. :style="{width:width}"
  116. />
  117. </el-form-item> -->
  118. <el-form-item label="">
  119. 报告下载打印:
  120. <div style="height: 800px">
  121. <iframe
  122. :src="getImgUrl(rqBaobiao)"
  123. :height="'100%'" :width="'90%'" frameborder="0" scrolling="no" />
  124. </div>
  125. </el-form-item>
  126. <el-form-item
  127. label="快照开关"
  128. prop="kuaiZhaoKaiGuan">
  129. <el-switch
  130. v-model="models.kuaiZhaoKaiGuan"
  131. :width="width"
  132. active-value="Y"
  133. inactive-value="N"
  134. active-text="盖章"
  135. inactive-text="不盖章"
  136. active-color=""
  137. inactive-color=""
  138. />
  139. </el-form-item>
  140. <el-form-item
  141. label="发放盖章报告电子版上传"
  142. prop="fuJian">
  143. <ibps-attachment
  144. v-model="models.fuJian"
  145. placeholder="请选择"
  146. :download="true"
  147. accept="*"
  148. :multiple="true"
  149. upload-type="attachment"
  150. store="id"
  151. media-type=""
  152. media=""
  153. :style="{width:width}"
  154. />
  155. </el-form-item>
  156. <el-form-item
  157. label="取报告人签名"
  158. prop="quBaoGaoRenQianMi">
  159. <ibps-signature
  160. v-model="models.quBaoGaoRenQianMi"
  161. placeholder="请在这里输入您的签名"
  162. :style="{width:width}"
  163. />
  164. </el-form-item>
  165. <el-form-item
  166. label="报告发放备注"
  167. prop="boHuiYuanYin">
  168. <el-input
  169. v-model="models.boHuiYuanYin"
  170. placeholder="请输入"
  171. type="textarea"
  172. name="kaoHeYiJian"
  173. :autosize="autosize"
  174. :rows="3"
  175. clearable
  176. :style="{width:width}"
  177. />
  178. </el-form-item>
  179. <el-form-item>
  180. <ibps-toolbar
  181. ref="toolbar"
  182. :actions="actions"
  183. @action-event="handleButtonEvent"
  184. />
  185. </el-form-item>
  186. </el-form>
  187. <div class="form-header">
  188. <div style="text-align: center;height:150px;width:1080px">&nbsp;&nbsp;&nbsp;</div>
  189. </div>
  190. </div>
  191. </div>
  192. </template>
  193. </edit>
  194. </template>
  195. <script>
  196. import {
  197. validateRequired
  198. } from '@/utils/validate' //参数校验
  199. import IbpsUserSelector from '@/business/platform/org/selector' //用户 /组织 / 岗位选择框
  200. import IbpsAttachment from '@/business/platform/file/attachment/selector' //文件选择框
  201. import edit from '@/components/jbd-edit' //编辑对话框
  202. import relevanceTable from '@/business/platform/form/formrender/dynamic-form/mixins/relevanceTable' //表头懒加载
  203. import StatisOrRecordTable from '@/business/platform/form/formrender/dynamic-form/mixins/StatisOrRecordTable.vue' //表头统计 / 记录盒子页
  204. import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
  205. import IbpsSignature from '@/business/platform/form/formrender/dynamic-form/components/signature'
  206. import IbpsAutoNumber from '@/business/platform/system/identity/auto-number'
  207. import IbpsLink from '@/components/ibps-link'
  208. import { selectById,saveFf,rejectedFf } from '@/api/detection/universalCRUD.js'
  209. export default {
  210. components: {
  211. 'ibps-attachment': IbpsAttachment,
  212. 'ibps-auto-number': IbpsAutoNumber,
  213. 'ibps-link-data': IbpsLinkData,
  214. 'ibps-user-selector': IbpsUserSelector,
  215. 'ibps-signature': IbpsSignature,
  216. 'ibps-link': IbpsLink,
  217. edit
  218. },
  219. props: {
  220. visible: Boolean,
  221. title: String,
  222. id: String,
  223. readonly: Boolean,
  224. openType: String,
  225. },
  226. data() {
  227. return {
  228. width: '380px',
  229. widthOneCol: '1030px',
  230. readonlyText: false,
  231. autosize: '',
  232. models: {
  233. id:"781b933b00d04529b257975df605f08e",
  234. //jcwt:{
  235. // "id": "",
  236. //"weiTuoId": "",
  237. //"baoGaoBianHao": "",
  238. boHuiYuanYin:"",
  239. // },
  240. },
  241. formName: 'form',
  242. defaultForm: {},
  243. defaulRules: {},
  244. form: {
  245. id: ''
  246. },
  247. toolbars: [{
  248. key: 'save',
  249. hidden: () => {
  250. return this.readonly
  251. }
  252. }, ],
  253. rules: { //参数验证
  254. // id: [{ required: true, message: this.$t('validate.required') }, { validator: validateKey, trigger: 'blur' }],
  255. },
  256. }
  257. },
  258. created() {
  259. if(this.openType=='edit'){
  260. let data={id:this.id}
  261. let a="{data:'"+JSON.stringify(data)+"'}"
  262. selectById('sysjcwtdb','selectById',a).then(response => {
  263. let dbData = response.variables.data
  264. Object.assign(this.models,dbData)
  265. })
  266. this.toolbars.push( { key: 'cancel' })
  267. }
  268. // this.toolbars.push({
  269. // key: 'cancel'
  270. // })
  271. // this.defaultForm = JSON.parse(JSON.stringify(this.form)) //初始化加载默认表单
  272. // this.defaulRules = JSON.parse(JSON.stringify(this.rules)) //初始化加载默认参数验证
  273. },
  274. methods: {
  275. // //退回
  276. sendBack(){
  277. let data={
  278. userId:this.$store.getters.userInfo.user.id,
  279. userName:this.$store.getters.userInfo.user.name,
  280. entity:
  281. {
  282. id:this.id,
  283. boHuiYuanYin:this.models.boHuiYuanYin
  284. }
  285. }
  286. let paramss = "{data:'"+JSON.stringify(data)+"'}"
  287. console.log("pass8888",paramss)
  288. rejectedFf('sysbggl','rejectedff',paramss).then(response => {
  289. this.$emit('close', false)
  290. this.$message("已退回!")
  291. this.$emit('loadData')
  292. })
  293. },
  294. // 提交
  295. confirmSubmit(){
  296. let data={
  297. userId:this.$store.getters.userInfo.user.id,
  298. userName:this.$store.getters.userInfo.user.name,
  299. entity:
  300. {
  301. id:this.id,
  302. boHuiYuanYin:this.models.boHuiYuanYin
  303. }
  304. }
  305. let params = "{data:'"+JSON.stringify(data)+"'}"
  306. console.log("pas",params)
  307. saveFf('sysbggl','saveff',params).then(response => {
  308. this.$emit('close', false)
  309. this.$message("提交成功!")
  310. this.$emit('loadData')
  311. })
  312. },
  313. //查阅报表
  314. getImgUrl(rqBaobiao){
  315. let data=this.id
  316. return null
  317. },
  318. // 取消按钮 , 调用父组件关闭当前对话框,同时刷新当前表单页
  319. closeDialog() {
  320. this.$emit('close', false)
  321. this.$refs[this.formName].resetFields()
  322. },
  323. /**
  324. * 获取表单数据
  325. */
  326. getFormData() {
  327. // 1、权限校验, 如必填 等
  328. if (this.readonly) {
  329. this.rules = {}
  330. } else {
  331. this.rules = this.defaulRules
  332. }
  333. // 2、是否清空表单原内容
  334. if (this.$utils.isEmpty(this.formId)) {
  335. // 重置表单
  336. this.form = JSON.parse(JSON.stringify(this.defaultForm))
  337. this.formValidate()
  338. return
  339. }
  340. //3、获取传入的表单
  341. },
  342. // handleActionEvent({
  343. // key
  344. // }) {
  345. // console.log("key",key);
  346. // switch (key) {
  347. // case 'edit':
  348. // console.info('修改')
  349. // break
  350. // case 'remove':
  351. // console.info('删除')
  352. // break
  353. // case 'cancel':
  354. // this.closeDialog()
  355. // break
  356. // // case 'custom':
  357. // // // 新增自定义对话框按钮
  358. // // break
  359. // default:
  360. // break
  361. // }
  362. // },
  363. /**
  364. * 表单验证
  365. */
  366. formValidate() {
  367. if (this.readonly) return
  368. this.$nextTick(() => {
  369. this.$refs[this.formName].validate(() => {})
  370. })
  371. }
  372. }
  373. }
  374. </script>
  375. <style lang="scss">
  376. .jbd-title-cont {
  377. text-align: center;
  378. font-weight: bold;
  379. background-color: #FFFFFF !important;
  380. width: 100;
  381. font-size: 18px;
  382. }
  383. .form-header {
  384. border-bottom: 1px solid #2b34410d;
  385. margin-bottom: 5px;
  386. .title {
  387. font-weight: bold;
  388. font-size: 22px;
  389. font-family: SimHei;
  390. color: #222;
  391. text-align: center;
  392. padding: 8px 10px 10px;
  393. margin: 0;
  394. }
  395. }
  396. .dynamic-form {
  397. .el-input {
  398. width: 100%;
  399. }
  400. .el-select {
  401. width: 100%;
  402. }
  403. .el-collapse-item__header.is-active {
  404. border-bottom: 1px solid #EBEEF5;
  405. margin-bottom: 5px;
  406. }
  407. .form-header {
  408. border-bottom: 1px solid #2b34410d;
  409. margin-bottom: 5px;
  410. .title {
  411. font-size: 16px;
  412. font-weight: bold;
  413. color: #222;
  414. text-align: left;
  415. padding: 8px 10px 10px;
  416. margin: 0;
  417. }
  418. .desc {
  419. word-wrap: break-word;
  420. word-break: normal;
  421. text-indent: 0;
  422. line-height: 1.6;
  423. margin: 0 0 11px;
  424. padding: 3px 30px 8px;
  425. }
  426. }
  427. .dynamic-form-table-item__readonly {
  428. margin-bottom: 0;
  429. }
  430. //===================border-form====================
  431. .ibps-border-form {
  432. border: 1px solid #cfd7e5;
  433. .el-form-item {
  434. border-top: 1px solid #cfd7e5;
  435. }
  436. .el-form-item__content:before {
  437. width: 1px;
  438. background: #cfd7e5;
  439. display: block;
  440. content: "";
  441. position: absolute;
  442. left: 0;
  443. top: 0;
  444. bottom: -20px;
  445. }
  446. .el-form-item__content .el-form-item__error {
  447. left: 5px
  448. }
  449. .el-form--label-top .el-form-item__content:before,
  450. .no-label-form-item .el-form-item__content:before {
  451. background: transparent
  452. }
  453. .el-row+.el-row {
  454. border-top: 1px solid #cfd7e5
  455. }
  456. .el-col+.el-col {
  457. border-left: 1px solid #cfd7e5
  458. }
  459. .el-col {
  460. overflow: hidden
  461. }
  462. .el-form-item__content {
  463. padding: 5px;
  464. padding-bottom: 0
  465. }
  466. .el-form-item__label {
  467. padding: 5px
  468. }
  469. .el-table {
  470. .el-form-item {
  471. border-top: 0;
  472. }
  473. .el-form-item__content:before {
  474. width: 0;
  475. }
  476. .el-form-item__content {
  477. padding: 0;
  478. }
  479. }
  480. }
  481. }
  482. .dynamic-form-table {
  483. .panel-heading {
  484. border-bottom: 0;
  485. border-left: 1px solid #dde7ee;
  486. border-right: 1px solid #dde7ee;
  487. }
  488. .dynamic-form-table__inner {
  489. .panel-body {
  490. padding: 0;
  491. }
  492. }
  493. .dynamic-form-table__block {
  494. padding-bottom: 10px;
  495. .panel-body {
  496. border: 0px;
  497. }
  498. }
  499. .el-rate {
  500. position: relative;
  501. display: inline-block;
  502. }
  503. }
  504. .is-error {
  505. .dynamic-form-table {
  506. border: 1px solid #F56C6C;
  507. }
  508. }
  509. .is-required:not(.is-no-asterisk) {
  510. .dynamic-form-table__label:before {
  511. content: '*';
  512. color: #F56C6C;
  513. margin-right: 4px;
  514. }
  515. }
  516. </style>