华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1025 lines
38 KiB

  1. <template>
  2. <div>
  3. <div class="edit-container">
  4. <div class="edit-top">
  5. <div class="left-top">
  6. <img src="@/assets/images/back.png" @click="cancel()" />
  7. <div class="left-title"></div>
  8. </div>
  9. <div class="center-top">
  10. <div>
  11. <div :class="showIndex == 1 ? 'el-step__icon is-text is-finish' : 'el-step__icon is-text is-info'">
  12. <div class="el-step__icon-inner">1</div>
  13. </div>
  14. {{ $t('page.business.study.studyFormFill.jcsz') }}
  15. </div>
  16. <div class="line"></div>
  17. <div>
  18. <div :class="showIndex == 2 ? 'el-step__icon is-text is-finish' : 'el-step__icon is-text is-info'">
  19. <div class="el-step__icon-inner">2</div>
  20. </div>
  21. {{ $t('page.business.study.studyFormFill.bdtb') }}
  22. </div>
  23. </div>
  24. <div class="right-top">
  25. <el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
  26. <template v-if="showIndex == 1">
  27. <el-button @click="save">{{ $t('page.business.study.studyFormFill.zc') }}</el-button>
  28. <el-button type="primary" @click="next">{{ $t('page.business.study.studyFormFill.next') }}</el-button>
  29. </template>
  30. <template v-else>
  31. <el-button @click="showYjcc" v-if="form.templateShowYjcc == 10">{{
  32. $t('page.business.study.studyFormFill.yjcc')
  33. }}</el-button>
  34. <el-button @click="showSave">{{ $t('page.business.study.studyFormFill.save') }}</el-button>
  35. <el-button type="primary" v-if="form.blxjshzt != 10 && form.showBlxjsh == 10" @click="showTjsh">{{
  36. $t('page.business.study.studyFormFill.tjsh')
  37. }}</el-button>
  38. <el-button type="primary" v-else @click="showApprove">{{ $t('page.business.study.studyFormFill.submit')
  39. }}</el-button>
  40. <el-button type="primary" @click="pre">{{ $t('page.business.study.studyFormFill.pre') }}</el-button>
  41. </template>
  42. </div>
  43. </div>
  44. <div class="edit-content">
  45. <div class="content" style="width:60%" v-show="showIndex == 1">
  46. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  47. <el-row>
  48. <el-col :span="24">
  49. <el-form-item :label="bdmbTitle" prop="templateId">
  50. <SelectTemplate v-model="form.templateId" :disabled="form.id && form.id !== ''"
  51. :name="form.templateMc" :studyType="studyType" :studyFormType="studyFormType"
  52. @change="selectTemplateChange" :needPre="1" :selectedDeptId="selectedDeptId" />
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. <el-row>
  57. <el-col :span="24">
  58. <el-form-item :label="$t('page.business.form.bdmc')" prop="bdmc">
  59. <el-input type="text" v-model="form.bdmc" maxlength="50" :placeholder="$t('form.placeholderInput')" />
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="24">
  65. <el-form-item :label="$t('page.business.study.studyFormFill.sfbl')" prop="sfbl">
  66. <el-select v-model="form.sfbl" :placeholder="$t('form.placeholderSelect')" style="width: 100%;" @change="validForm">
  67. <el-option :label="$t('page.business.study.studyFormFill.yes')" value="是" />
  68. <el-option :label="$t('page.business.study.studyFormFill.no')" value="否" />
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. <el-row>
  74. <el-col :span="24">
  75. <el-form-item :label="$t('page.business.study.studyFormFill.bdsm')" prop="bdsm">
  76. <el-input type="textarea" v-model="form.bdsm" :rows="5" maxlength="500"
  77. :placeholder="$t('form.placeholderInput')">
  78. </el-input>
  79. </el-form-item>
  80. </el-col>
  81. </el-row>
  82. </el-form>
  83. </div>
  84. <div class="content" v-if="showIndex == 2 && templateData.templateId">
  85. <TemplateTable emitName="onFillCallback" @onFillCallback="onFillCallback" ref="templateTable"
  86. :sn="templateData.templateSn" :templateData="templateData" fillType="actFill" />
  87. </div>
  88. </div>
  89. </div>
  90. <el-dialog :title="$t('page.business.study.studyFormFill.tjjl')" :visible.sync="openApprove" width="1200px"
  91. append-to-body :close-on-click-modal="false">
  92. <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px" v-if="openApprove">
  93. <div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
  94. <el-row v-if="form.sftb == 1">
  95. <el-col :psna="24">
  96. <el-form-item>
  97. <div><el-checkbox v-model="formApprove.sfcz" @change="sfczChange">{{
  98. $t('page.business.study.studyFormFill.cz') }}</el-checkbox>
  99. <el-button type="primary" v-if="formApprove.sfcz" @click="addCz" style="margin-left: 10px;">{{
  100. $t('page.business.study.studyFormFill.tjcz') }}</el-button>
  101. </div>
  102. <template v-if="formApprove.sfcz">
  103. <div v-if="czlist.length > 0">
  104. <el-card class="box-card" v-for="(citem, cindex) in czlist" :key="'cz' + cindex"
  105. style="margin-top: 10px;">
  106. <div slot="header" class="clearfix">
  107. <div style="display: flex;justify-content: space-between;">
  108. <div style="display: flex;">
  109. <div> 处置方式</div>
  110. <div>
  111. <BusinessSelect v-model="citem.czfs" dictType="business_czfs" style="width: 200px;">
  112. </BusinessSelect>
  113. </div>
  114. </div>
  115. <div>
  116. <el-button type="danger" icon="el-icon-delete" circle @click="delcz(cindex)"></el-button>
  117. </div>
  118. </div>
  119. </div>
  120. <el-checkbox-group v-model="citem.list">
  121. <el-checkbox :label="item.bh" v-for="item in resource" :key="'icz' + item.bh"
  122. :disabled="getDisabledCz(item.bh, cindex)"></el-checkbox>
  123. </el-checkbox-group>
  124. </el-card>
  125. </div>
  126. </template>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :psna="24">
  130. <el-form-item>
  131. <div><el-checkbox v-model="formApprove.sfcc" @change="sfccChange">{{
  132. $t('page.business.study.studyFormFill.cc') }}</el-checkbox>
  133. <el-button type="primary" v-if="formApprove.sfcc" @click="addCc" style="margin-left: 10px;">{{
  134. $t('page.business.study.studyFormFill.tjcc') }}</el-button>
  135. </div>
  136. <template v-if="formApprove.sfcc">
  137. <div v-if="cclist.length > 0">
  138. <el-card class="box-card" v-for="(citem, cindex) in cclist" :key="'cz' + cindex"
  139. style="margin-top: 10px;">
  140. <div slot="header" class="clearfix">
  141. <div style="display: flex;justify-content: space-between;">
  142. <div style="display: flex;">
  143. <div style="display: flex;">
  144. <div> 存储位置</div>
  145. <div>
  146. <el-select v-model="citem.ccwz" :placeholder="$t('form.placeholderSelect')"
  147. @change="ccwzChange(cindex)" filterable>
  148. <el-option v-for="item in ccwzlist" :key="item.id" :label="item.bh" :value="item.id" />
  149. </el-select>
  150. </div>
  151. </div>
  152. <div style="display: flex; margin-left: 10px;">
  153. <div> 存储条件</div>
  154. <div>
  155. <BusinessSelect v-model="citem.cctj" dictType="business_cctj" :multiple="true"
  156. style="width: 200px;">
  157. </BusinessSelect>
  158. </div>
  159. </div>
  160. </div>
  161. <div>
  162. <el-button type="danger" icon="el-icon-delete" circle @click="delcc(cindex)"></el-button>
  163. </div>
  164. </div>
  165. </div>
  166. <el-checkbox-group v-model="citem.list">
  167. <el-checkbox :label="item.bh" v-for="item in resource" :key="'icz' + item.bh"
  168. :disabled="getDisabledCc(item.bh, cindex)"></el-checkbox>
  169. </el-checkbox-group>
  170. </el-card>
  171. </div>
  172. </template>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :psna="24">
  176. <el-form-item>
  177. <div>{{ $t('page.business.study.studyFormFill.yltj') }}</div>
  178. <div style=" display: flex; flex-wrap: wrap; gap: 16px;">
  179. <div v-for="(item, index) in resource" :key="'r' + index" style=" flex: 0 0 calc(50% - 11px);">
  180. <div style="display: flex;">
  181. <div> {{ item.bh }}</div>
  182. <div>
  183. <el-input type="number" v-model="item.syl" maxlength="50"
  184. style="width:100px; margin:0px 0px 0px 5px;" />
  185. </div>
  186. <div>
  187. <div style="width: 70px;">
  188. <BusinessSelect v-model="item.syldw" :showMax="false" dictType="business_tjdw">
  189. </BusinessSelect>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. </el-form-item>
  196. </el-col>
  197. </el-row>
  198. <el-row>
  199. <el-col :span="24">
  200. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  201. <el-input type="text" :value="formApprove.qmyy" maxlength="50" disabled
  202. :placeholder="$t('form.placeholderInput')" />
  203. </el-form-item>
  204. </el-col>
  205. </el-row>
  206. <el-row>
  207. <el-col :span="24">
  208. <el-form-item :label="$t('form.remark')" prop="remark">
  209. <el-input type="textarea" v-model="formApprove.remark" :rows="5" maxlength="500"
  210. :placeholder="$t('form.placeholderInput')">
  211. </el-input>
  212. </el-form-item>
  213. </el-col>
  214. </el-row>
  215. <el-row>
  216. <el-col :span="24">
  217. <el-form-item :label="$t('form.signer')">
  218. <el-input type="text" v-model="nickName" maxlength="50" disabled
  219. :placeholder="$t('form.placeholderInput')" />
  220. </el-form-item>
  221. </el-col>
  222. </el-row>
  223. <el-row>
  224. <el-col :span="24">
  225. <el-form-item :label="$t('form.password')" prop="qmrmm">
  226. <div class="sbzdtcma"> <input type="text"></div>
  227. <el-input type="password" show-password v-model="formApprove.qmrmm" maxlength="20"
  228. :placeholder="$t('form.placeholderInput')" />
  229. </el-form-item>
  230. </el-col>
  231. </el-row>
  232. </el-form>
  233. <div slot="footer" class="dialog-footer">
  234. <el-button type="primary" @click="tj">{{ $t('form.confirm') }}</el-button>
  235. <el-button @click="openApprove = false">{{ $t('form.cancel') }}</el-button>
  236. </div>
  237. </el-dialog>
  238. <el-dialog :title="$t('page.business.study.studyFormFill.yjcc')" :visible.sync="openYjcc" width="1200px"
  239. append-to-body :close-on-click-modal="false">
  240. <el-form ref="formYjcc" :model="formYjcc" :rules="rulesYjcc" label-width="120px" v-if="openYjcc">
  241. <div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
  242. <el-row>
  243. <el-col :psna="24">
  244. <el-form-item>
  245. <div>
  246. <el-button type="primary" @click="addCcYj" style="margin-left: 10px;">{{
  247. $t('page.business.study.studyFormFill.tjcc') }}</el-button>
  248. </div>
  249. <template>
  250. <div v-if="cclistYj.length > 0">
  251. <el-card class="box-card" v-for="(citem, cindex) in cclistYj" :key="'cz' + cindex"
  252. style="margin-top: 10px;">
  253. <div slot="header" class="clearfix">
  254. <div style="display: flex;justify-content: space-between;">
  255. <div style="display: flex;">
  256. <div style="display: flex;">
  257. <div> 存储位置</div>
  258. <div>
  259. <el-select v-model="citem.ccwz" :placeholder="$t('form.placeholderSelect')"
  260. @change="ccwzYjChange(cindex)" filterable>
  261. <el-option v-for="item in ccwzlist" :key="item.id" :label="item.bh" :value="item.id" />
  262. </el-select>
  263. </div>
  264. </div>
  265. <div style="display: flex; margin-left: 10px;">
  266. <div> 存储条件</div>
  267. <div>
  268. <BusinessSelect v-model="citem.cctj" dictType="business_cctj" :multiple="true"
  269. style="width: 200px;">
  270. </BusinessSelect>
  271. </div>
  272. </div>
  273. </div>
  274. <div>
  275. <el-button type="danger" icon="el-icon-delete" v-if="cclistYj.length > 1" circle
  276. @click="delccYj(cindex)"></el-button>
  277. </div>
  278. </div>
  279. </div>
  280. <el-checkbox-group v-model="citem.list">
  281. <el-checkbox :label="item.bh" v-for="item in resourceYj" :key="'icz' + item.bh"
  282. :disabled="getDisabledCcYj(item.bh, cindex)"></el-checkbox>
  283. </el-checkbox-group>
  284. </el-card>
  285. </div>
  286. </template>
  287. </el-form-item>
  288. </el-col>
  289. </el-row>
  290. <el-row>
  291. <el-col :span="24">
  292. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  293. <el-input type="text" :value="formYjcc.qmyy" maxlength="50" disabled
  294. :placeholder="$t('form.placeholderInput')" />
  295. </el-form-item>
  296. </el-col>
  297. </el-row>
  298. <el-row>
  299. <el-col :span="24">
  300. <el-form-item :label="$t('form.remark')" prop="remark">
  301. <el-input type="textarea" v-model="formYjcc.remark" :rows="5" maxlength="500"
  302. :placeholder="$t('form.placeholderInput')">
  303. </el-input>
  304. </el-form-item>
  305. </el-col>
  306. </el-row>
  307. <el-row>
  308. <el-col :span="24">
  309. <el-form-item :label="$t('form.signer')">
  310. <el-input type="text" v-model="nickName" maxlength="50" disabled
  311. :placeholder="$t('form.placeholderInput')" />
  312. </el-form-item>
  313. </el-col>
  314. </el-row>
  315. <el-row>
  316. <el-col :span="24">
  317. <el-form-item :label="$t('form.password')" prop="qmrmm">
  318. <div class="sbzdtcma"> <input type="text"></div>
  319. <el-input type="password" show-password v-model="formYjcc.qmrmm" maxlength="20"
  320. :placeholder="$t('form.placeholderInput')" />
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. </el-form>
  325. <div slot="footer" class="dialog-footer">
  326. <el-button type="primary" @click="yjcc">{{ $t('form.confirm') }}</el-button>
  327. <el-button @click="openYjcc = false">{{ $t('form.cancel') }}</el-button>
  328. </div>
  329. </el-dialog>
  330. <el-dialog :title="$t('page.business.study.studyFormFill.bcjl')" :visible.sync="openSave" width="600px"
  331. append-to-body :close-on-click-modal="false">
  332. <el-form ref="formSave" :model="formSave" :rules="rulesSave" label-width="120px" v-if="openSave">
  333. <div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
  334. <el-row>
  335. <el-col :span="24">
  336. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  337. <el-input type="text" :value="formSave.qmyy" maxlength="50" disabled
  338. :placeholder="$t('form.placeholderInput')" />
  339. </el-form-item>
  340. </el-col>
  341. </el-row>
  342. <el-row>
  343. <el-col :span="24">
  344. <el-form-item :label="$t('form.remark')" prop="remark">
  345. <el-input type="textarea" v-model="formSave.remark" :rows="5" maxlength="500"
  346. :placeholder="$t('form.placeholderInput')">
  347. </el-input>
  348. </el-form-item>
  349. </el-col>
  350. </el-row>
  351. <el-row>
  352. <el-col :span="24">
  353. <el-form-item :label="$t('form.signer')">
  354. <el-input type="text" v-model="nickName" maxlength="50" disabled
  355. :placeholder="$t('form.placeholderInput')" />
  356. </el-form-item>
  357. </el-col>
  358. </el-row>
  359. <el-row>
  360. <el-col :span="24">
  361. <el-form-item :label="$t('form.password')" prop="qmrmm">
  362. <div class="sbzdtcma"> <input type="text"></div>
  363. <el-input type="password" show-password v-model="formSave.qmrmm" maxlength="20"
  364. :placeholder="$t('form.placeholderInput')" />
  365. </el-form-item>
  366. </el-col>
  367. </el-row>
  368. </el-form>
  369. <div slot="footer" class="dialog-footer">
  370. <el-button type="primary" @click="saveNext">{{ $t('form.confirm') }}</el-button>
  371. <el-button @click="openSave = false">{{ $t('form.cancel') }}</el-button>
  372. </div>
  373. </el-dialog>
  374. <el-dialog :title="$t('page.business.study.studyFormFill.tjsh')" :visible.sync="openTjsh" width="600px"
  375. append-to-body :close-on-click-modal="false">
  376. <el-form ref="formTjsh" :model="formTjsh" :rules="rulesTjsh" label-width="120px" v-if="openTjsh">
  377. <div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
  378. <el-row>
  379. <el-col :span="24">
  380. <el-form-item :label="$t('form.qmyy')" prop="qmyy">
  381. <el-input type="text" :value="formTjsh.qmyy" maxlength="50" disabled
  382. :placeholder="$t('form.placeholderInput')" />
  383. </el-form-item>
  384. </el-col>
  385. </el-row>
  386. <el-row>
  387. <el-col :span="24">
  388. <el-form-item :label="$t('form.remark')" prop="remark">
  389. <el-input type="textarea" v-model="formTjsh.remark" :rows="5" maxlength="500"
  390. :placeholder="$t('form.placeholderInput')">
  391. </el-input>
  392. </el-form-item>
  393. </el-col>
  394. </el-row>
  395. <el-row>
  396. <el-col :span="24">
  397. <el-form-item :label="$t('form.signer')">
  398. <el-input type="text" v-model="nickName" maxlength="50" disabled
  399. :placeholder="$t('form.placeholderInput')" />
  400. </el-form-item>
  401. </el-col>
  402. </el-row>
  403. <el-row>
  404. <el-col :span="24">
  405. <el-form-item :label="$t('form.password')" prop="qmrmm">
  406. <div class="sbzdtcma"> <input type="text"></div>
  407. <el-input type="password" show-password v-model="formTjsh.qmrmm" maxlength="20"
  408. :placeholder="$t('form.placeholderInput')" />
  409. </el-form-item>
  410. </el-col>
  411. </el-row>
  412. </el-form>
  413. <div slot="footer" class="dialog-footer">
  414. <el-button type="primary" @click="saveTjsh">{{ $t('form.confirm') }}</el-button>
  415. <el-button @click="openTjsh = false">{{ $t('form.cancel') }}</el-button>
  416. </div>
  417. </el-dialog>
  418. </div>
  419. </template>
  420. <script>
  421. import { listData } from "@/api/system/dict/data"
  422. import { studyFormFill_bc, studyFormFill_yjccFilter, studyFormFill_yjcc, studyFormFill_tjblxjsh, studyFormFill_bcOnly, studyFormFill_updateBdnr, studyFormFill_tj, studyFormFill_info, studyFormFill_updateFhyjjl } from "@/api/business/study/studyFormFill"
  423. import { study_info } from "@/api/business/study/study"
  424. import { mapGetters } from 'vuex'
  425. import SelectTemplate from "@/views/business/comps/select/SelectTemplate";
  426. import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
  427. import TemplateTable from '@/views/business/comps/template/TemplateTable';
  428. import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
  429. import { deepClone, caesarDecipher } from "@/utils/index";
  430. import { EventBus } from "@/utils/eventBus";
  431. export default {
  432. name: "Bj",
  433. components: { SelectTemplate, SelectDeptUser, TemplateTable, BusinessSelect },
  434. data() {
  435. return {
  436. showIndex: 1,
  437. form: {},
  438. rules: {
  439. bdmc: [{
  440. required: true,
  441. message: ' ',
  442. trigger: 'blur'
  443. }],
  444. templateId: [{
  445. required: true,
  446. message: ' ',
  447. trigger: 'blur'
  448. }],
  449. sfbl: [{
  450. required: true,
  451. message: ' ',
  452. trigger: 'blur'
  453. }],
  454. },
  455. czlist: [],
  456. cclist: [],
  457. cclistYj: [],
  458. openSave: false,
  459. openTjsh: false,
  460. openApprove: false,
  461. openYjcc: false,
  462. formSave: {
  463. qmyy: this.$t('page.business.study.studyFormFill.txbbc'),
  464. remark: '',
  465. qmrmm: '',
  466. },
  467. formApprove: {
  468. id: null,
  469. qmyy: this.$t('page.business.study.studyFormFill.txbtjjl'),
  470. remark: '',
  471. bdnr: '',
  472. resource: '',
  473. yqResource: '',
  474. jcbList: '',
  475. xbxj: '',
  476. qmrmm: '',
  477. sfcz: false,
  478. czfs: '',
  479. czfsqt: '',
  480. czids: '',
  481. sfcc: false,
  482. cctj: '',
  483. ccwz: '',
  484. ccids: '',
  485. },
  486. formYjcc: {
  487. id: null,
  488. qmyy: this.$t('page.business.study.studyFormFill.yjcc'),
  489. remark: '',
  490. resource: '',
  491. qmrmm: '',
  492. sfcz: false,
  493. czfs: '',
  494. czfsqt: '',
  495. czids: '',
  496. sfcc: false,
  497. cctj: '',
  498. ccwz: '',
  499. ccids: '',
  500. },
  501. formTjsh: {
  502. id: null,
  503. qmyy: this.$t('page.business.study.studyFormFill.txbtjjl'),
  504. remark: '',
  505. bdnr: '',
  506. qmrmm: '',
  507. },
  508. resourceYj: [],
  509. resource: [],
  510. yqResource: [],
  511. jcbList: [],
  512. xbxj: [],
  513. bdmbTitle: this.$t('page.business.form.bdmb'),
  514. rulesApprove: {
  515. qmrmm: [{
  516. required: true,
  517. message: ' ',
  518. trigger: 'blur'
  519. }]
  520. },
  521. rulesYjcc: {
  522. qmrmm: [{
  523. required: true,
  524. message: ' ',
  525. trigger: 'blur'
  526. }]
  527. },
  528. rulesTjsh: {
  529. qmrmm: [{
  530. required: true,
  531. message: ' ',
  532. trigger: 'blur'
  533. }]
  534. },
  535. rulesSave: {
  536. qmrmm: [{
  537. required: true,
  538. message: ' ',
  539. trigger: 'blur'
  540. }]
  541. },
  542. templateData: {},
  543. studyType: null,
  544. studyFormType: null,
  545. ccwzlist: [],
  546. selectedDeptId: null,
  547. }
  548. },
  549. computed: {
  550. ...mapGetters([
  551. 'nickName', 'name'
  552. ]),
  553. },
  554. created() {
  555. this.getInfo()
  556. this.getCcwz()
  557. },
  558. methods: {
  559. validForm() {
  560. this.$refs["form"].validate(valid => {
  561. if (valid) { }
  562. })
  563. },
  564. getCcwz() {
  565. listData({
  566. pageNum: 1,
  567. pageSize: 999999,
  568. dictType: 'business_ccwz',
  569. status: 0
  570. }).then(response => {
  571. this.ccwzlist = response.rows
  572. })
  573. },
  574. ccwzChange(cindex) {
  575. let that = this
  576. let _index = _.findIndex(this.ccwzlist, function (item) {
  577. return item.id == that.cclist[cindex].ccwz
  578. })
  579. that.cclist[cindex].cctj = that.ccwzlist[_index].wc
  580. },
  581. ccwzYjChange(cindex) {
  582. let that = this
  583. let _index = _.findIndex(this.ccwzlist, function (item) {
  584. return item.id == that.cclistYj[cindex].ccwz
  585. })
  586. that.cclistYj[cindex].cctj = that.ccwzlist[_index].wc
  587. },
  588. onFillCallback(data) {
  589. console.log("data:" + JSON.stringify(data))
  590. console.log("formdata:" + JSON.stringify(this.$refs.templateTable.getFilledFormData()))
  591. if (data.type == 'fieldChanged') {
  592. studyFormFill_updateBdnr(
  593. {
  594. id: this.form.id,
  595. bdnr: JSON.stringify(this.$refs.templateTable.getFilledFormData()),
  596. zdxgjl: data.resourceList ? JSON.stringify(data.resourceList) : '',
  597. filedValue: data.newRecord ? JSON.stringify(data.newRecord) : '',
  598. submittedCodes: data.submittedCodes ? JSON.stringify(data.submittedCodes) : ''
  599. }
  600. ).then(response => {
  601. })
  602. } else if (data.type == 'reply') {
  603. studyFormFill_updateFhyjjl(
  604. {
  605. id: this.form.id,
  606. reply: JSON.stringify(data.newRecord),
  607. fhyjjl: JSON.stringify(data.resourceList)
  608. }
  609. ).then(response => {
  610. })
  611. }
  612. },
  613. delcc(index) {
  614. this.cclist.splice(index, 1)
  615. },
  616. delccYj(index) {
  617. this.cclistYj.splice(index, 1)
  618. },
  619. delcz(index) {
  620. this.czlist.splice(index, 1)
  621. },
  622. addCz() {
  623. this.czlist.push({
  624. list: [],
  625. czfs: ''
  626. })
  627. },
  628. addCc() {
  629. this.cclist.push({
  630. list: [],
  631. cctj: '',
  632. ccwz: ''
  633. })
  634. },
  635. addCcYj() {
  636. this.cclistYj.push({
  637. list: [],
  638. cctj: '',
  639. ccwz: ''
  640. })
  641. },
  642. getInfo() {
  643. let key = this.$route.params.key
  644. if (key && key != undefined && key != '') {
  645. let params = null
  646. try {
  647. params = JSON.parse(caesarDecipher(this.$route.params.key))
  648. this.studyType = params.studyType || null
  649. this.studyFormType = params.studyFormType || 5
  650. this.selectedDeptId = params.selectedDeptId || null
  651. } catch (e) {
  652. console.log('参数错误')
  653. }
  654. if (params) {
  655. this.reset()
  656. if (params.formId && params.formId != '') {
  657. this.$modal.loading()
  658. studyFormFill_info({ id: params.formId }).then(response => {
  659. this.form = response.data
  660. this.form.qmyy = this.$t('page.business.study.studyFormFill.zztjyzbd')
  661. this.templateData = deepClone(this.form)
  662. const obj = Object.assign({}, this.$route, { title: this.form.bdmc })
  663. this.$tab.updatePage(obj);
  664. if (params.fromYt) {
  665. this.showIndex = 1
  666. this.bdmbTitle = this.$t('page.business.study.studyFormFill.ytbd')
  667. } else {
  668. this.showIndex = 2
  669. }
  670. this.saveSimpleLog({ jcmc: '填报表单编辑', jcmcEn: 'Record Edit', name: this.form.bdmc + '(' + this.form.bdbh + ')', nameEn: this.form.bdmc + '(' + this.form.bdbh + ')' })
  671. this.$modal.closeLoading()
  672. })
  673. } else {
  674. this.showIndex = 1
  675. this.$modal.loading()
  676. study_info({ id: params.studyId }).then(response => {
  677. this.form = _.merge({}, this.form, { studySubjectId: params.studySubjectId, studyId: params.studyId, resourceStudy: response.data.resource, sftb: 1, studyMc: response.data.name, studySn: response.data.sn })
  678. this.templateData = deepClone(this.form)
  679. const obj = Object.assign({}, this.$route, { title: this.$t('page.business.study.studyFormFill.xzbd') })
  680. this.$tab.updatePage(obj);
  681. let name = this.studyType == 1 ? '试验' : (this.studyType == 5 ? '非试验表单' : '麻精药表单')
  682. let nameEn = this.studyType == 1 ? 'Study' : (this.studyType == 5 ? 'Non-study' : 'ontrolled Drug')
  683. this.saveSimpleLog({ jcmc: '填报表单新增', jcmcEn: 'Record Create', name: name, nameEn: nameEn })
  684. this.$modal.closeLoading()
  685. })
  686. }
  687. } else {
  688. this.$tab.closeOpenPage('/404')
  689. }
  690. }
  691. },
  692. getDisabledCz(bh, idx) {
  693. let mark = false
  694. for (var i = 0; i < this.czlist.length; i++) {
  695. if (idx != i) {
  696. for (var j = 0; j < this.czlist[i].list.length; j++) {
  697. if (this.czlist[i].list[j] == bh) {
  698. mark = true;
  699. break
  700. }
  701. }
  702. }
  703. }
  704. return mark
  705. },
  706. getDisabledCc(bh, idx) {
  707. let mark = false
  708. for (var i = 0; i < this.cclist.length; i++) {
  709. if (idx != i) {
  710. for (var j = 0; j < this.cclist[i].list.length; j++) {
  711. if (this.cclist[i].list[j] == bh) {
  712. mark = true;
  713. break
  714. }
  715. }
  716. }
  717. }
  718. return mark
  719. },
  720. getDisabledCcYj(bh, idx) {
  721. let mark = false
  722. for (var i = 0; i < this.cclistYj.length; i++) {
  723. if (idx != i) {
  724. for (var j = 0; j < this.cclistYj[i].list.length; j++) {
  725. if (this.cclistYj[i].list[j] == bh) {
  726. mark = true;
  727. break
  728. }
  729. }
  730. }
  731. }
  732. return mark
  733. },
  734. sfczChange() {
  735. if (!this.formApprove.sfcz) {
  736. this.czlist = []
  737. }
  738. },
  739. sfccChange() {
  740. if (!this.formApprove.sfcc) {
  741. this.cclist = []
  742. }
  743. },
  744. async showApprove() {
  745. let that = this
  746. let content = await that.$refs.templateTable.getFormData()
  747. if (content) {
  748. that.resetApprove()
  749. that.formApprove.id = that.form.id
  750. that.formApprove.bdnr = JSON.stringify(content)
  751. that.resource = that.$refs.templateTable.getResource()
  752. that.yqResource = that.$refs.templateTable.getYqResource()
  753. that.jcbList = that.$refs.templateTable.getJcbList()
  754. that.xbxj = that.$refs.templateTable.getXbxj()
  755. that.openApprove = true
  756. }
  757. },
  758. async showYjcc() {
  759. let that = this
  760. that.resetYjcc()
  761. that.formYjcc.id = that.form.id
  762. that.cclistYj = []
  763. that.addCcYj()
  764. that.$refs.templateTable.getFilledFormData()
  765. let resource = that.$refs.templateTable.getResource()
  766. if (resource.length > 0) {
  767. that.$modal.loading()
  768. studyFormFill_yjccFilter({ id: this.form.id, resource: JSON.stringify(resource) }).then(response => {
  769. let tmpResource = JSON.parse(response.msg)
  770. if (tmpResource.length > 0) {
  771. that.resourceYj = tmpResource
  772. that.openYjcc = true
  773. } else {
  774. that.$modal.msgError("没有可存储的药剂")
  775. }
  776. }).finally(() => {
  777. that.$modal.closeLoading()
  778. })
  779. } else {
  780. that.$modal.msgError("没有可存储的药剂")
  781. }
  782. },
  783. async showTjsh(qmyy) {
  784. let that = this
  785. let content = await this.$refs.templateTable.getFormData()
  786. if (content) {
  787. that.formTjsh.id = that.form.id
  788. that.formTjsh.remark = ''
  789. that.formTjsh.qmrmm = ''
  790. that.formTjsh.bdnr = ''
  791. that.openTjsh = true
  792. }
  793. },
  794. async saveTjsh() {
  795. let that = this
  796. this.$refs["formTjsh"].validate(valid => {
  797. if (valid) {
  798. this.formTjsh.bdnr = JSON.stringify(this.$refs.templateTable.getFilledFormData())
  799. that.$modal.loading()
  800. studyFormFill_tjblxjsh(that.formTjsh).then(response => {
  801. that.openTjsh = false
  802. that.cancelSave()
  803. }).finally(() => {
  804. that.$modal.closeLoading()
  805. })
  806. }
  807. })
  808. },
  809. resetYjcc() {
  810. this.formYjcc = {
  811. id: null,
  812. qmyy: this.$t('page.business.study.studyFormFill.yjcc'),
  813. remark: '',
  814. bdnr: '',
  815. resource: '',
  816. qmrmm: '',
  817. sfcz: false,
  818. czlist: '',
  819. sfcc: false,
  820. cclist: '',
  821. }
  822. this.resetForm("formYjcc")
  823. },
  824. resetApprove() {
  825. this.formApprove = {
  826. id: null,
  827. qmyy: this.$t('page.business.study.studyFormFill.txbtjjl'),
  828. remark: '',
  829. bdnr: '',
  830. resource: '',
  831. qmrmm: '',
  832. sfcz: false,
  833. czlist: '',
  834. sfcc: false,
  835. cclist: '',
  836. }
  837. this.resetForm("formApprove")
  838. },
  839. pre() {
  840. this.showIndex = 1
  841. },
  842. next() {
  843. this.$refs["form"].validate(valid => {
  844. if (valid) {
  845. this.showIndex = 2
  846. this.$modal.loading()
  847. studyFormFill_bcOnly(this.form).then(response => {
  848. this.form = response.data
  849. this.templateData = deepClone(this.form)
  850. this.showIndex = 2
  851. const obj = Object.assign({}, this.$route, { title: this.form.bdmc })
  852. this.$tab.updatePage(obj);
  853. }).finally(() => {
  854. this.$modal.closeLoading()
  855. })
  856. }
  857. })
  858. },
  859. selectTemplateChange(val) {
  860. this.form.bdnr = val.content
  861. if (this.$i18n.locale === 'zh_CN') {
  862. this.form.templateMc = val.name
  863. this.form.bdmc = val.name
  864. } else {
  865. this.form.templateMc = val.nameEn
  866. this.form.bdmc = val.nameEn
  867. }
  868. this.form.templateSn = val.sn
  869. this.templateData = deepClone(this.form)
  870. setTimeout(() => {
  871. this.$refs["form"].validate()
  872. }, 200)
  873. },
  874. cancel() {
  875. try {
  876. let key = caesarDecipher(this.$route.params.key)
  877. let data = JSON.parse(key)
  878. if (data && data != undefined && data != '') {
  879. const obj = { path: data.url }
  880. this.$tab.closeOpenPage(obj)
  881. }
  882. } catch (e) {
  883. this.$tab.closeOpenPage('/404')
  884. }
  885. },
  886. cancelSave() {
  887. try {
  888. // 类型1试验,5非试验表单,10麻精药表单
  889. EventBus.$emit('onRefreshStudyTbbdList', {});
  890. EventBus.$emit('onRefreshNonTrialTbbdList', {});
  891. EventBus.$emit('onRefreshDrugTbbdList', {});
  892. let key = caesarDecipher(this.$route.params.key)
  893. let data = JSON.parse(key)
  894. if (data && data != undefined && data != '') {
  895. const obj = { path: data.urlTj ? data.urlTj : data.url }
  896. this.$tab.closeOpenPage(obj)
  897. }
  898. } catch (e) {
  899. this.$tab.closeOpenPage('/404')
  900. }
  901. },
  902. reset() {
  903. this.form = {
  904. id: null,
  905. studyId: null,
  906. bdbh: null,
  907. bdmc: null,
  908. bdsm: null,
  909. templateId: null,
  910. templateMc: null,
  911. templateSn: null,
  912. bdnr: null,
  913. resource: null,
  914. resourceStudy: null,
  915. fzrsh: null,
  916. shryId: null,
  917. sfbl: null,
  918. shryMc: null,
  919. }
  920. this.resetForm("form")
  921. },
  922. selectDeptUserChange(val) {
  923. this.form.shryMc = val.name
  924. },
  925. save() {
  926. this.$refs["form"].validate(valid => {
  927. if (valid) {
  928. this.$modal.loading()
  929. studyFormFill_bcOnly(this.form).then(response => {
  930. this.$modal.closeLoading()
  931. this.cancelSave()
  932. }).finally(() => {
  933. this.$modal.closeLoading()
  934. })
  935. }
  936. })
  937. },
  938. showSave() {
  939. this.formSave.remark = ''
  940. this.formSave.qmrmm = ''
  941. this.openSave = true
  942. },
  943. async saveNext() {
  944. this.$refs["formSave"].validate(valid => {
  945. if (valid) {
  946. this.form.bdnr = JSON.stringify(this.$refs.templateTable.getFilledFormData())
  947. this.form.qmrmm = this.formSave.qmrmm
  948. this.form.remark = this.formSave.remark
  949. this.$modal.loading()
  950. studyFormFill_bc(this.form).then(response => {
  951. this.$modal.closeLoading()
  952. this.cancelSave()
  953. }).finally(() => {
  954. this.$modal.closeLoading()
  955. })
  956. }
  957. })
  958. },
  959. yjcc() {
  960. let that = this
  961. this.$refs["formYjcc"].validate(valid => {
  962. if (valid) {
  963. if (that.cclistYj.length == 0) {
  964. this.$modal.msgError("请选择要处置的药剂")
  965. } else {
  966. for (var i = 0; i < that.cclistYj.length; i++) {
  967. if (!that.cclistYj[i].ccwz || that.cclistYj[i].ccwz == '') {
  968. this.$modal.msgError('第' + (i + 1) + "个存储,存储位置不能为空")
  969. return
  970. }
  971. if (!that.cclistYj[i].cctj || that.cclistYj[i].cctj == '') {
  972. this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空")
  973. return
  974. }
  975. }
  976. that.$modal.loading()
  977. that.formYjcc.resource = JSON.stringify(that.resourceYj)
  978. that.formYjcc.cclist = JSON.stringify(that.cclistYj)
  979. studyFormFill_yjcc(that.formYjcc).then(response => {
  980. that.openYjcc = false
  981. that.$modal.closeLoading()
  982. that.cancelSave()
  983. }).finally(() => {
  984. that.$modal.closeLoading()
  985. })
  986. }
  987. }
  988. })
  989. },
  990. tj() {
  991. let that = this
  992. this.$refs["formApprove"].validate(valid => {
  993. if (valid) {
  994. that.$modal.loading()
  995. that.formApprove.resource = JSON.stringify(that.resource)
  996. that.formApprove.yqResource = JSON.stringify(that.yqResource)
  997. that.formApprove.jcbList = JSON.stringify(that.jcbList)
  998. that.formApprove.xbxj = JSON.stringify(that.xbxj)
  999. if (that.czlist.length > 0) {
  1000. that.formApprove.czlist = JSON.stringify(that.czlist)
  1001. }
  1002. if (that.cclist.length > 0) {
  1003. that.formApprove.cclist = JSON.stringify(that.cclist)
  1004. }
  1005. studyFormFill_tj(that.formApprove).then(response => {
  1006. that.openApprove = false
  1007. that.$modal.closeLoading()
  1008. that.cancelSave()
  1009. }).finally(() => {
  1010. that.$modal.closeLoading()
  1011. })
  1012. }
  1013. })
  1014. }
  1015. }
  1016. }
  1017. </script>