华西海圻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.

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